Issue gathering memory statistics for Linux hosts - Solution

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
espro
Posts: 12
Joined: Thu Jan 28, 2010 11:26 am

Issue gathering memory statistics for Linux hosts - Solution

Post by espro »

I have seen lots of references to problems gathering memory statistics but zero solutions. I thought I would post this in hopes of people finding it and solving their problem. If you are using ss_netsnmp_memory.php by Eric A. Hall, he multiplies the timeout param by 1000 to convert it to msec. In the Cacti libs, this value is again multiplied by 1000 before being passed to the desired PHP snmpX_get function, which causes it to fail if you have specified an already high timeout value for the device.

From the debug log:

Code: Select all

06/26/2012 12:35:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'x', and OID:'.1.3.6.1.4.1.2021.4.5.0'
06/26/2012 12:35:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'x', and OID:'.1.3.6.1.4.1.2021.4.6.0'
06/26/2012 12:35:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'x', and OID:'.1.3.6.1.4.1.2021.4.3.0'
06/26/2012 12:35:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'x', and OID:'.1.3.6.1.4.1.2021.4.4.0'
06/26/2012 12:35:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'x', and OID:'.1.3.6.1.4.1.2021.4.14.0'
06/26/2012 12:35:01 PM - CMDPHP: Poller[0] WARNING: SNMP Get Timeout for Host:'x', and OID:'.1.3.6.1.4.1.2021.4.15.0'
snmpget on those OIDs using the same information in Cacti for that device succeed.

In the ss_netsnmp_memory.php file I have:

Code: Select all

218   # Cacti's SNMP timeout uses milliseconds, while PHP uses Net-SNMP foormat, which is
219   # typically microseconds. Normalize by multiplying the timeout value by 1000.
220   #
221   $snmp_timeout = ($snmp_timeout * 1000);
Comment out that line

Code: Select all

218   # Cacti's SNMP timeout uses milliseconds, while PHP uses Net-SNMP foormat, which is
219   # typically microseconds. Normalize by multiplying the timeout value by 1000.
220   #
221   #$snmp_timeout = ($snmp_timeout * 1000);
And you will stop having problems.
sainz76
Posts: 2
Joined: Thu Dec 15, 2011 1:48 pm

Re: Issue gathering memory statistics for Linux hosts - Solu

Post by sainz76 »

If you ever come to Milan, you have a free pizza.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest