Monitoring QNAP devices with OpenNMS

QNAP devices have snmp support out-of-the-box, unfortunately the agent they ship with is almost unusable. At first it seems it supports lots of cool features (like fans, temperature, smart, etc) but if you take a little time to dig deeper you will notice that almost all key entries are, what?!, octetStrings.
Capacity reported as a String, QNAP what were you thinking?

So good luck estimating disk usage when it is reported as a string: '1.8TB' (I quote exactly as it is shown by mibbrowser).

Without wasting any more of your (and mine) time let's fix that by installing the Optware QPKG and then installing net-snmp from the ipkg web console. The whole process is traightforward, just make sure to have a recent firmware:
  1. log in to the QNAP admin web interface
  2. open Applications servers and then select QPKG Center
  3. from the Available tab install Optware and the enable it from the Installed tab
  4. now access the Optware web interface and search for net-snmp, then click the install button on the net-snmp package
At this point net snmp is running, we only need to configure it and to do that we will ssh into the device.
Once logged in edit the configuration file /opt/etc/snmpd.conf and then have the snmpd daemon reload its configuration by issuing a SIGHUP:
killall -HUP snmpd

Key configuration directives to edit:
  • sysLocation and sysContact , ça va san dir
  • uncomment or delete all disk entries and add an includeAllDisks 5% directive instead
  • change communities as per your organization policies
After that rescan the node from the opennms web ui and enjoy the new graphs.