|
|
| Author |
Message |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Tue Jan 31, 2006 6:43 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Tue Jan 31, 2006 7:05 am Post subject: |
|
|
| 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...)
|
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Tue Jan 31, 2006 7:27 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Tue Jan 31, 2006 10:56 am Post subject: |
|
|
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:
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?)
| Description: |
|
| Filesize: |
83.24 KB |
| Viewed: |
13046 Time(s) |

|
| Description: |
| Template for 8 Processor Utilization.. Messy... |
|
 Download |
| Filename: |
cacti_graph_template_multi_cpu_utilization_on_8_processor_box.xml |
| Filesize: |
35.23 KB |
| Downloaded: |
1483 Time(s) |
|
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Tue Jan 31, 2006 11:04 am Post subject: |
|
|
Now to work out how to decrease the time span (i.e. to one minute intervals for some machines).
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12604 Location: Muenster, Germany
|
Posted: Wed Feb 01, 2006 3:05 pm Post subject: |
|
|
| argon0 wrote: | | Code: | 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
|
|
| Back to top |
|
 |
joshm Cacti User
Joined: 03 Oct 2005 Posts: 62 Location: STL
|
Posted: Wed Feb 01, 2006 3:54 pm Post subject: |
|
|
| 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??
| Description: |
|
| Filesize: |
19.99 KB |
| Viewed: |
13014 Time(s) |

|
|
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Thu Feb 02, 2006 5:20 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Thu Feb 02, 2006 6:38 am Post subject: |
|
|
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:
| Description: |
| 4 CPU + Average Utilisation on ONE graph |
|
 Download |
| Filename: |
cacti_graph_template_multi_cpu_utilization_on_4_processor_box.xml |
| Filesize: |
23.52 KB |
| Downloaded: |
2224 Time(s) |
| Description: |
| 2 CPU + Average utilisation on ONE graph |
|
 Download |
| Filename: |
cacti_graph_template_multi_cpu_utilization_on_2_processor_box.xml |
| Filesize: |
13.18 KB |
| Downloaded: |
2680 Time(s) |
Last edited by argon0 on Thu Feb 02, 2006 6:43 am; edited 1 time in total |
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Thu Feb 02, 2006 6:40 am Post subject: |
|
|
| See edit of above.
|
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Thu Feb 02, 2006 7:22 am Post subject: |
|
|
Yah - the above instructions DO work - here's the graph I made of a new host following them:
| Description: |
|
| Filesize: |
26.28 KB |
| Viewed: |
13001 Time(s) |

|
|
|
| Back to top |
|
 |
joshm Cacti User
Joined: 03 Oct 2005 Posts: 62 Location: STL
|
Posted: Thu Feb 02, 2006 11:06 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Thu Feb 02, 2006 11:24 am Post subject: |
|
|
Can you go into the Grpah management and turn Graph debugging on?
Post what you see here.
|
|
| Back to top |
|
 |
joshm Cacti User
Joined: 03 Oct 2005 Posts: 62 Location: STL
|
Posted: Thu Feb 02, 2006 11:28 am Post subject: |
|
|
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 %%'
|
|
| Back to top |
|
 |
argon0 Cacti User
Joined: 12 Mar 2004 Posts: 238
|
Posted: Thu Feb 02, 2006 11:47 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
|