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

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

Moderators: Developers, Moderators

maxstoner
Posts: 16
Joined: Fri Dec 30, 2005 9:27 am

Description Bug

Post by maxstoner »

Hi,
I think I found out why the CPU description is not working any more:

Code: Select all

change line 277 from: 
$oid[1][1] . $cmdoutput[$cmdoutputcount][1],
to:
$oid[1][1] . "." . $cmdoutput[$cmdoutputcount][1],
Then for me Interface Description works fine again.
smilerza
Posts: 21
Joined: Thu Jul 07, 2005 9:47 am

Post by smilerza »

I've just recently upgraded to 8.0.7d and now get the following error:

Notice: Undefined offset: 0 in /srv/www/htdocs/cacti/scripts/cisco_cpu_util.php on line 174

Prior to the upgrade I was running 8.0.7b and all was working.
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

smilerza wrote:I've just recently upgraded to 8.0.7d and now get the following error:

Notice: Undefined offset: 0 in /srv/www/htdocs/cacti/scripts/cisco_cpu_util.php on line 174

Prior to the upgrade I was running 8.0.7b and all was working.
I just tried 0.8.7d and while my scripts all seem to get called and work the RRD files all store NaN values. It works fine with 0.8.7c though.
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

New versions of the plugins were just uploaded. Also note the new instructions in the original message.
smilerza
Posts: 21
Joined: Thu Jul 07, 2005 9:47 am

Post by smilerza »

Thanks for the updated scripts... I'm in the process of testing to see if the problem is resolved however I did come across an issue.

I'm getting an error with the CPU description and had to modify the file as per an earlier post

Change the following:

$oid[1][1] . $cmdoutput[$cmdoutputcount][1],
to:
$oid[1][1] . "." . $cmdoutput[$cmdoutputcount][1],

I should know in the next day or so if the problems have been resolved.

Thanks again for a great script!!
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

Thanks for the reminder. I fixed the code and uploaded a new script.
istein001
Cacti User
Posts: 54
Joined: Fri Feb 22, 2008 4:44 pm
Location: Houston

Post by istein001 »

Does this script get around the problems I experienced previously with reboots... it looks like the cisco 6500 routers would move the indexes around as to which cpu was for which card etc. My graphs for card "3" would be for card "5" after an IOS upgrade.

Still trying to work around this with some kind of poll of serial #'s for cards or card types in the module slots.
isse
Posts: 16
Joined: Tue Nov 25, 2008 5:50 am

Post by isse »

Anyone succesfully added this on cacti running on windows ?
I put the script in the right location, imported the template and everything seemed fine.

I could then add the template to a device and retrive the cpu to graph but then when cacti gets the value (using spine) i get this error:

unable to find/open c:inetpubwwwrootcactiscriptsblablabla.php
somewhere it seems to loose the / between the folders but i cant find anywhere to edit this....

Thanks.
/N
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Word of the wise to all who use this Cisco CPU script -- it's very inefficient! I had it running against 25 routers using the cmd.php poller.
My poller stats at that time:
SYSTEM STATS: Time:107.0256 Method:cmd.php Processes:8 Threads:N/A Hosts:16 HostsPerProcess:2 DataSources:815 RRDsProcessed:418

I removed the cisco cpu script/template and the data sources. Imported a script server cisco cpu script/template, re-created all the cpus for all the devices, PLUS I added a bunch of other snmp only queries for various routers. My system stats now:
SYSTEM STATS: Time:17.6975 Method:cmd.php Processes:8 Threads:N/A Hosts:16 HostsPerProcess:2 DataSources:1164 RRDsProcessed:601

That's a 600% speed improvement! Just imagine if I was polling dozens of devices, how big the performance impact would be. This cacti server isn't any wimp either: Dell 8-way 3.16Ghz Xeon, 16GB mem, etc.
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

I uploaded a new version of the cisco CPU kit which addresses two small bugs in the script.
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

I posted a new version of the CPU script with many significant enhancements. The biggest change is a switch from the expensive and slow script query interface to the persistent and fast script server interface. I also dropped the comma-separated parameters and switched to a colon-separated "bundle" for SNMP arguments, tightened up the array and variable management, added a lot more error checking, and otherwise did a complete rewrite of the script.

Due to the changes, the script and resource xml files need to be reinstalled and any data queries need to be reimported. However the existing graphs and data sources should continue to operate afterwards.

I've also moved the files to this page on my web server so that I can more easily maintain them. The memory files are located at this page.
User avatar
nebj00la
Cacti User
Posts: 112
Joined: Fri Feb 17, 2006 9:02 pm
Location: Massachusetts, USA
Contact:

Post by nebj00la »

ehall wrote: I've also moved the files to this page on my web server so that I can more easily maintain them. The memory files are located at this page.
Eric,

The link to download the memory template is broken.
Thanks,
nebj00la
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Post by ehall »

I just fixed it thanks for the note
User avatar
nebj00la
Cacti User
Posts: 112
Joined: Fri Feb 17, 2006 9:02 pm
Location: Massachusetts, USA
Contact:

Post by nebj00la »

ehall wrote:I just fixed it thanks for the note
No problem! I'm going to give the template a try shortly.
Thanks,
nebj00la
3BEPb
Posts: 1
Joined: Mon Jul 27, 2009 1:03 am

Re: Cisco cpus and memory pools -- update April 26 2009

Post by 3BEPb »

CPU query fall in cisco ASR1004 and 12406 on cpu index>1

Code: Select all

php ss_cisco_cpu_usage.php asr1004:2:*****:::::::: query cpudesc
2:cpu 0/0

Notice: Undefined index:  desc in /usr/share/cacti/site/scripts.old/ss_cisco_cpu_usage.php on line 675
3:

php ss_cisco_cpu_usage.php c12406:2:*****:::::::: query cpudesc
1:0/5/CPU0

Notice: Undefined index:  desc in /usr/share/cacti/site/scripts.old/ss_cisco_cpu_usage.php on line 675
17:

Notice: Undefined index:  desc in /usr/share/cacti/site/scripts.old/ss_cisco_cpu_usage.php on line 675
33:

Notice: Undefined index:  desc in /usr/share/cacti/site/scripts.old/ss_cisco_cpu_usage.php on line 675
65:

Notice: Undefined index:  desc in /usr/share/cacti/site/scripts.old/ss_cisco_cpu_usage.php on line 675
81:

Code: Select all

--- scripts.old/ss_cisco_cpu_usage.php	2009-06-27 21:13:41.000000000 +0400
+++ scripts/ss_cisco_cpu_usage.php	2009-07-27 10:16:25.352481017 +0400
@@ -627,11 +627,11 @@
 
 					break;
 
-				#
-				# increment the cpu counter
-				#
-				$cpu_count++;
 			}
+			#
+			# increment the cpu counter
+			#
+			$cpu_count++;
 		}
 	}
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests