Cisco cpus and memory pools -- update November 11, 2010

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

Moderators: Moderators, Developers

Author
Message
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#16 Post by ehall » Thu Jan 12, 2006 11:40 am

Try this, same drill as last time, refresh data query and post output from verbose please
Last edited by ehall on Wed Feb 01, 2006 4:40 pm, edited 1 time in total.

knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

#17 Post by knobdy » Thu Jan 12, 2006 11:57 am

ehall wrote:Try this, same drill as last time, refresh data query and post output from verbose please
Looking good so far - will let you know about the graphs in five minutes:
+ Running data query [14].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/cisco_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php5 -q /usr/share/cacti/scripts/cisco_cpu_usage.php _2r1..com, 02r, 1, , , 161, 500 index'
+ Executing script query '/usr/bin/php5 -q /usr/share/cacti/scripts/cisco_cpu_usage.php _2r1..com, 02r, 1, , , 161, 500 query cpuIndex'
+ Found item [cpuIndex='1'] index: 1
+ Found item [cpuIndex='3'] index: 3
+ Executing script query '/usr/bin/php5 -q /usr/share/cacti/scripts/cisco_cpu_usage.php _2r1..com, 02r, 1, , , 161, 500 query cpuName'
+ Found item [cpuName='CPU1'] index: 1
+ Found item [cpuName='CPU3'] index: 3
+ Executing script query '/usr/bin/php5 -q /usr/share/cacti/scripts/cisco_cpu_usage.php _2r1..com, 02r, 1, , , 161, 500 query cpuDesc'
+ Found item [cpuDesc='onboard CPU'] index: 1
+ Found item [cpuDesc='onboard CPU'] index: 3
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/cisco_cpu.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/cisco_cpu.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/cisco_cpu.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/cisco_cpu.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_queries/cisco_cpu.xml'

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#18 Post by ehall » Thu Jan 12, 2006 12:05 pm

remember you may need to use the older OIDs with that router too. You can test this with the following:

Code: Select all

/usr/bin/php5 -q /usr/share/cacti/scripts/cisco_cpu_usage.php _2r1..com, 02r, 1, , , 161, 500 query oneMin

/usr/bin/php5 -q /usr/share/cacti/scripts/cisco_cpu_usage.php _2r1..com, 02r, 1, , , 161, 500 query fiveMin
Results like "1:nn" (where nn is the 1min cpu load) means it worked, while something other than nn means it didn't

I should probably put a test into the code for that actually

knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

#19 Post by knobdy » Thu Jan 12, 2006 12:19 pm

ehall wrote:I should probably put a test into the code for that actually
That seemed to work - AFTER I changed the OIDs...not sure why I forgot that!

Code: Select all

php5 -q /usr/share/cacti/scripts/cisco_cpu_usage.php _2r1.com, 02r, 1, , , 161, 500 query oneMin
1:6
3:1

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#20 Post by ehall » Thu Jan 12, 2006 12:26 pm

What is the result when the newer OIDs are used? (I need to know what the error looks like to trap it).

knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

#21 Post by knobdy » Thu Jan 12, 2006 1:19 pm

ehall wrote:What is the result when the newer OIDs are used? (I need to know what the error looks like to trap it).
well... can I change them back, to run this test from the CLI, without recreating all of my graphs and data sources (which are all now working for all devices)?

Also, I was going to ask if there's a way to configure the graph template to show 100% rather than just the max?

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#22 Post by ehall » Thu Jan 12, 2006 1:33 pm

You can just copy the script to a temp name and run that copy and you won't have to worry about it.

You can change the graph to always show 100% by open the graph template and disabling the auto-scale option. Note that the upper limit on the graph is set to 200% since it stacks the 1min and 5min avgs, which could both hit 100% (stacked together that would total 200%).

knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

#23 Post by knobdy » Thu Jan 12, 2006 1:56 pm

ehall wrote:You can just copy the script to a temp name and run that copy and you won't have to worry about it.
Doh! That should have been obvious... but this newest script, even with the newer OIDs gives me a response - and it looks like the correct one. If that's the case, I'm really confused as to why the graphs weren't working before changing the OID. Perhaps I should change them back?

Code: Select all

02n:/usr/share/cacti/scripts # php5 -q /usr/share/cacti/scripts/cisco_cpu_usage_test.php _2r16, 02r, 1, , , 161, 500 index
1
02n:/usr/share/cacti/scripts # php5 -q /usr/share/cacti/scripts/cisco_cpu_usage_test.php _2r16, 02r, 1, , , 161, 500 query cpuName
1:CPU1
02n:/usr/share/cacti/scripts # php5 -q /usr/share/cacti/scripts/cisco_cpu_usage_test.php _2r16, 02r, 1, , , 161, 500 query cpuIndex
1:1

You can change the graph to always show 100% by open the graph template and disabling the auto-scale option. Note that the upper limit on the graph is set to 200% since it stacks the 1min and 5min avgs, which could both hit 100% (stacked together that would total 200%).
well, that explains what I was just going to ask you about. Is there a different way to report it rather than stack them? As it is I have one CPU that appears to be running at 150%! :) Perhaps a block color for 1 minute and a line for 5?

I do appreciate your working on this - anything more I can do to help, just let me know.

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#24 Post by ehall » Thu Jan 12, 2006 2:27 pm

knobdy wrote:but this newest script, even with the newer OIDs gives me a response - and it looks like the correct one. If that's the case, I'm really confused as to why the graphs weren't working before changing the OID. Perhaps I should change them back?

Code: Select all

02n:/usr/share/cacti/scripts # php5 -q /usr/share/cacti/scripts/cisco_cpu_usage_test.php _2r16, 02r, 1, , , 161, 500 index
1

02n:/usr/share/cacti/scripts # php5 -q /usr/share/cacti/scripts/cisco_cpu_usage_test.php _2r16, 02r, 1, , , 161, 500 query cpuName
1:CPU1
That's only returning one CPU. Is it the same router?
Is there a different way to report it rather than stack them? As it is I have one CPU that appears to be running at 150%! :) Perhaps a block color for 1 minute and a line for 5?
You can make whatever changes to the graph template you like :)

knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

#25 Post by knobdy » Thu Jan 12, 2006 3:01 pm

ehall wrote:That's only returning one CPU. Is it the same router?
No, but it's the same for the other router - meaning, it works...?

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#26 Post by ehall » Thu Jan 12, 2006 3:11 pm

This version checks to see if the returned perf counter is defined and numeric, and switches to the old OID values if not.
Last edited by ehall on Wed Feb 01, 2006 4:40 pm, edited 1 time in total.

knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

#27 Post by knobdy » Thu Jan 12, 2006 3:15 pm

Might as well try the latest on the two I still don't have working. They are (C7200-JK8S-M), Version 12.2(15)T5 - and while it does display the graph without error, running it the script returns nothing.

UPDATE: This script appears to work for the other routers - I didn't have to edit it manually, obviously. Still didn't work on the two 7200s though. The 7200s also give "No more variables left in this MIB View (It is past the end of the MIB tree)" back for the memory walks.

ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

#28 Post by ehall » Thu Jan 12, 2006 3:38 pm

Do any of the working routers show a description other than "onboard CPU"?

knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

#29 Post by knobdy » Thu Jan 12, 2006 3:56 pm

ehall wrote:Do any of the working routers show a description other than "onboard CPU"?
No, all that work use that description - these two routers don't return anything...

knobdy
Cacti User
Posts: 495
Joined: Wed Sep 28, 2005 1:39 pm

#30 Post by knobdy » Thu Jan 12, 2006 3:57 pm

ehall wrote:You can make whatever changes to the graph template you like :)
Why wouldn't changing the average to a "max" work? In other words it would simply draw a line along the max of either 1min or 5min - depending on which is higher:

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="argus_kc2r3 - CPU Usage - |query_cpuName| (|query_cpuDesc|)" \
--rigid \
--base=1000 \
--height=120 \
--width=600 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Percent" \
--slope-mode \
DEF:a="/usr/share/cacti/rra/argus_kc2r3_fivemin_1568.rrd":oneMin:AVERAGE \
DEF:b="/usr/share/cacti/rra/argus_kc2r3_fivemin_1568.rrd":fiveMin:AVERAGE \
AREA:a#FFC73B:"1 Min Avg" \
GPRINT:a:LAST:"Current\:%8.2lf" \
GPRINT:a:AVERAGE:"Average\:%8.2lf" \
GPRINT:a:MAX:"Maximum\:%8.2lf\n" \
LINE1:b#FF0000:"5 Min Avg" \
GPRINT:b:LAST:"Current\:%8.2lf" \
GPRINT:b:AVERAGE:"Average\:%8.2lf" \
GPRINT:b:MAX:"Maximum\:%8.2lf\n" \
LINE2:#000000:""

RRDTool Says:

ERROR: Not a valid vname: #000000 in line LINE2:#000000:

Post Reply