2,187
edits
(Update table formatting) |
m (→Create SNMP Checks: Updated checks that return text) |
||
Line 34: | Line 34: | ||
=== Define OID's to Poll === | === Define OID's to Poll === | ||
Before you start you need to know what SNMP OID's you want to poll, and what | Before you start you need to know what SNMP OID's you want to poll, and what their values should be. For common devices and metrics you can often get by with a Google search or two, but it doesn't take much for you to need to get a bit more involved. | ||
When it comes to investigating what OID's you can poll for a specific device your friend is [http://www.wtcs.org/snmp4tpc/getif.htm GetIf]. | When it comes to investigating what OID's you can poll for a specific device, your friend is [http://www.wtcs.org/snmp4tpc/getif.htm GetIf]. | ||
Having downloaded the MIB and done some probing GetIf, I've decided I need to monitor the following OID's... | Having downloaded the MIB and done some probing GetIf, I've decided I need to monitor the following OID's... | ||
Line 66: | Line 66: | ||
} | } | ||
* <code> -H '$HOSTADDRESS$' </code> - This is a standard wildcard for all check commands, Nagios substitutes the device's IP address | * <code> -H '$HOSTADDRESS$' </code> - This is a standard wildcard for all check commands, Nagios substitutes the device's IP address | ||
* <code> -o .1.3.6.1.4.1.24681.1.2.6.0 </code> - The SNMP OID being checked ** <code>.iso.org.dod.internet.private.enterprises.storage.storageSystem.SystemInfo.SystemTemperature.0</code> | * <code> -o .1.3.6.1.4.1.24681.1.2.6.0 </code> - The SNMP OID being checked | ||
** <code>.iso.org.dod.internet.private.enterprises.storage.storageSystem.SystemInfo.SystemTemperature.0</code> | |||
* <code> -w 45 </code> - The warning threshold | * <code> -w 45 </code> - The warning threshold | ||
* <code> -c 55 </code> - The critical threshold | * <code> -c 55 </code> - The critical threshold | ||
Line 75: | Line 76: | ||
define command{ | define command{ | ||
command_name check_qnap_sysvol_status | command_name check_qnap_sysvol_status | ||
command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -o .1.3.6.1.4.1.24681.1.2.17.1.6.$ARG1$ -l "Volume Status" | command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -o .1.3.6.1.4.1.24681.1.2.17.1.6.$ARG1$ -l "Volume Status" -r "Ready" | ||
} | } | ||
* <code> -o .1.3.6.1.4.1.24681.1.2.17.1.6.$ARG1$ </code> - The SNMP OID being checked, $ARG1$ is used as a wildcard so that if I had more than one volume I could repeat the check for volume 1, 2 etc without creating a separate check command for each. | * <code> -o .1.3.6.1.4.1.24681.1.2.17.1.6.$ARG1$ </code> - The SNMP OID being checked, $ARG1$ is used as a wildcard so that if I had more than one volume I could repeat the check for volume 1, 2 etc without creating a separate check command for each. | ||
** <code>.iso.org.dod.internet.private.enterprises.storage.storageSystem.SystemInfo.SystemVolumeTable.SysVolumeEntry.SysVolumeStatus.$ARG1$</code> | ** <code>.iso.org.dod.internet.private.enterprises.storage.storageSystem.SystemInfo.SystemVolumeTable.SysVolumeEntry.SysVolumeStatus.$ARG1$</code> | ||
* <code> -r "Ready" </code> - The text expected back from the poll, anything else causes a critical error | |||
define command{ | define command{ | ||
command_name check_qnap_sysvol_space | command_name check_qnap_sysvol_space | ||
command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -o .1.3.6.1.4.1.24681.1.2.17.1.5.$ARG1$ -w $ARG2$: -c $ARG3$: -l "Volume Space" -u | command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -o .1.3.6.1.4.1.24681.1.2.17.1.5.$ARG1$ -w $ARG2$: -c $ARG3$: -l "Volume Space" -u GB | ||
} | } | ||
* <code> -o .1.3.6.1.4.1.24681.1.2.17.1.5.$ARG1$ </code> - The SNMP OID being checked, as above $ARG1$ is used as a command parameter so that if I had more than one volume I could repeat the check for volume 1, 2 etc without creating a separate check command for each. | * <code> -o .1.3.6.1.4.1.24681.1.2.17.1.5.$ARG1$ </code> - The SNMP OID being checked, as above $ARG1$ is used as a command parameter so that if I had more than one volume I could repeat the check for volume 1, 2 etc without creating a separate check command for each. | ||
Line 93: | Line 95: | ||
define command{ | define command{ | ||
command_name check_qnap_disk_status | command_name check_qnap_disk_status | ||
command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -o .1.3.6.1.4.1.24681.1.2.11.1.7.$ARG1$ -l "SMART Info State" | command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -o .1.3.6.1.4.1.24681.1.2.11.1.7.$ARG1$ -l "SMART Info State" -r "GOOD" | ||
} | } | ||
* <code> -o .1.3.6.1.4.1.24681.1.2.11.1.7.$ARG1$ </code> - The SNMP OID being checked, similar to above $ARG1$ is used as a command parameter so that I can create separate checks for the individual disks without creating a separate check command for each. | * <code> -o .1.3.6.1.4.1.24681.1.2.11.1.7.$ARG1$ </code> - The SNMP OID being checked, similar to above $ARG1$ is used as a command parameter so that I can create separate checks for the individual disks without creating a separate check command for each. | ||
** <code>.iso.org.dod.internet.private.enterprises.storage.storageSystem.SystemInfo.SystemHdTable.HdEntry.HdSmartInfo.$ARG1$</code> | ** <code>.iso.org.dod.internet.private.enterprises.storage.storageSystem.SystemInfo.SystemHdTable.HdEntry.HdSmartInfo.$ARG1$</code> | ||
* <code> -r "GOOD" </code> - The text expected back from the poll, anything else causes a critical error | |||
define command{ | define command{ |