Linux Cacti -> SNMP Informant CPU Problems

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

Moderators: Developers, Moderators

Post Reply
ceyounger
Posts: 44
Joined: Fri Feb 10, 2006 2:59 pm
Location: Orange County, CA
Contact:

Linux Cacti -> SNMP Informant CPU Problems

Post by ceyounger »

Ever since upgrading to 0.8.6i I've had serious problems trying to poll CPU stats from Windows 2000 and 2003 servers.

I've tried manipulating the XML to no avail.

Has anyone found a solution to this?

Code: Select all

+ Running data query [17].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/snmp_informant_cpu.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9600.1.1.5.1.1'
+ Located input field 'cpuinformInstance' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9600.1.1.5.1.1.1'
+ Found item [cpuinformInstance='End of MIB'] index: End of MIB [from value]
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/snmp_informant_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/snmp_informant_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/snmp_informant_cpu.xml'
Yet when I snmpwalk on the commandline I get instances:

Code: Select all

snmpwalk -v 2c -c public 192.168.185.76 .1.3.6.1.4.1.9600.1.1.5.1.1.1
SNMPv2-SMI::enterprises.9600.1.1.5.1.1.1.48 = STRING: "0"
SNMPv2-SMI::enterprises.9600.1.1.5.1.1.1.49 = STRING: "1"
SNMPv2-SMI::enterprises.9600.1.1.5.1.1.1.50 = STRING: "2"
SNMPv2-SMI::enterprises.9600.1.1.5.1.1.1.51 = STRING: "3"
I'm dying here, I have 200 servers and slowly they are all starting to lose CPU stats.

Thanks
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Post by goldburtd »

I'm using 0.8.6h

Same issue...I've tried using oid_index_parse

Code: Select all

<oid_index_parse>OID/REGEXP:^.*{27)(.*)$</oid_index_parse>
But I still get 'End of MIB'. Stranger still, I used Ethereal on the host running SNMP Informant, and the responses all have an "Error: No Such Name". However, when I execute

Code: Select all

snmpbulkwalk -v2c -c CommunityString Ip-Address 1.3.6.1.4.1.9600.1.1.5.1.1
everything returns fine! I really don't know where to look with this one...
Last edited by goldburtd on Fri Dec 15, 2006 11:01 am, edited 1 time in total.
ceyounger
Posts: 44
Joined: Fri Feb 10, 2006 2:59 pm
Location: Orange County, CA
Contact:

Post by ceyounger »

We seem to be a in black hole on this, my friend.

No one else seems to have this problem or its solution.

I've resorted to using the Nagios Agent so I can WMI call CPU stats, but it's tedious to config.

My kingdom for a resolution to this!
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Post by goldburtd »

Ok, update...

Cacti calls snmpbulkwalk with a maxrepetition value of 50

Code: Select all

snmpbulkwalk -C r50 -v2c -c CommunityString Ip-Address 1.3.6.1.4.1.9600.1.1.5.1.1
However, there are only 46 OID's in the CPU MIB tree. If you try the above from the command line, you will get only get 'End of MIB' returned.

The question is, is this a bug with SNMP Informant? Or will Cacti bomb on any tree that is smaller than 50 Mibs?

Any ideas? Does anyone understand what the -C argument does? Why is it hardcoded to 50 in Cacti (snmp.php)?
goldburtd
Posts: 21
Joined: Mon Aug 14, 2006 11:40 am

Post by goldburtd »

Ok I fixed it on my system...

First thing is that we have to replace the r50 argument to bulkwalk. This is done in /var/www/html/cacti/lib/snmp.php. I replaced it with r10. I don't think there are any adverse effects, even if you replace it with r1 - bulkwalk seems to still return all the indexes.

Then, you have to change the win32_cpu.xml file. The important parts are changing the OID to leave out some extra .1, and also to parse the index to throw out the first 28 characters. Mine now reads:

Code: Select all

<interface>
<name>Win32 - Informant - CPU Stats</name>
<description>Using SNMP-Informant Queries a host for a list of CPU(s) and their stats</description>
<oid_index>.1.3.6.1.4.1.9600.1.1.5.1.1</oid_index>
<oid_index_parse>OID/REGEXP:^.{28}(.*)$</oid_index_parse>
<index_order>cpuinformInstance</index_order>
<index_order_type>alphabetic</index_order_type>
<fields>
<cpuinformInstance>
<name>CPU Instance</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.1</oid>
</cpuinformInstance>
<cpuinformPercentProcessorTime>
<name>Processor Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.5</oid>
</cpuinformPercentProcessorTime>
<cpuinformPercentUserTime>
<name>User Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.6</oid>
</cpuinformPercentUserTime>
<cpuinformPercentPrivilegedTime>
<name>Privleged Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.4</oid>
</cpuinformPercentPrivilegedTime>
</fields>
</interface>
it should now work!
ceyounger
Posts: 44
Joined: Fri Feb 10, 2006 2:59 pm
Location: Orange County, CA
Contact:

Post by ceyounger »

Woohoo!

Excellent work! All good now.

You have made the start of this year much better for me!

Thanks again!
ceyounger
Posts: 44
Joined: Fri Feb 10, 2006 2:59 pm
Location: Orange County, CA
Contact:

Post by ceyounger »

Just an update...this is apparently still needed for 0.8.7a... I dunno why, but it sure doesn't work without changing r50 to r10...
goldburtd wrote:Ok I fixed it on my system...

First thing is that we have to replace the r50 argument to bulkwalk. This is done in /var/www/html/cacti/lib/snmp.php. I replaced it with r10. I don't think there are any adverse effects, even if you replace it with r1 - bulkwalk seems to still return all the indexes.

Then, you have to change the win32_cpu.xml file. The important parts are changing the OID to leave out some extra .1, and also to parse the index to throw out the first 28 characters. Mine now reads:

Code: Select all

<interface>
<name>Win32 - Informant - CPU Stats</name>
<description>Using SNMP-Informant Queries a host for a list of CPU(s) and their stats</description>
<oid_index>.1.3.6.1.4.1.9600.1.1.5.1.1</oid_index>
<oid_index_parse>OID/REGEXP:^.{28}(.*)$</oid_index_parse>
<index_order>cpuinformInstance</index_order>
<index_order_type>alphabetic</index_order_type>
<fields>
<cpuinformInstance>
<name>CPU Instance</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.1</oid>
</cpuinformInstance>
<cpuinformPercentProcessorTime>
<name>Processor Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.5</oid>
</cpuinformPercentProcessorTime>
<cpuinformPercentUserTime>
<name>User Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.6</oid>
</cpuinformPercentUserTime>
<cpuinformPercentPrivilegedTime>
<name>Privleged Time</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.9600.1.1.5.1.4</oid>
</cpuinformPercentPrivilegedTime>
</fields>
</interface>
it should now work!
User avatar
Khan
Posts: 48
Joined: Mon Nov 03, 2003 11:08 am
Location: Madtown, WI

Post by Khan »

ceyounger wrote:Just an update...this is apparently still needed for 0.8.7a... I dunno why, but it sure doesn't work without changing r50 to r10...
The same is true for 0.8.7b. And the XML above works perfectly. Thanks for the fix, goldburtd!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests