Finally, I found a way to get snmp info from a host
- Run snmpwalk to view OID nameCode:
snmpwalk -v 1 -c public 192.168.56.1
- Pick one, ie: SNMPv2-MIB::sysContact.0 (sysadmin mail address)
- Use snmptranslate to get OID numberCode:
snmptranslate -On SNMPv2-MIB::sysContact.0
- Check the OID number with check_snmp manuallyCode:
./check_snmp -H 192.168.56.1 -C public -o .1.3.6.1.2.1.1.4.0
- Take note of check_snmp options and arguments, then define/edit a commandCode:
define command{<br /> command_name check_snmp<br /> command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o $ARG1$<br /> }
- Define a service for thatCode:
define service{<br /> use other-service<br /> host_name laptop<br /> service_description Admin email<br /> check_command check_snmp!.1.3.6.1.2.1.1.4.0<br /> }
reference: http://www.linuxquestions.org/questions/linux-networking-3/using-nagios-checksnmp-plugin-to-get-snmp-info-from-computer-751057/
沒有留言:
張貼留言