Plotting multiple CPU cores on a single graph

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
docpify
Posts: 1
Joined: Fri Aug 17, 2012 4:43 pm

Plotting multiple CPU cores on a single graph

Post by docpify »

Hello,

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:
test.png
test.png (17.41 KiB) Viewed 499 times
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"
Now, the trick here is the LINE1:100 .. LINE1:200 .. LINE1:300 - but as far as I could see, cacti does not allow me to set a static value for a line/area in a graph template.
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
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Plotting multiple CPU cores on a single graph

Post by gandalf »

I though that using "SHIFT" would be the way to go.
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests