Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Cisco published a great article on this, SNMP Counters: Frequently Asked Questions.  The , RFC 2233 summarises this wellbest:

"As the speed of network media increase, the minimum time in which
a 32 bit counter will wrap decreases.  For example, a 10Mbs stream
of back-to-back, full-size packets causes ifInOctets to wrap in
just over 57 minutes; at 100Mbs, the minimum wrap time is 5.7
minutes, and at 1Gbs, the minimum is 34 seconds.  Requiring that
interfaces be polled frequently enough not to miss a counter wrap
is increasingly problematic."

The Problem

Despite this interesting bit of history, some Network Vendors, only support SNMPv1, which isn't a problem, unless you have high speed interfaces, for example 1 gigabit per second, which these vendors to have, funnily enough these same vendors companies have only existed for 10-15 years, so are younger than the standards they should be implementing, yet they implement something which is completely outdated.

So we have NMIS which is Open Source and by the nature of Open Source and of software using IETF protocols and specifications, NMIS is standards based.

Make NMIS work with SNMPv1 using 64 bit counters

NMIS itself is not strongly typed, the issue here is with the SNMP libraries NMIS uses.

How will I know I need to change NMIS?

...

If you see this you have devices cheating and using an unsupported a non standard combination.

What to change

To make NMIS work with non standard combination, you need to modify the SNMP library source code to prevent it from detecting the issue.  NMIS uses the Net::SNMP library and only one file in this library needs to be changed.
Locate Message.pm
 The file in question is Message.pm, or in Perl terms the class file Net::SNMP::Message, this is the object which manages the SNMP messages.
First locate Message.pm on your system, it will normally be in the perl directories in /usr/local or possibly in /usr
Run the Unix find command to do the work for you.

 

Code Block
find /usr/local/ -name Message.pm 

The result would be something like this:

Code Block
[root@nmis models]# 

 

Code Block
find /usr/local/ -name Message.pm 

 

Edit Message.pm

/usr/local/share/perl5/Net/LDAP/Message.pm
/usr/local/share/perl5/Net/SNMP/Message.pm
/usr/local/share/perl5/Mojo/Message.pm
/usr/local/share/perl5/HTTP/Message.pm

We are after the one for the class Net::SNMP::Message so the file we want (translating :: to /) is /usr/local/share/perl5/Net/SNMP/Message.pm, first thing, make a backup.

Edit the source code /usr/local/share/perl5/Net/SNMP/Message.pm and find "sub _process_counter64" in version 3.0.1 it is on line 1650 of the code.  You want to comment out the if statement which generates the error and returns, so just comment out the code with # as below, lines 1655 to 1657 have been commented out.
Code Block
   1650 

 

Code Block
sub _process_counter64
   1651 {
   1652    my ($this, $type) = @_;
   1653 
   1654    # Verify the SNMP version
   1655    #if ($this->{_version} == SNMP_VERSION_1) {
   1656    #   return $this->_error('The Counter64 type is not supported in SNMPv1');
   1657    #}
   #1658 Decode
 the length
 1659  return $this->_error() if !defined(my $length = $this->_process_length()); # Decode the length

That's it, run your NMIS update on the node in question, this will verify the code compiles and that NMIS works and should solve your problem, if  you get crazy Perl errors, restore your backup and try the edit again.