CPU Graph - More Detail
On a reasonable specification PC there is little detail to be seen on the CPU graph as most of the CPU time is 'idle'. This change removes the idle element to allow a much more detialed view of system and user use of the CPU.
- Edit /usr/local/bin/makegraphs for this change. Replace the updatecpugraph procedure to read:
-sub updatecpugraph {
my $period = $_[0];
RRDs::graph ("$graphs/cpu-$period.png",
"--start", "-1$period", "-aPNG", "-i", "-z",
"--alt-y-grid", "-w 500", "-h 100", "-l 0", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"-t $tr{'cpu usage per'} $tr{$period}",
"DEF:user=$rrdlog/cpu.rrd:user:AVERAGE",
"DEF:system=$rrdlog/cpu.rrd:system:AVERAGE",
"DEF:idle=$rrdlog/cpu.rrd:idle:AVERAGE",
"CDEF:total=user,system,idle,+,+",
"CDEF:userpct=100,user,total,/,*",
"CDEF:systempct=100,system,total,/,*",
"CDEF:idlepct=100,idle,total,/,*",
"AREA:userpct#0000FF:$tr{'user cpu usage'}\\j",
"STACK:systempct#FF0000:$tr{'system cpu usage'}\\j",
"GPRINT:userpct:MAX:$tr{'maximal'} $tr{'user cpu'}\\:%3.2lf%%",
"GPRINT:userpct:AVERAGE:$tr{'average'} $tr{'user cpu'}\\:%3.2lf%%",
"GPRINT:userpct:LAST:$tr{'current'} $tr{'user cpu'}\\:%3.2lf%%\\j",
"GPRINT:systempct:MAX:$tr{'maximal'} $tr{'system cpu'}\\:%3.2lf%%",
"GPRINT:systempct:AVERAGE:$tr{'average'} $tr{'system cpu'}\\:%3.2lf%%",
"GPRINT:systempct:LAST:$tr{'current'} $tr{'system cpu'}\\:%3.2lf%%\\j",
"GPRINT:idlepct:MAX:$tr{'maximal'} $tr{'idle cpu'}\\:%3.2lf%%",
"GPRINT:idlepct:AVERAGE:$tr{'average'} $tr{'idle cpu'}\\:%3.2lf%%",
"GPRINT:idlepct:LAST:$tr{'current'} $tr{'idle cpu'}\\:%3.2lf%%\\j");
$ERROR = RRDs::error;
print "Error in RRD::graph for cpu: $ERROR\n" if $ERROR;
}

= That's it =
This page has been viewed 644 times since Nov 2009.
Previous page: Reduced Graph Width
Next page: GUI list
Print this page