I’ve been setting up OpenNMS at work, and ran across a problem suitably annoying and obscure that the solution should be recorded for posterity.
The issue was with network interface thresholds, specifically the ones that measure percentage of the total bandwidth used on a monitored network interface. The threshold definition is like this:
ifInOctets * 8 / 100000 / ifHighSpeed * 100
ifInOctets is the measured amount of traffic on the interface, and ifHighSpeed is the speed of the interface. This threshold was firing all the time, and for no particularly good reason that I could see.
After a lot of digging and pondering, especially since I’m using the unstable OpenNMS 1.7.x branch which is not well documented yet, I started investigating what those two variables in the threshold were set to. ifInOctets was fine, but many Google searches turned up that on Ubuntu (and possibly other Linux variants) the Net-SNMP daemon is frequently unable to properly determine the speed of network interfaces, so it defaults ifHighSpeed to 10Mbps. This is not good when you have a 1000Mbps interface and regularly push 50-100Mbps - the calculation will report 500-1000% of a 10Mbps interface in use, which obviously exceeds thresholds of 90%.
The solution is to force Net-SNMP’s interface settings in /etc/snmp/snmpd.conf using something similar to the following line.
interface eth0 6 1000000000
This tells snmpd that eth0 is an Ethernet interface (6), and that it’s speed is 1000Mbps, overriding the incorrect default.
(updated 2011/09/15 with correct speed value for the interface line - sigh, should’ve caught that one long ago)