Topic
  • 5 replies
  • Latest Post - ‏2013-12-09T17:57:04Z by BruceSpencer
fbenfredj
fbenfredj
40 Posts

Pinned topic nmon2web 2.0.6 : bug when generating top_all.gif

‏2013-12-06T16:40:18Z | nmon2web processes top

Hi all,

First of all, thanks to Nigel for the nmon tool. It is strong and very usefull.

Thanks also, to Bruce for nmon2web. Good job, especially the last version (2.0.6).

But, there is a bug that prevent me to have the Top Processes graph.

When creating rrd_graph file, processes containing "_" will the have the same RRD DEF variable as other processes begining with the same word.

For example, these are lines from rrd_graph that concern top_topas and topas and topas_nmon :

DEF:topas_CPUPCT=../../../rrddata/top_topas.rrd:CPUPCT:AVERAGE STACK:topas_CPUPCT#8d0091:"topas_CPUPCT"  
DEF:topas_CPUPCT=../../../rrddata/top_topas_nmon.rrd:CPUPCT:AVERAGE STACK:topas_CPUPCT#508420:"topas_CPUPCT"

Another example :

DEF:pp_CPUPCT=../../../rrddata/top_pp_filler.rrd:CPUPCT:AVERAGE STACK:pp_CPUPCT#a294ef:"pp_CPUPCT"  
DEF:pp_CPUPCT=../../../rrddata/top_pp_skimmer.rrd:CPUPCT:AVERAGE STACK:pp_CPUPCT#37eafe:"pp_CPUPCT"

This cause the rrdtool to genrate this error :

ERROR: Attempting to reuse 'pp_CPUPCT'

And the top_all.gif can not be generated.

 

I also have a wish. Is it possible to have 2 top graphes : one stacked and the other not stacked.

Thanks a lot for your help.

Regards

Faouzi BEN FREDJ

 

  • BruceSpencer
    BruceSpencer
    297 Posts

    Re: nmon2web 2.0.6 : bug when generating top_all.gif

    ‏2013-12-08T16:09:28Z  

    Can you upload a couple for nmon files for testing that have this problem?  I think I see the problem and the fix, but want to test it.

  • fbenfredj
    fbenfredj
    40 Posts

    Re: nmon2web 2.0.6 : bug when generating top_all.gif

    ‏2013-12-09T10:58:05Z  

    Can you upload a couple for nmon files for testing that have this problem?  I think I see the problem and the fix, but want to test it.

    Hi Bruce,

    I needed the graphs Friday, so I changed the nmon2web as follow :

    - for the top_all.gif bug :

                    I replaced this line :

                   $device= (split(/_/,$rrdfile))[1];

                    By theses ones :

                     @devicelong= (split(/_/,$rrdfile));
                    if ( @devicelong > 2 ) {
                         $device=$devicelong[1] . "_" . $devicelong[2];
                     } else {
                         $device=$devicelong[1];

                                            }                       
     

    - For my wish (top graph not stacked) :

                     I added this line after the line containing top_all.gif :

                    qq|top:graph top_allline.gif -l 0 -v "Percent" --start $START --end $UTC_END --width $WIDTH --height $HEIGHT --title "TOP Processes on $HOSTNAME $HOSTNAME ($DATE)" :CPUPCT|

     

    You will find attched 2 nmon files 

    Regrads

                                     

  • BruceSpencer
    BruceSpencer
    297 Posts

    Re: nmon2web 2.0.6 : bug when generating top_all.gif

    ‏2013-12-09T14:50:39Z  

    That works!    Glad to see you fixed it.   I hadn't worked in that section of the code in a long time. It took me a while to remember how I did it.  It's almost like someone else wrote it.   :-)

    There were several ways to do this. For comparison, I would have replaced

    $device= (split(/_/,$rrdfile))[1];

    with

    $device=$rrdfile;
    $device =~ s/[^_]+_//; # erase up to first underscore

    This change will handle multiple underscores in the process/rrdfile name.. 
     

     

    Updated on 2013-12-09T14:52:20Z at 2013-12-09T14:52:20Z by BruceSpencer
  • fbenfredj
    fbenfredj
    40 Posts

    Re: nmon2web 2.0.6 : bug when generating top_all.gif

    ‏2013-12-09T16:50:53Z  

    That works!    Glad to see you fixed it.   I hadn't worked in that section of the code in a long time. It took me a while to remember how I did it.  It's almost like someone else wrote it.   :-)

    There were several ways to do this. For comparison, I would have replaced

    $device= (split(/_/,$rrdfile))[1];

    with

    $device=$rrdfile;
    $device =~ s/[^_]+_//; # erase up to first underscore

    This change will handle multiple underscores in the process/rrdfile name.. 
     

     

    Great! that works.

    There is also, another bug with CPU graphs.

    In fact, for lpar that are shared, the CPU_ALL graph is not very relevant.

    So it is better to change it with %CPU versus VPs.

    Here is what I changed in nmon2web.pl script :

    In this statement :                               

    if ( -f "$RRD_DIR/lpar.rrd" && $TYPE=~/Shared/ ) {

    I added this line                                

    print RRDGRAPH (qq|graph cpu_vsvp.gif -r -l 0 -u 100 -v "Percent Stacked" --start $START --end $UTC_END --width $WIDTH --height $HEIGHT --title "CPU vs VPs Utilization $HOSTNAME ($DATE)" DEF:User=$RDIR/lpar.rrd:VP_UserPct:AVERAGE AREA:User#0000FF:"User%" DEF:Sys=$RDIR/lpar.rrd:VP_SysPct:AVERAGE STACK:Sys#00FF00:"Sys%" DEF:Wait=$RDIR/lpar.rrd:VP_WaitPct:AVERAGE STACK:Wait#FF0000:"Wait%" \n|);


    And I also add an "else" part and I move this line in it :

    else {

    print RRDGRAPH (qq|graph cpu_all.gif -r -l 0 -u 100 -v "Percent Stacked" --start $START --end $UTC_END --width $WIDTH --height $HEIGHT --title "Over all CPU Utilization $HOSTNAME ($DATE)" DEF:User=$RDIR/cpu_all.rrd:UserPct:AVERAGE AREA:User#0000FF:"User%" DEF:Sys=$RDIR/cpu_all.rrd:SysPct:AVERAGE STACK:Sys#00FF00:"Sys%" DEF:Wait=$RDIR/cpu_all.rrd:WaitPct:AVERAGE STACK:Wait#FF0000:"Wait%" \n|);

    }

     

    Hope we will have new version with theses changes.

     

  • BruceSpencer
    BruceSpencer
    297 Posts

    Re: nmon2web 2.0.6 : bug when generating top_all.gif

    ‏2013-12-09T17:57:04Z  
    • fbenfredj
    • ‏2013-12-09T16:50:53Z

    Great! that works.

    There is also, another bug with CPU graphs.

    In fact, for lpar that are shared, the CPU_ALL graph is not very relevant.

    So it is better to change it with %CPU versus VPs.

    Here is what I changed in nmon2web.pl script :

    In this statement :                               

    if ( -f "$RRD_DIR/lpar.rrd" && $TYPE=~/Shared/ ) {

    I added this line                                

    print RRDGRAPH (qq|graph cpu_vsvp.gif -r -l 0 -u 100 -v "Percent Stacked" --start $START --end $UTC_END --width $WIDTH --height $HEIGHT --title "CPU vs VPs Utilization $HOSTNAME ($DATE)" DEF:User=$RDIR/lpar.rrd:VP_UserPct:AVERAGE AREA:User#0000FF:"User%" DEF:Sys=$RDIR/lpar.rrd:VP_SysPct:AVERAGE STACK:Sys#00FF00:"Sys%" DEF:Wait=$RDIR/lpar.rrd:VP_WaitPct:AVERAGE STACK:Wait#FF0000:"Wait%" \n|);


    And I also add an "else" part and I move this line in it :

    else {

    print RRDGRAPH (qq|graph cpu_all.gif -r -l 0 -u 100 -v "Percent Stacked" --start $START --end $UTC_END --width $WIDTH --height $HEIGHT --title "Over all CPU Utilization $HOSTNAME ($DATE)" DEF:User=$RDIR/cpu_all.rrd:UserPct:AVERAGE AREA:User#0000FF:"User%" DEF:Sys=$RDIR/cpu_all.rrd:SysPct:AVERAGE STACK:Sys#00FF00:"Sys%" DEF:Wait=$RDIR/cpu_all.rrd:WaitPct:AVERAGE STACK:Wait#FF0000:"Wait%" \n|);

    }

     

    Hope we will have new version with theses changes.

     

    Thank you! Good suggestion.  I'll add these changes in the next update.