Comment 3 for bug 406171

Revision history for this message
Thomas Guyot-Sionnest (dermoth) wrote : Re: COUNTER64 broken in NetSNMP::agent

I didn't have any when I initially wrote this but I was writing an embedded agent for testing special behaviours in Nagios-plugins's check_snmp.

The easiest way to test is to take the latest nagios-plugins snapshot from http://repo.or.cz/w/nagiosplugins.git (there is a snapshot download link next to each shortlog entries), extract it, and from the "plugins" directory:
1. Run:
  perl tests/check_snmp.t -d &
it will output:
  Please contact SNMP at: NNNNN
This is the port to use in the next command

2. Run: (replace NNNNN with the port returned by he 1st command)
  snmpget -v2c -cpublic localhost:NNNNN .1.3.6.1.4.1.8072.3.2.67.4

On the first poll it should return "Counter64: 18446744073709351616"

If you have Math::Int64 you can enable it in tests/check_snmp_agent.pl (uncomment the use line and comment out the dummy sub under it and restart check_snmp.t) and each subsequent poll on this OID should return the last polled value +100000 until the counter roll over and restart from 0 (there is a similar behaviour with Counter32 on the .3 oid).

If you don't have the module the value will be interpreted as a regular number after the first poll and since Perl do not support "long long" internally the results are unpredictable (they are predictable on the first run as the data is still a string).