Pass persist
From Net-SNMP Wiki
Revision as of 09:19, 2 September 2011 by Abayley (Talk | contribs) (Created page with "The pass_persist option is very useful if you need to implement some specific OID subtree, but it has a few traps and features which are poorly communicated, or not even mentione...")
The pass_persist option is very useful if you need to implement some specific OID subtree, but it has a few traps and features which are poorly communicated, or not even mentioned in the snmpd.conf man page.
- the shutdown protocol: when the snmpd server wants to shutdown, it tells your script by sending a blank line on stdin.
- snmpd sends a PING at the start of every request (I read the docs to mean that it is sent once, on script startup).
- the list of types you can return is quite limited. It is actually described in the docs for pass, which says that the type must be "one of the text strings: integer, gauge, counter, timeticks, ipaddress, objectid, or string"
- because you cannot return DateAndTime (RFC 2579), for datetime values I've resorted to returning two values (two separate OIDs):
- seconds-since-epoch
- datetime formatted as ISO-8601 string
Other things I've learned:
- your MIB must be valid, otherwise snmpget won't even query the daemon.
- you will probably need to add a line to the security section of snmpd.conf, to allow access to the OID subtree.