SNMP API

SNMP


MIB

Object Identifier (OID) - sysUpTime:

Commands

snmpserver

$ snmpget -v 2c -cpublic [IP_DO_AGENTE] sysUpTime.0
$ snmpget -v 2c -cpublic [IP_DO_AGENTE] 1.3.6.1.2.1.1.3.0
$ snmpget -v 1  -cpublic [IP_DO_AGENTE] sysUpTime.0
$ snmpwalk -v 2c -c public [IP_DO_AGENTE]
$ snmpwalk -v 2c -c public [IP_DO_AGENTE] sysDescr
$ snmpwalk -v 2c -c public [IP_DO_AGENTE] interface
$ snmpwalk -v 2c -c public [IP_DO_AGENTE] ifTable
$ snmpwalk -v 2c -c public [IP_DO_AGENTE] ifXTable
$ snmpwalk -v 2c -c public [IP_DO_AGENTE] system
$ snmpwalk -v 2c -c public [IP_DO_AGENTE] system.sysUpTime
$ snmpwalk -v 2c -c public [IP_DO_AGENTE] system.sysUpTime.0

References:

Services


Get System Information

/v1/?info=sysInfo

Example

http://localhost:8080/v1/?info=sysInfo:

{
  "sysDescr": "Linux snmpclient 3.13.0-108-generic #155-Ubuntu SMP Wed Jan 11 16:58:52 UTC 2017 x86_64",
  "sysUpTime": "2:01:40",
  "sysName": "snmpclient",
  "sysLocation": "IFPB LAB"
}

Command

$ snmpwalk -v 2c -c ifpb 10.0.1.20 sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: Linux snmpclient 3.13.0-108-generic #155-Ubuntu SMP Wed Jan 11 16:58:52 UTC 2017 x86_64
$ snmpwalk -v 2c -c ifpb 10.0.1.20 sysUpTime
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (730071) 2:01:40.71
$ snmpwalk -v 2c -c ifpb 10.0.1.20 sysName
SNMPv2-MIB::sysName.0 = STRING: snmpclient
snmpwalk -v 2c -c ifpb 10.0.1.20 sysLocation
SNMPv2-MIB::sysLocation.0 = STRING: \"IFPB LAB\"