Simple Network Management Protocol (SNMP) is used in network management systems to monitor network-attached devices for conditions that warrant administrative attention.

Extending Net-SNMP Edit

You can add an OID to snmpd.conf like this:

extend-sh unixtime date "+%s"

You can get the output like this:

snmpget -v2c -cpublic localhost NET-SNMP-EXTEND-MIB::nsExtendOutput1Line.\"unixtime\"

There's a default timeout of 5 seconds:

snmpget -v2c -cpublic localhost NET-SNMP-EXTEND-MIB::nsExtendCacheTime.\"unixtime\"

This timeout seems to be changeable with a set command, but unfortunately that doesn't seem to survive a restart of snmpd.

See also Edit