Fixed
Details
Assignee
Alejandro GalueAlejandro GalueReporter
Alejandro GalueAlejandro GalueLabels
Components
Fix versions
Affects versions
Priority
Blocker
Details
Details
Assignee
Alejandro Galue
Alejandro GalueReporter
Alejandro Galue
Alejandro GalueLabels
Components
Fix versions
Affects versions
Priority
PagerDuty
PagerDuty
PagerDuty
Created August 13, 2015 at 11:42 AM
Updated August 14, 2015 at 1:32 PM
Resolved August 13, 2015 at 12:09 PM
Here is how to reproduce the problem.
On my CentOS 6.7 VM running Meridian 2015.1.0, I configured the local snmpd.conf with this:
/etc/snmp/snmpd.conf
The script that simulates the counter is very simple:
/etc/snmp/counter.pl
If you execute the script it will always return an increasing number:
In OpenNMS, I have a file called /opt/opennms/etc/datacollection/sample.xml with the following content:
/opt/opennms/etc/datacollection/sample.xml
Of course, I've added a reference to it on datacollection-config.xml:
Now, let's try the OID using snmp-request (I use snmp-request, a clone of Net-SNMP's tools based on SNMP4J, because the snmpwalk command is not as good as SNMP4J in terms of the SNMP Protocol implementation):
The last entry is what we have on the datacollection-group.
Now, let's see how Collectd is handling that data:
As you can see, the values are stored like float numbers (i.e. numbers with decimals), which is a non valid operation for counters on RRDtool.
Of course, the values are not being stored on the RRDtool file:
Seeing the source code, I found the following:
org.opennms.netmgt.collectd.SnmpAttribute
The key element here is how isNumeric is implemented:
org.opennms.netmgt.snmp.snmp4j.Snmp4JValue
Because the extent feature of Net-SNMP returns the value as string, isNumeric will return false, so it will converted into a double, which is not correct for these case.