SNMP API
SNMP
MIB
Object Identifier (OID) - sysUpTime:
- 1 - iso
- 1.3 - identified-organization
- 1.3.6 - dod
- 1.3.6.1 - internet
- 1.3.6.1.2 - mgmt
- 1.3.6.1.2.1 - mib-2
- 1.3.6.1.2.1.1 - system
- 1.3.6.1.2.1.1.3 - sysUpTime
Commands
snmpget
snmpwalk
snmpbulkwalk
snmptable
snmpset
snmptrapd
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:
- How To Install and Configure an SNMP Daemon and Client on Ubuntu 14.04
- Ubuntu SNMPAgent
- Net-SNMP
- Commands
- MIB
Services
Get System Information
/v1/?info=sysInfo
Example
{
"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\"