Cacti/Snmp 64-Bit Counters for a Cisco Gigabit Switch

This is rather silly, but I lost some time with it, so I thought to put it in a blog post as it might be useful to others. Ok, a few days ago I took over an existing cacti installation; I was working to improve it and bring in some other stuff I always do in a cacti installation (note to self, I should really put some blog posts about cacti templates I use, as that will definitely save me some time in the future). One problem I noticed was that there was a traffic interface graph that was wrong when it was going over 114Mbps. I knew what the problem was and it should have been a quick fix.

All I had to do was to change from regular 32-bit counters to 64-bit counters and increase the maximum value to 1M. I have done that, but to my surprise the graph stopped working completely for the respective interface. So I had to dig into it, and debug the problem. I was able to see that the cacti poller snmp query was failing and returning:

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: IF-MIB::ifHCInOctets.10124

That was strange, as I knew for sure a similar cisco switch works just fine with 64-bit counters (btw this was a C2960G). Running the snmp query by hand, like:

snmpget -c <comunity> -v 2c <ip> .1.3.6.1.2.1.31.1.1.1.6.10124
IF-MIB::ifHCInOctets.10124 = Counter64: 1741880465459

was working just fine and returning the counter. Finally after wasting some time I realized what was the problem: the host device was configured in cacti to use SNMPv1, and I only had to change this to SNMPv2 to make it work as expected. Hopefully this will help others in similar situations…

Conclusion: if your 64-bit snmp counters are not working as expected, be sure to check if you are using SNMPv2 or not. That might be your problem, as SNMPv1 doesn’t support that.

comments powered by Disqus