I have been fiddling around with Cacti for the past two days, and after a bit of a learning curve, I managed to come up with what I wanted: Unfortunately, I can't get that image straight out of cacti..
To get the cores spaced out nicely like that, this is what I fed rrdtool:
Code: Select all
/usr/bin/rrdtool graph /var/www/minecraft/www/test.png \
--imgformat=PNG \
--title='Localhost - CPU Utilization' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit='400' \
--lower-limit='0' \
COMMENT:" \n" \
--vertical-label='percent' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/usr/share/cacti/rra/localhost_cpu_17.rrd":'cpu':AVERAGE \
DEF:b="/usr/share/cacti/rra/localhost_cpu_18.rrd":'cpu':AVERAGE \
DEF:c="/usr/share/cacti/rra/localhost_cpu_19.rrd":'cpu':AVERAGE \
DEF:d="/usr/share/cacti/rra/localhost_cpu_20.rrd":'cpu':AVERAGE \
CDEF:cdefi='TIME,1345237069,GT,a,a,UN,0,a,IF,IF,TIME,1345237069,GT,b,b,UN,0,b,IF,IF,TIME,1345237069,GT,c,c,UN,0,c,IF,IF,TIME,1345237069,GT,d,d,UN,0,d,IF,IF,+,+,+' \
AREA:a#FF4105FF:"CPU 0 Utilization" \
HRULE:100#0000007F:"" \
LINE1:100 \
AREA:b#FF5700FF:"CPU 1 Utilization":STACK \
HRULE:200#0000007F:"" \
LINE1:200 \
AREA:c#FF7D00FF:"CPU 2 Utilization":STACK \
HRULE:300#0000007F:"" \
LINE1:300 \
AREA:d#FFAB00FF:"CPU 3 Utilization":STACK \
HRULE:400#0000007F:"" \
GPRINT:cdefi:LAST:"Current\:%8.0lf" \
GPRINT:cdefi:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefi:MAX:"Maximum\:%8.0lf\n"
I saw someone else ask a very similar question for the area command..
I came up with one potential way of doing it, but it was terribly convoluted and involved polling a script that would just print the input, placing that in an .rrd and then pulling it in as a data source, and... ew.
So, in summary, my question is; would it be possible to get support for static valued LINE/AREAs into cacti sometime in the future?
-- Cheers, Doc P