2011年5月2日 星期一

Linux Service - SNMP

Compile netsnmp
./configure --prefix=install-path
make

SNMPGET
snmpget
./snmpget -v 2c -c public IP-Address SNMPv2-MIB::sysUpTime.0


SNMPWALK
# ./snmpwalk -v 2c -c public IP-Address 1.3.6.1.2.1.1.1
SNMPv2-MIB::sysDescr.0 = STRING: system-Descriptions
[root@localhost apps]# ./snmpwalk -v 2c -c public IP-Address 1.3.6.1.2.1.1
SNMPv2-MIB::sysDescr.0 = STRING: DOCSIS 3.0 Cable Modem <SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprisesOBJECTID
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1094660) 3:02:26.60
SNMPv2-MIB::sysContact.0 = STRING:
SNMPv2-MIB::sysName.0 = STRING:
SNMPv2-MIB::sysLocation.0 = STRING:
SNMPv2-MIB::sysServices.0 = INTEGER: 2
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-SMI::zeroDotZero
SNMPv2-MIB::sysORDescr.1 = STRING:
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00