Ok here is a graph I've managed to create of 4 CPUs on one box:
As you will see its not *quite* right, the Mean CPU function seems to give a different amount than you would expect - i.e. higher..
The function it uses is a CDEF I created which looks like this:
CDEF:cdefa=TIME,1138381205,GT,b,b,UN,0,b,IF,IF,TIME,1138381205,GT,b,b,UN,0,b,IF,IF,TIME,1138381205,GT,c,c,UN,0,c,IF,IF,TIME,1138381205,GT,d,d,UN,0,d,IF,IF,TIME,1138381205,GT,e,e,UN,0,e,IF,IF,+,+,+,+,4,/ \
basically What I thought I was doing was a cdef which looks like this:
Code:
Item Item Value
Item #1 Special Data Source: ALL_DATA_SOURCES_NODUPS
Item #2 Custom String: 4
Item #3 Operator: /
Is there acdef function you can use which will give the average over all data sources?
What the CDEF I've created SEEMS to do is add up ALL the data sources (including itself) for the graph then divide by 4.... Which gives the higher value than the average should be - and leads to the MAX value being higher than 100%...
Here is the entire code for the graph.
Code:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Multi CPU Utilization on UKHALWEB1" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
DEF:a="/var/www/html/rra/ukhalweb1_cpu_97.rrd":cpu:AVERAGE \
DEF:b="/var/www/html/rra/ukhalweb1_cpu_97.rrd":cpu:AVERAGE \
DEF:c="/var/www/html/rra/ukhalweb1_cpu_98.rrd":cpu:AVERAGE \
DEF:d="/var/www/html/rra/ukhalweb1_cpu_99.rrd":cpu:AVERAGE \
DEF:e="/var/www/html/rra/ukhalweb1_cpu_100.rrd":cpu:AVERAGE \
CDEF:cdefa=TIME,1138381205,GT,b,b,UN,0,b,IF,IF,TIME,1138381205,GT,b,b,UN,0,b,IF,IF,TIME,1138381205,GT,c,c,UN,0,c,IF,IF,TIME,1138381205,GT,d,d,UN,0,d,IF,IF,TIME,1138381205,GT,e,e,UN,0,e,IF,IF,+,+,+,+,4,/ \
CDEF:cdefb=TIME,1138381205,GT,b,b,UN,0,b,IF,IF,TIME,1138381205,GT,b,b,UN,0,b,IF,IF,TIME,1138381205,GT,c,c,UN,0,c,IF,IF,TIME,1138381205,GT,d,d,UN,0,d,IF,IF,TIME,1138381205,GT,e,e,UN,0,e,IF,IF,+,+,+,+,4,/ \
AREA:cdefa#FAFD9E:"Mean CPU" \
GPRINT:cdefb:LAST:" Current\:%8.2lf %%" \
GPRINT:cdefb:MIN:"Min\:%8.2lf %%" \
GPRINT:cdefb:MAX:"Max\:%8.2lf %%\n" \
LINE1:b#0000FF:"CPU0" \
GPRINT:b:LAST:" Current\:%8.2lf %%" \
GPRINT:b:MIN:"Min\:%8.2lf %%" \
GPRINT:b:MAX:"Max\:%8.2lf %%\n" \
LINE1:c#00A348:"CPU1" \
GPRINT:c:LAST:" Current\:%8.2lf %%" \
GPRINT:c:MIN:"Min\:%8.2lf %%" \
GPRINT:c:MAX:"Max\:%8.2lf %%\n" \
LINE1:d#C4FD3D:"CPU2" \
GPRINT:d:AVERAGE:" Current\:%8.2lf %%" \
GPRINT:d:MIN:"Min\:%8.2lf %%" \
GPRINT:d:MAX:"Max\:%8.2lf %%\n" \
LINE1:e#FF0000:"CPU3" \
GPRINT:e:AVERAGE:" Current\:%8.2lf %%" \
GPRINT:e:MIN:"Min\:%8.2lf %%" \
GPRINT:e:MAX:"Max\:%8.2lf %%"