Multi CPU Utilization Graph

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

OK, got around THAT by understanding CDEF's better.

i.e. DON'T USE THE ALL_DATA_SOURCES_NO_DUPS special function, just create a cdef to add the data sources up manually, then divide by 2 (or whatever number you wish).

My CDEF for the two cpu graph now looks like this:

cdefa=a,b+,2,/

WooHoo.... Now all I need to do to is to work out how to create a single data query to get all the CPU utilization data I need, generically.

At the moment, I'm having CACTI graph all CPUS then using the data sources from these Graphs to create the Combined graph.

Anybody?

Argon0
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

OK, now I see a way to do it - combining Doraken's Data input, query and the data sources.... Along with my calculation of the CPU average... (cdefa=a,b,c,d+,4,/ --- it shouldn't mind dividing 0 by somehtin, but the ALL_DATA_SOURCES_NODUPS does mind if it is 0...)
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Ah.. wondered why this was coming back with nowt but 1 on the total cpu...

I don't have the w32_query_cpu.pl script, can you include please?

TVM

Argon0
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

OK... I have a "nice" graph now, and an idea how to do it for any number of processors...

Of course this first one is a bit messy - its for an 8 processor box, but can easily be cut down to give a more usable one for any other number of processors. (I believe) It requires the creation of the individual CPU graphs, and takes the data from their data sources.

Here's the piccie:Image

The Template for the graph is here too... It should have exported the CDEF for calculating the average, and uses the inbuild Host-MIB functions to get the data. Hope others find this useful as well..

You will also need to choose the data sources when you first use the graph, a different instance of "|hostname| - CPU Utilization (cpu)" for each CPU that you are mapping (note they will ALL have the same name - just a different location in the list - maybe this should be looked at?)
Attachments
Piccie of 8 CPU graph
Piccie of 8 CPU graph
graph_image_multi_cpu_8.png (83.24 KiB) Viewed 35434 times
cacti_graph_template_multi_cpu_utilization_on_8_processor_box.xml
Template for 8 Processor Utilization.. Messy...
(35.23 KiB) Downloaded 4497 times
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Now to work out how to decrease the time span (i.e. to one minute intervals for some machines). :D
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

argon0 wrote:

Code: Select all

RRDTool Command:
...
DEF:a="/var/www/html/rra/ukhalweb2_cpu_231.rrd":cpu:AVERAGE \
...
AREA:cdefa#FAFD9E:"Mean CPU"  \
...
I suppose the first item shall be the "sum of both cpu's devided by 2". But I bet you accidentally not only defined the CDEF for the first graph item but also defined the Data Source. This would not be correct! For the "mean" item, you must leave the data source to NONE and ONLY define the CDEF! This CDEF will reference the needed data sources! Please post a screenshot of the edit screen for the first Graph Item to make this sure.
Reinhard
joshm
Cacti User
Posts: 82
Joined: Mon Oct 03, 2005 1:34 pm
Location: STL

Post by joshm »

argon0 wrote: You will also need to choose the data sources when you first use the graph, a different instance of "|hostname| - CPU Utilization (cpu)" for each CPU that you are mapping (note they will ALL have the same name - just a different location in the list - maybe this should be looked at?)

WHen I create the graph I get prompted with this... What numbers/information needs to be entered here??
Attachments
settings.JPG
settings.JPG (19.99 KiB) Viewed 35402 times
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Reinhard - thanks - yes I realised that shortly afterwards and now define & use a cdef which is a,b,+,c,...,/,n where n is the number of instances - seems to work fine.

Joshm... Have you created the individual cpu graphs for the host?

If so you can probably skip this screen (i.e. enter nothing)... Then when the you go to "edit" the graph you can provide the individual data sources...

BTW this will ONLY work on an 8 CPU box, I have templates for 4 and 2 CPU boxes two.. Will post them shortly.

Argon0
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Right to get these to work you need to do the following.

1st: Graph your CPUs separately - this new graph combines the data sources for the individual graphs into one new graph.

2nd: Add the graph using the new template

3rd: don't enter anything when requested for: Index Type, INdex Valud or Output type ID

4th: You need to edit the graph now, goto graph management and click on the graph. Now you need to define the data sources for the graph.


Edited Here: ==>
Under: Supplemental Graph Template Data You will be asked for Data sources for each "line" (e.g. Data Source [cpu0]). Choose here "|hostname| - CPU Utilization - CPUn(cpu)" for each instance (choosing the correct instance in the graph). Where |hostname| is replaced with the name of your host and n = the CPU number (froom 0 to 7)
<=== Edit Finished

I am checking that this works with a new host at the moment, and may post an edit to this shortly...

However here are the two other MultiCPU templates:
Attachments
cacti_graph_template_multi_cpu_utilization_on_2_processor_box.xml
2 CPU + Average utilisation on ONE graph
(13.18 KiB) Downloaded 4962 times
cacti_graph_template_multi_cpu_utilization_on_4_processor_box.xml
4 CPU + Average Utilisation on ONE graph
(23.52 KiB) Downloaded 4664 times
Last edited by argon0 on Thu Feb 02, 2006 6:43 am, edited 1 time in total.
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

See edit of above.
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Yah - the above instructions DO work - here's the graph I made of a new host following them:
Attachments
graph_image_Multi_cpu_2.png
graph_image_Multi_cpu_2.png (26.28 KiB) Viewed 35392 times
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
joshm
Cacti User
Posts: 82
Joined: Mon Oct 03, 2005 1:34 pm
Location: STL

Post by joshm »

Well the 2 & 4 are working fine... But still having issues with the 8... The graph never displays anything at all and is just remaining a text only with no blank image or anything..

-Josh
Last edited by joshm on Thu Feb 02, 2006 11:30 am, edited 2 times in total.
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Can you go into the Grpah management and turn Graph debugging on?

Post what you see here.
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
joshm
Cacti User
Posts: 82
Joined: Mon Oct 03, 2005 1:34 pm
Location: STL

Post by joshm »

Will do, I actually just tried deleting and reimporting the 8 proc graph so will take a few to get it setup again...

Also something I just noticed. Only the 8proc graph prompts for those values that I posted above.. All the others created without asking any questions...

-Josh


This what u wanted

RRDTool Command:

n:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Multi CPU Utilization on AlphaSQL (SQL3)" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:10:c:/winnt/fonts/timesbd.ttf \
--font AXIS:9:c:/winnt/fonts/arial.ttf \
--font LEGEND:11:c:/winnt/fonts/arial.ttf \
--font UNIT:9:c:/winnt/fonts/arial.ttf \
DEF:a="N\:/cacti/rra/alphasql_sql3_cpu_705.rrd":cpu:AVERAGE \
DEF:b="N\:/cacti/rra/alphasql_sql3_cpu_706.rrd":cpu:AVERAGE \
DEF:c="N\:/cacti/rra/alphasql_sql3_cpu_707.rrd":cpu:AVERAGE \
DEF:d="N\:/cacti/rra/alphasql_sql3_cpu_708.rrd":cpu:AVERAGE \
DEF:e="N\:/cacti/rra/alphasql_sql3_cpu_709.rrd":cpu:AVERAGE \
DEF:f="N\:/cacti/rra/alphasql_sql3_cpu_710.rrd":cpu:AVERAGE \
DEF:g="N\:/cacti/rra/alphasql_sql3_cpu_711.rrd":cpu:AVERAGE \
DEF:h="N\:/cacti/rra/alphasql_sql3_cpu_712.rrd":cpu:AVERAGE \
CDEF:cdefa=a,b,+,c,+,d,+,e,+,f,+,g,+,h,+,5,/ \
CDEF:cdefb=a,b,+,c,+,d,+,4,/ \
AREA:cdefa#F9FD5F:"Mean CPU\:" \
GPRINT:cdefb:LAST:"Current\:%8.2lf %%" \
GPRINT:cdefb:MIN:"Min\:%8.2lf %%" \
GPRINT:cdefb:MAX:"Max\:%8.2lf %%\n" \
LINE1:a#0000FF:"CPU0\:" \
GPRINT::LAST:" Current\:%8.2lf %%" \
GPRINT::MIN:" Min\:%8.2lf %%" \
GPRINT::MAX:" Max\:%8.2lf %%\n" \
LINE1:b#00A348:"CPU1\:" \
GPRINT::LAST:" Current\:%8.2lf %%" \
GPRINT::MIN:" Min\:%8.2lf %%" \
GPRINT::MAX:" Max\:%8.2lf %%\n" \
LINE1:c#C4FD3D:"CPU2\:" \
GPRINT::AVERAGE:" Current\:%8.2lf %%" \
GPRINT::MIN:" Min\:%8.2lf %%" \
GPRINT::MAX:" Max\:%8.2lf %%\n" \
LINE1:d#FF0000:"CPU3\:" \
GPRINT::AVERAGE:" Current\:%8.2lf %%" \
GPRINT::MIN:" Min\:%8.2lf %%" \
GPRINT:d:MAX:" Max\:%8.2lf %%\n" \
LINE1:e#000000:"CPU4\:" \
GPRINT:e:LAST:" Current\:%8.2lf %%" \
GPRINT:e:MIN:"Min\:%8.2lf %%" \
GPRINT:e:MAX:"Max\:%8.2lf %%\n" \
LINE1:f#00BED9:"CPU5\:" \
GPRINT:f:LAST:" Current\:%8.2lf %%" \
GPRINT:f:MIN:"Min\:%8.2lf %%" \
GPRINT:f:MAX:"Max\:%8.2lf %%\n" \
LINE1:g#FF00FF:"CPU6\:" \
GPRINT:g:LAST:" Current\:%8.2lf %%" \
GPRINT:g:MIN:"Min\:%8.2lf %%" \
GPRINT:g:MAX:"Max\:%8.2lf %%\n" \
LINE1:h#AAABA1:"CPU7\:" \
GPRINT:h:LAST:" Current\:%8.2lf %%" \
GPRINT:h:AVERAGE:"Min\:%8.2lf %%" \
GPRINT:h:MAX:"Max\:%8.2lf %%"

RRDTool Says:

ERROR: Could not parse line 'GPRINT::LAST: Current\:%8.2lf %%'
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Weird... Its got 2 CDEF's defined, only one used (the extra one is cdefb which divides by 4) AND it has an issue with the first line...

"ERROR: Could not parse line 'GPRINT::LAST: Current\:%8.2lf %%'"

There should be something between the ::....

I'll check the template & the exported one and see ifthere's a problem there.,..

back soon

Argon0
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests