So, back to poking at the NOCTool codebase again. This time, the intent is to get some SNMP support into it, to more easily be able to monitor routers and switches. There's also some opportunity to monitor server hosts via SNMP, but at the moment unix-based hosts can be adequately monitored via SSH.
First, I created a class for "things monitored by SNMP" (with curucial details like community strings and SNMP version in it, plus slots for anything we're monitoring via SNMP; this is currently just interfaces). Then, an SNMP configuration stanza for the config reader. Inside the SNMP stanza, configuration stanzas for anything monitored by SNMP (again, just interfaces at the moment).
The intent is to let an empty interface spec is to mean "auto-discover all interfaces, then monitor them" and for anyone wanting a subset, simply naming the interfaces.
The actual monitoring starts with an snmp-walk of the ifTable.ifEntry.ifDescr sub-tree, mapping names to current SNMP indexes, then passing the resulting hash table down to each "get stuff for this specific interface" function (taking the current SNMP session, mapping table and interface object as arguments).
So far, I am happy with what I have, but it's yet to be used in anger.