exec 1.3.6.1.4.1.5001.100 mailq-check /usr/local/nagios/libexec/check_mailq -w2 -c4 -t7 exec 1.3.6.1.4.1.5002.1 fscheck /bin/touch /opt/rocheck && /bin/touch /tmp/rocheck
# snmpwalk -v 2c 10.93.90.209 -c rsprod .1.3.6.1.4.1.2021.8 UCD-SNMP-MIB::extIndex.1 = INTEGER: 1 UCD-SNMP-MIB::extIndex.2 = INTEGER: 2 UCD-SNMP-MIB::extNames.1 = STRING: 1.3.6.1.4.1.5001.100 UCD-SNMP-MIB::extNames.2 = STRING: 1.3.6.1.4.1.5002.1 UCD-SNMP-MIB::extCommand.1 = STRING: mailq-check UCD-SNMP-MIB::extCommand.2 = STRING: fscheck UCD-SNMP-MIB::extResult.1 = INTEGER: 1 UCD-SNMP-MIB::extResult.2 = INTEGER: 1 UCD-SNMP-MIB::extOutput.1 = STRING: mailq-check: No such file or directory UCD-SNMP-MIB::extOutput.2 = STRING: fscheck: No such file or directory UCD-SNMP-MIB::extErrFix.1 = INTEGER: 0 UCD-SNMP-MIB::extErrFix.2 = INTEGER: 0 UCD-SNMP-MIB::extErrFixCmd.1 = STRING: UCD-SNMP-MIB::extErrFixCmd.2 = STRING:
exec mailq-check "/usr/local/nagios/libexec/check_mailq -w2 -c4 -t7 -Mpostfix" exec fscheck "/bin/touch /opt/rocheck && /bin/touch /tmp/rocheck"
Which, when called with the same snmpwalk above, comes back as:
UCD-SNMP-MIB::extIndex.1 = INTEGER: 1 UCD-SNMP-MIB::extIndex.2 = INTEGER: 2 UCD-SNMP-MIB::extNames.1 = STRING: mailq-check UCD-SNMP-MIB::extNames.2 = STRING: fscheck UCD-SNMP-MIB::extCommand.1 = STRING: /usr/local/nagios/libexec/check_mailq -w2 -c4 -t7 -Mpostfix UCD-SNMP-MIB::extCommand.2 = STRING: /bin/touch /opt/rocheck && /bin/touch /tmp/rocheck UCD-SNMP-MIB::extResult.1 = INTEGER: 0 UCD-SNMP-MIB::extResult.2 = INTEGER: 0 UCD-SNMP-MIB::extOutput.1 = STRING: OK: mailq reports queue is empty|unsent=0;2;4;0 UCD-SNMP-MIB::extOutput.2 = STRING: UCD-SNMP-MIB::extErrFix.1 = INTEGER: 0 UCD-SNMP-MIB::extErrFix.2 = INTEGER: 0 UCD-SNMP-MIB::extErrFixCmd.1 = STRING: UCD-SNMP-MIB::extErrFixCmd.2 = STRING:
Now, let me explain what all of these MIBs mean.
- extIndex.#The Index number of the command
- extNames.#The Name you gave the command. This is the first parameter you pass to exec
- extCommand.#The full command you had SNMPd call to return you this info. Second parameter you passed to exec
- extResult.#Exit Code from the command exec'd
- extOutput.#Raw output of the command exec'd
- extErrFix.#This is a bit that can be flipped by the client. Flipping this to a 1 kicks off the extErrFixCmd by SNMPd. Generally this is used to 'fix' and 'error' condition.
- extErrFixCmd.#The command to be executed by the SNMPd server
No comments:
Post a Comment