109
Nagios Plug-in Command Reference All plugins are copyrighted by their respective creators. This info can be found in the plugin files 1

Nagios Plug Ins

Embed Size (px)

Citation preview

Page 1: Nagios Plug Ins

Nagios Plug-in Command Reference

All plugins are copyrighted by their respective creators. This info can be found in the plugin files

1

Page 2: Nagios Plug Ins

1. check_aptThis plugin checks for software updates on systems that usepackage management systems based on the apt-get(8) commandfound in Debian GNU/Linux

Usage:check_apt [[-d|-u|-U]opts] [-n] [-t timeout]

Options: -h, --help Print detailed help screen -V, --version Print version information -t, --timeout=INTEGER Seconds before connection times out (default: 10) -U, --upgrade=OPTS [Default] Perform an upgrade. If an optional OPTS argument is provided, apt-get will be run with these command line options instead of the default (-o 'Debug::NoLocking=true' -s -qq). Note that you may be required to have root privileges if you do not use the default options. -d, --dist-upgrade=OPTS Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS can be provided to override the default options. -n, --no-upgrade Do not run the upgrade. Probably not useful (without -u at least). -i, --include=REGEXP Include only packages matching REGEXP. Can be specified multiple times the values will be combined together. Any patches matching this list cause the plugin to return WARNING status. Others will be ignored. Default is to include all packages. -e, --exclude=REGEXP Exclude packages matching REGEXP from the list of packages that would otherwise be included. Can be specified multiple times; the values will be combined together. Default is to exclude no packages. -c, --critical=REGEXP If the full package information of any of the upgradable packages match this REGEXP, the plugin will return CRITICAL status. Can be specified multiple times like above. Default is a regexp matching security upgrades for Debian and Ubuntu: ^[^\(]*\([^ ]* (Debian-Security:|Ubuntu:[^/]*/[^-]*-security) Note that the package must first match the include list before its information is compared against the critical list.

The following options require root privileges and should be used with care:

-u, --update=OPTS First perform an 'apt-get update'. An optional OPTS parameter overrides the default options. Note: you may also need to adjust the global timeout (with -t) to prevent the plugin from timing out if apt-get upgrade is expected to take longer than the default timeout.

2

Page 3: Nagios Plug Ins

2. check_breezeThis plugin reports the signal strength of a Breezecom wireless equipment

Usage: check_breeze -H <host> [-C community] -w <warn> -c <crit>

-H, --hostname=HOST Name or IP address of host to check-C, --community=community SNMPv1 community (default public)-w, --warning=INTEGER Percentage strength below which a WARNING status will result-c, --critical=INTEGER Percentage strength below which a CRITICAL status will result

3

Page 4: Nagios Plug Ins

3. check_by_sshThis plugin uses SSH to execute commands on a remote host

Usage: check_by_ssh [-f46] [-t timeout] [-i identity] [-l user] -H <host> -C <command> [-n name] [-s servicelist] [-O outputfile] [-p port]Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -1, --proto1 tell ssh to use Protocol 1 -2, --proto2 tell ssh to use Protocol 2 -S, --skiplines=n Ignore first n lines on STDERR (to suppress a logon banner) -f tells ssh to fork rather than create a tty -C, --command='COMMAND STRING' command to execute on the remote machine -l, --logname=USERNAME SSH user name on remote host [optional] -i, --identity=KEYFILE identity of an authorized key [optional] -O, --output=FILE external command file for nagios [optional] -s, --services=LIST list of nagios service names, separated by ':' [optional] -n, --name=NAME short name of host in nagios configuration [optional] -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10)

The most common mode of use is to refer to a local identity file withthe '-i' option. In this mode, the identity pair should have a nullpassphrase and the public key should be listed in the authorized_keysfile of the remote host. Usually the key will be restricted to runningonly one command on the remote server. If the remote SSH server tracksinvocation arguments, the one remote program may be an agent that canexecute additional commands as proxy

To use passive mode, provide multiple '-C' options, and provideall of -O, -s, and -n options (servicelist order must match '-C'options)

$ check_by_ssh -H localhost -n lh -s c1:c2:c3 \ -C uptime -C uptime -C uptime -O /tmp/foo$ cat /tmp/foo

4

Page 5: Nagios Plug Ins

[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c1;0; up 2 days...[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days...[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days...

5

Page 6: Nagios Plug Ins

4. check_clamdThis plugin tests CLAMD connections with the specified host (or unix socket).

Usage: check_CLAMD -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

6

Page 7: Nagios Plug Ins

5. check_clusterHost/Service Cluster Plugin for Nagios 2

Usage: check_cluster (-s | -h) -d val1[,val2,...,valn] [-l label][-w threshold] [-c threshold] [-v] [--help]

Options: -s, --service Check service cluster status -h, --host Check host cluster status -l, --label=STRING Optional prepended text output (i.e. "Host cluster") -w, --warning=THRESHOLD Specifies the range of hosts or services in cluster that must be in a non-OK state in order to return a WARNING status level -c, --critical=THRESHOLD Specifies the range of hosts or services in cluster that must be in a non-OK state in order to return a CRITICAL status level -d, --data=LIST The status codes of the hosts or services in the cluster, separated by commas -v, --verbose Show details for command-line debugging (Nagios may truncate output)

Notes: See: http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT for THRESHOLD format and examples.

7

Page 8: Nagios Plug Ins

6. check_dhcpThis plugin tests the availability of DHCP servers on a network.

Usage: check_dhcp [-s serverip] [-r requestedip] [-t timeout] [-i interface] [-v] -s, --serverip=IPADDRESS IP address of DHCP server that we must hear from -r, --requestedip=IPADDRESS IP address that should be offered by at least one DHCP server -t, --timeout=INTEGER Seconds to wait for DHCPOFFER before timeout occurs -i, --interface=STRING Interface to to use for listening (i.e. eth0) -v, --verbose Print extra information (command-line use only) -h, --help Print detailed help screen -V, --version Print version information

8

Page 9: Nagios Plug Ins

7. check_digThis plugin test the DNS service on the specified host using dig

Usage:check_dig -H host -l lookup [-p <server port>] [-T <query type>] [-w <warning interval>] [-c <critical interval>] [-t <timeout>] [-a <expected answer address>] [-v]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -P, --port=INTEGER Port number (default: 53)-l, --lookup=STRINGmachine name to lookup-T, --record_type=STRINGrecord type to lookup (default: A)-a, --expected_address=STRINGan address expected to be in the answer section.if not set, uses whatever was in -l -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

9

Page 10: Nagios Plug Ins

8. check_diskThis plugin checks the amount of used disk space on a mounted file systemand generates an alert if free space is less than one of the threshold values

Usage: check_disk -w limit -c limit [-p path | -x device] [-t timeout][-m] [-e] [-W limit] [-K limit] [-v] [-q]

Options: -h, --help Print detailed help screen -V, --version Print version information -w, --warning=INTEGER Exit with WARNING status if less than INTEGER units of disk are free -w, --warning=PERCENT% Exit with WARNING status if less than PERCENT of disk space is free -W, --iwarning=PERCENT% Exit with WARNING status if less than PERCENT of inode space is free -K, --icritical=PERCENT% Exit with CRITICAL status if less than PERCENT of inode space is free -c, --critical=INTEGER Exit with CRITICAL status if less than INTEGER units of disk are free -c, --critical=PERCENT% Exit with CRITCAL status if less than PERCENT of disk space is free -C, --clear Clear thresholds -u, --units=STRING Choose bytes, kB, MB, GB, TB (default: MB) -k, --kilobytes Same as '--units kB' -m, --megabytes Same as '--units MB' -l, --local Only check local filesystems -p, --path=PATH, --partition=PARTITION Path or partition (may be repeated) -x, --exclude_device=PATH <STRING> Ignore device (only works if -p unspecified) -X, --exclude-type=TYPE <STRING> Ignore all filesystems of indicated type (may be repeated) -m, --mountpoint Display the mountpoint instead of the partition -e, --errors-only Display only devices/mountpoints with errors -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

Examples: check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB

1

Page 11: Nagios Plug Ins

9. check_disk_smb

Perl Check SMB Disk plugin for Nagios

Usage: check_disk_smb -H <host> -s <share> -u <user> -p <password> -w <warn> -c <crit> [-W <workgroup>] [-P <port>]

-H, --hostname=HOST NetBIOS name of the server-s, --share=STRING Share name to be tested-W, --workgroup=STRING Workgroup or Domain used (Defaults to "WORKGROUP")-u, --user=STRING Username to log in to server. (Defaults to "guest")-p, --password=STRING Password to log in to server. (Defaults to an empty password)-w, --warning=INTEGER or INTEGER[kMG] Percent of used space at which a warning will be generated (Default: 85%)

-c, --critical=INTEGER or INTEGER[kMG] Percent of used space at which a critical will be generated (Defaults: 95%)-P, --port=INTEGER Port to be used to connect to. Some Windows boxes use 139, others 445 (Defaults to smbclient default)

If thresholds are followed by either a k, M, or G then check to see if that much disk space is available (kilobytes, Megabytes, Gigabytes)

Warning percentage should be less than criticalWarning (remaining) disk space should be greater than critical.

1

Page 12: Nagios Plug Ins

10. check_dns

This plugin uses the nslookup program to obtain the IP address for the given host/domain query.An optional DNS server to use may be specified.If no DNS server is specified, the default server(s) specified in /etc/resolv.conf will be used.

Usage:check_dns -H host [-s server] [-a expected-address] [-A] [-t timeout] [-w warn] [-c crit]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=HOST The name or address you want to query -s, --server=HOST Optional DNS server you want to use for the lookup -a, --expected-address=IP-ADDRESS|HOST Optional IP-ADDRESS you expect the DNS server to return. HOST must end with . -A, --expect-authority Optionally expect the DNS server to be authoritative for the lookup -w, --warning=seconds Return warning if elapsed time exceeds value. Default off -c, --critical=seconds Return critical if elapsed time exceeds value. Default off -t, --timeout=INTEGER Seconds before connection times out (default: 10)

1

Page 13: Nagios Plug Ins

11. check_dummyThis plugin will simply return the state corresponding to the numeric valueof the <state> argument with optional text

Usage: check_dummy <integer state> [optional text]

Options: -h, --help Print detailed help screen -V, --version Print version information

1

Page 14: Nagios Plug Ins

12. check_file_ageUsage: check_file_age [-w <secs>] [-c <secs>] [-W <size>] [-C <size>] -f <file> check_file_age [-h | --help] check_file_age [-V | --version]

<secs> File must be no more than this many seconds old (default: warn 240 secs, crit 600) <size> File must be at least this many bytes long (default: crit 0 bytes)

1

Page 15: Nagios Plug Ins

13. check_flexlmCheck available flexlm license managers

Usage: check_flexlm -F <filename> [-v] [-t] [-V] [-h] check_flexlm --help check_flexlm --version

-F, --filename=FILE Name of license file (usually "license.dat")-v, --verbose Print some extra debugging information (not advised for normal operation)-t, --timeout Plugin time out in seconds (default = 15 )-V, --version Show version and license information-h, --help Show this help screen

Flexlm license managers usually run as a single server or three servers and aquorum is needed. The plugin return OK if 1 (single) or 3 (triple) serversare running, CRITICAL if 1(single) or 3 (triple) servers are down, and WARNINGif 1 or 2 of 3 servers are running

1

Page 16: Nagios Plug Ins

14. check_ftpThis plugin tests FTP connections with the specified host (or unix socket).

Usage: check_FTP -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

1

Page 17: Nagios Plug Ins

15. check_hpjdThis plugin tests the STATUS of an HP printer with a JetDirect card.Net-snmp must be installed on the computer running the plugin.

Usage: check_hpjd -H host [-C community]

Options: -h, --help Print detailed help screen -V, --version Print version information -C, --community=STRINGThe SNMP community name (default=public)

1

Page 18: Nagios Plug Ins

16. check_httpThis plugin tests the HTTP service on the specified host. It can testnormal (http) and secure (https) servers, follow redirects, search forstrings and regular expressions, check connection times, and report oncertificate expiration times.

Usage: check_http -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>] [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L] [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>] [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>] [-A string] [-k string]NOTE: One or both of -H and -I must be specified

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name argument for servers using host headers (virtual host) Append a port to include it in the header (eg: example.com:5000) -I, --IP-address=ADDRESS IP address or name (use numeric address if possible to bypass DNS lookup). -p, --port=INTEGER Port number (default: 80) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -S, --ssl Connect via SSL -C, --certificate=INTEGER Minimum number of days a certificate has to be valid. (when this option is used the url is not checked.) -e, --expect=STRING String to expect in first (status) line of server response (default: HTTP/1.) If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing) -s, --string=STRING String to expect in the content -u, --url=PATH URL to GET or POST (default: /) -P, --post=STRING URL encoded http POST data -N, --no-body Don't wait for document body: stop reading after headers. (Note that this still does an HTTP GET or POST, not a HEAD.) -M, --max-age=SECONDS Warn if document is more than SECONDS old. the number can also be of the form "10m" for minutes, "10h" for hours, or "10d" for days. -T, --content-type=STRING specify Content-Type header media type when POSTing -l, --linespan Allow regex to span newlines (must precede -r or -R) -r, --regex, --ereg=STRING Search page for regex STRING -R, --eregi=STRING Search page for case-insensitive regex STRING -a, --authorization=AUTH_PAIR Username:password on sites with basic authentication -A, --useragent=STRING

1

Page 19: Nagios Plug Ins

String to be sent in http header as "User Agent" -k, --header=STRING Any other tags to be sent in http header. Use multiple times for additional headers -L, --link=URL Wrap output in HTML link (obsoleted by urlize) -f, --onredirect=<ok|warning|critical|follow> How to handle redirected pages -m, --pagesize=INTEGER<:INTEGER> Minimum page size required (bytes) : Maximum page size required (bytes) -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)This plugin will attempt to open an HTTP connection with the host. Successfulconnects return STATE_OK, refusals and timeouts return STATE_CRITICAL, othererrors return STATE_UNKNOWN. Successful connects, but incorrect reponsemessages from the host result in STATE_WARNING return values. If you arechecking a virtual server that uses 'host headers' you must supply the FQDN(fully qualified domain name) as the [host_name] argument.

This plugin can also check whether an SSL enabled web server is able toserve content (optionally within a specified time) or whether the X509certificate is still valid for the specified number of days.

CHECK CONTENT: check_http -w 5 -c 10 --ssl www.verisign.com

When the 'www.verisign.com' server returns its content within 5 seconds, aSTATE_OK will be returned. When the server returns its content but exceedsthe 5-second threshold, a STATE_WARNING will be returned. When an error occurs,a STATE_CRITICAL will be returned.

CHECK CERTIFICATE: check_http www.verisign.com -C 14

When the certificate of 'www.verisign.com' is valid for more than 14 days, aSTATE_OK is returned. When the certificate is still valid, but for less than14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned whenthe certificate is expired.

1

Page 20: Nagios Plug Ins

17. check_icmpUsage: check_icmp [options] [-H] host1 host2 hostn

Where options are any combination of: * -H | --host specify a target * -w | --warn warning threshold (currently 200.000ms,40%) * -c | --crit critical threshold (currently 500.000ms,80%) * -n | --packets number of packets to send (currently 5) * -i | --interval max packet interval (currently 80.000ms) * -I | --hostint max target interval (currently 0.000ms) * -l | --ttl TTL on outgoing packets (currently 0) * -t | --timeout timeout value (seconds, currently 10) * -b | --bytes icmp packet size (currenly ignored) -v | --verbose verbosity++ -h | --help this cruft

The -H switch is optional. Naming a host (or several) to check is not.

Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%packet loss. The default values should work well for most users.You can specify different RTA factors using the standardized abbreviationsus (microseconds), ms (milliseconds, default) or just plain s for seconds.

Threshold format for -d is warn,crit. 12,14 means WARNING if >= 12 hopsare spent and CRITICAL if >= 14 hops are spent.NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not.

The -v switch can be specified several times for increased verbosity.

Long options are currently unsupported.

Options marked with * require an argument

2

Page 21: Nagios Plug Ins

18. check_ifoperstatuscheck_ifoperstatus plugin for Nagios monitors operationalstatus of a particular network interface on the target host

Usage: -H (--hostname) Hostname to query - (required) -C (--community) SNMP read community (defaults to public, used with SNMP v1 and v2c -v (--snmp_version) 1 for SNMP v1 (default) 2 for SNMP v2c SNMP v2c will use get_bulk for less overhead if monitoring with -d -L (--seclevel) choice of "noAuthNoPriv", "authNoPriv", or "authPriv" -U (--secname) username for SNMPv3 context -c (--context) SNMPv3 context name (default is empty string) -A (--authpass) authentication password (cleartext ascii or localized key in hex with 0x prefix generated by using "snmpkey" utility auth password and authEngineID -a (--authproto) Authentication protocol ( MD5 or SHA1) -X (--privpass) privacy password (cleartext ascii or localized key in hex with 0x prefix generated by using "snmpkey" utility privacy password and authEngineID -k (--key) SNMP IfIndex value -d (--descr) SNMP ifDescr value -p (--port) SNMP port (default 161) -I (--ifmib) Agent supports IFMIB ifXTable. Do not use if you don't know what this is. -n (--name) the value should match the returned ifName (Implies the use of -I) -w (--warn =i|w|c) ignore|warn|crit if the interface is dormant (default critical) -D (--admin-down =i|w|c) same for administratively down interfaces (default warning) -M (--maxmsgsize) Max message size - usefull only for v1 or v2c -t (--timeout) seconds before the plugin times out (default=15) -V (--version) Plugin version -h (--help) usage help

-k or -d must be specified

Note: either -k or -d must be specified and -d is much more networkintensive. Use it sparingly or not at all. -n is used to match againsta much more descriptive ifName value in the IfXTable to verify that thesnmpkey has not changed to some other network interface after a reboot.

2

Page 22: Nagios Plug Ins

19. check_ifstatuscheck_ifstatus plugin for Nagios monitors operationalstatus of each network interface on the target host

Usage: -H (--hostname) Hostname to query - (required) -C (--community) SNMP read community (defaults to public, used with SNMP v1 and v2c -v (--snmp_version) 1 for SNMP v1 (default) 2 for SNMP v2c SNMP v2c will use get_bulk for less overhead 3 for SNMPv3 (requires -U option) -p (--port) SNMP port (default 161) -I (--ifmib) Agent supports IFMIB ifXTable. For Cisco - this will provide the descriptive name. Do not use if you don't know what this is. -x (--exclude) A comma separated list of ifType values that should be excluded from the report (default for an empty list is PPP(23). -u (--unused_ports) A comma separated list of ifIndex values that should be excluded from the report (default is an empty exclusion list). See the IANAifType-MIB for a list of interface types. -L (--seclevel) choice of "noAuthNoPriv", "authNoPriv", or "authPriv" -U (--secname) username for SNMPv3 context -c (--context) SNMPv3 context name (default is empty string) -A (--authpass) authentication password (cleartext ascii or localized key in hex with 0x prefix generated by using "snmpkey" utility auth password and authEngineID -a (--authproto) Authentication protocol ( MD5 or SHA1) -X (--privpass) privacy password (cleartext ascii or localized key in hex with 0x prefix generated by using "snmpkey" utility privacy password and authEngineID -M (--maxmsgsize) Max message size - usefull only for v1 or v2c -t (--timeout) seconds before the plugin times out (default=15) -V (--version) Plugin version -h (--help) usage help

2

Page 23: Nagios Plug Ins

20. check_imapThis plugin tests IMAP connections with the specified host (or unix socket).

Usage: check_IMAP -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

2

Page 24: Nagios Plug Ins

21. check_ircdPerl Check IRCD plugin for Nagios

Usage: check_ircd -H <host> [-w <warn>] [-c <crit>] [-p <port>]

-H, --hostname=HOST Name or IP address of host to check-w, --warning=INTEGER Number of connected users which generates a warning state (Default: 50)-c, --critical=INTEGER Number of connected users which generates a critical state (Default: 100)-p, --port=INTEGER Port that the ircd daemon is running on <host> (Default: 6667)-v, --verbose Print extra debugging information

2

Page 25: Nagios Plug Ins

22. check_jabberThis plugin tests JABBER connections with the specified host (or unix socket).

Usage: check_JABBER -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

2

Page 26: Nagios Plug Ins

23. check_loadThis plugin tests the current system load average.

Usage: check_load -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15

Options: -h, --help Print detailed help screen -V, --version Print version information -w, --warning=WLOAD1,WLOAD5,WLOAD15 Exit with WARNING status if load average exceeds WLOADn -c, --critical=CLOAD1,CLOAD5,CLOAD15 Exit with CRITICAL status if load average exceed CLOADn

the load average format is the same used by "uptime" and "w"

2

Page 27: Nagios Plug Ins

24. check_log

Log file pattern detector plugin for Nagios

Usage: check_log -F logfile -O oldlog -q queryUsage: check_log --helpUsage: check_log --version

2

Page 28: Nagios Plug Ins

25. check_mailqUsage: check_mailq -w <warn> -c <crit> [-W <warn>] [-C <crit>] [-M <MTA>] [-t <timeout>] [-v verbose]

Checks the number of messages in the mail queue (supports multiple sendmail queues, qmail) Feedback/patches to support non-sendmail mailqueue welcome

-w (--warning) = Min. number of messages in queue to generate warning-c (--critical) = Min. number of messages in queu to generate critical alert ( w < c )-W (--Warning) = Min. number of messages for same domain in queue to generate warning-C (--Critical) = Min. number of messages for same domain in queue to generate critical alert ( W < C )-t (--timeout) = Plugin timeout in seconds (default = 15)-M (--mailserver) = [ sendmail | qmail | postfix | exim ] (default = sendmail)-h (--help)-V (--version)-v (--verbose) = debugging output

Note: -w and -c are required arguments. -W and -C are optional. -W and -C are applied to domains listed on the queues - both FROM and TO. (sendmail) -W and -C are applied message not yet preproccessed. (qmail) This plugin uses the system mailq command (sendmail) or qmail-stat (qmail) to look at the queues. Mailq can usually only be accessed by root or a TrustedUser. You will have to set appropriate permissions for the plugin to work.

2

Page 29: Nagios Plug Ins

26. check_mrtgThis plugin will check either the average or maximum value of one of thetwo variables recorded in an MRTG log file.

Usage: check_mrtg -F log_file -a <AVG | MAX> -v variable -w warning -c critical [-l label] [-u units] [-e expire_minutes] [-t timeout] [-v]

Options: -h, --help Print detailed help screen -V, --version Print version information -F, --logfile=FILE The MRTG log file containing the data you want to monitor -e, --expires=MINUTES Minutes before MRTG data is considered to be too old -a, --aggregation=AVG|MAX Should we check average or maximum values? -v, --variable=INTEGER Which variable set should we inspect? (1 or 2) -w, --warning=INTEGER Threshold value for data to result in WARNING status -c, --critical=INTEGER Threshold value for data to result in CRITICAL status -l, --label=STRING Type label for data (Examples: Conns, "Processor Load", In, Out) -u, --units=STRING Option units label for data (Example: Packets/Sec, Errors/Sec, "Bytes Per Second", "% Utilization")If the value exceeds the <vwl> threshold, a WARNING status is returned. Ifthe value exceeds the <vcl> threshold, a CRITICAL status is returned. Ifthe data in the log file is older than <expire_minutes> old, a WARNINGstatus is returned and a warning message is printed.

This plugin is useful for monitoring MRTG data that does not correspond tobandwidth usage. (Use the check_mrtgtraf plugin for monitoring bandwidth).It can be used to monitor any kind of data that MRTG is monitoring - errors,packets/sec, etc. I use MRTG in conjuction with the Novell NLM that allowsme to track processor utilization, user connections, drive space, etc andthis plugin works well for monitoring that kind of data as well.

Notes:- This plugin only monitors one of the two variables stored in the MRTG log file. If you want to monitor both values you will have to define two commands with different values for the <variable> argument. Of course, you can always hack the code to make this plugin work for you...- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded from http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html

2

Page 30: Nagios Plug Ins

27. check_mrtgtrafThis plugin will check the incoming/outgoing transfer rates of a router,switch, etc recorded in an MRTG log. If the newest log entry is olderthan <expire_minutes>, a WARNING status is returned. If either theincoming or outgoing rates exceed the <icl> or <ocl> thresholds (inBytes/sec), a CRITICAL status results. If either of the rates exceedthe <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.

Usage: check_mrtgtraf -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair> -c <critical_pair> [-e expire_minutes] [-t timeout] [-v]

Options: -h, --help Print detailed help screen -V, --version Print version information -F, --filename=STRING File to read log from -e, --expires=INTEGER Minutes after which log expires -a, --aggregation=(AVG|MAX) Test average or maximum -w, --warning Warning threshold pair "<incoming>,<outgoing>" -c, --critical Critical threshold pair "<incoming>,<outgoing>"Notes:- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html- While MRTG can monitor things other than traffic rates, this plugin probably won't work with much else without modification.- The calculated i/o rates are a little off from what MRTG actually reports. I'm not sure why this is right now, but will look into itfor future enhancements of this plugin.

3

Page 31: Nagios Plug Ins

28. check_mysqlThis program tests connections to a mysql server

Usage:check_mysql [-d database] [-H host] [-P port] [-u user] [-p password] [-S]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -P, --port=INTEGER Port number (default: 3306) -d, --database=STRING Check database with indicated name -u, --username=STRING Connect using the indicated username -p, --password=STRING Use the indicated password to authenticate the connection ==> IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!! <== Your clear-text password will be visible as a process table entry -S, --check-slave Check if the slave thread is running properly. -w, --warning Exit with WARNING status if slave server is more then INTEGER seconds behind master -c, --critical Exit with CRITICAL status if slave server is more then INTEGER seconds behind master There are no required arguments. By default, the local database witha server listening on MySQL standard port 3306 will be checked

3

Page 32: Nagios Plug Ins

29. check_mysql_queryThis program checks a query result against threshold levels

Usage:check_mysql_query -q SQL_query [-w warn] [-c crit][-d database] [-H host] [-P port] [-u user] [-p password]

Options: -h, --help Print detailed help screen -V, --version Print version information -q, --query=STRING SQL query to run. Only first column in first row will be read -w, --warning=RANGE Warning range (format: start:end). Alert if outside this range -c, --critical=RANGE Critical range -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -P, --port=INTEGER Port number (default: 3306) -d, --database=STRING Database to check -u, --username=STRING Username to login with -p, --password=STRING Password to login with ==> IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!! <==

A query is required. The result from the query should be numeric.For extra security, create a user with minimal access.

3

Page 33: Nagios Plug Ins

30. check_nagiosThis plugin checks the status of the Nagios process on the localmachine. The plugin will check to make sure the Nagios status log is no olderthan the number of minutes specified by the expires option. It alsochecks the process table for a process matching the command argument.

Usage: check_nagios -F <status log file> -e <expire_minutes> -C <process_string>

Options: -h, --help Print detailed help screen -V, --version Print version information -F, --filename=FILE Name of the log file to check -e, --expires=INTEGER Minutes aging after which logfile is considered stale -C, --command=STRING Substring to search for in process argumentsExample: ./check_nagios -e 5 -F /usr/local/nagios/var/status.log -C /usr/local/nagios/bin/nagios

3

Page 34: Nagios Plug Ins

31. check_nntpThis plugin tests NNTP connections with the specified host (or unix socket).

Usage: check_NNTP -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

3

Page 35: Nagios Plug Ins

32. check_nntpsThis plugin tests NNTPS connections with the specified host (or unix socket).

Usage: check_NNTPS -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

3

Page 36: Nagios Plug Ins

33. check_nrpeUsage: check_nrpe -H <host> [-n] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]

Options: -n = Do no use SSL <host> = The address of the host running the NRPE daemon [port] = The port on which the daemon is running (default=5666) [timeout] = Number of seconds before connection times out (default=10) [command] = The name of the command that the remote daemon should run [arglist] = Optional arguments that should be passed to the command. Multiple arguments should be separated by a space. If provided, this must be the last option supplied on the command line.

Note:This plugin requires that you have the NRPE daemon running on the remote host.You must also have configured the daemon to associate a specific plugin commandwith the [command] option you are specifying here. Upon receipt of the[command] argument, the NRPE daemon will run the appropriate plugin command andsend the plugin output and return code back to *this* plugin. This allows youto execute plugins on remote hosts and 'fake' the results to make Nagios thinkthe plugin is being run locally.

3

Page 37: Nagios Plug Ins

34. check_nt This plugin collects data from the NSClient service running on aWindows NT/2000/XP/2003 server.

Usage: check_nt -H host -v variable [-p port] [-w warning] [-c critical] [-l params] [-d SHOWALL] [-t timeout]Options:-H, --hostname=HOST Name of the host to check-p, --port=INTEGER Optional port number (default: 1248)-s <password> Password needed for the request-w, --warning=INTEGER Threshold which will result in a warning status-c, --critical=INTEGER Threshold which will result in a critical status-t, --timeout=INTEGER Seconds before connection attempt times out (default: 10)-h, --help Print this help screen-V, --version Print version information-v, --variable=STRING Variable to check. Valid variables are: CLIENTVERSION = Get the NSClient version If -l <version> is specified, will return warning if versions differ. CPULOAD = Average CPU load on last x minutes. Request a -l parameter with the following syntax: -l <minutes range>,<warning threshold>,<critical threshold>. <minute range> should be less than 24*60. Thresholds are percentage and up to 10 requests can be done in one shot. ie: -l 60,90,95,120,90,95 UPTIME = Get the uptime of the machine. No specific parameters. No warning or critical threshold USEDDISKSPACE = Size and percentage of disk use. Request a -l parameter containing the drive letter only. Warning and critical thresholds can be specified with -w and -c. MEMUSE = Memory use. Warning and critical thresholds can be specified with -w and -c. SERVICESTATE = Check the state of one or several services. Request a -l parameters with the following syntax: -l <service1>,<service2>,<service3>,... You can specify -d SHOWALL in case you want to see working services in the returned string. PROCSTATE = Check if one or several process are running. Same syntax as SERVICESTATE. COUNTER = Check any performance counter of Windows NT/2000. Request a -l parameters with the following syntax: -l "\\<performance object>\\counter","<description> The <description> parameter is optional and is given to a printf output command which requires a float parameter. If <description> does not include "%", it is used as a label. Some examples: "Paging file usage is %.2f %%" "%.f %% paging file used."Notes: - The NSClient service should be running on the server to get any information (http://nsclient.ready2run.nl).Critical thresholds should be lower than warning thresholds

3

Page 38: Nagios Plug Ins

35. check_ntpUsage: check_ntp -H <host> [-46] [-O] [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-v

verbose]

Checks the local timestamp offset versus <host> with ntpdateChecks the jitter/dispersion of clock signal between <host> and its sys.peer with ntpq

-O (--zero-offset) A zero offset on "ntpdate" will generate a CRITICAL.

-w (--warning) Clock offset in seconds at which a warning message will be generated. Defaults to 60.-c (--critical) Clock offset in seconds at which a critical message will be generated. Defaults to 120.-j (--jwarn) Clock jitter in milliseconds at which a warning message will be generated. Defaults to 5000.-k (--jcrit) Clock jitter in milliseconds at which a critical message will be generated. Defaults to 10000.

If jitter/dispersion is specified with -j or -k and ntpq times out, then a warning is returned.

-4 (--use-ipv4) Use IPv4 connection-6 (--use-ipv6) Use IPv6 connection

3

Page 39: Nagios Plug Ins

36. check_nwstatThis plugin attempts to contact the MRTGEXT NLM running on aNovell server to gather the requested system information.

Usage: check_nwstat -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout].

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: 9999) -v, --variable=STRING Variable to check. Valid variables include: LOAD1 = 1 minute average CPU load LOAD5 = 5 minute average CPU load LOAD15 = 15 minute average CPU load CSPROCS = number of current service processes (NW 5.x only) ABENDS = number of abended threads (NW 5.x only) UPTIME = server uptime LTCH = percent long term cache hits CBUFF = current number of cache buffers CDBUFF = current number of dirty cache buffers DCB = dirty cache buffers as a percentage of the total TCB = dirty cache buffers as a percentage of the original OFILES = number of open files VPF<vol> = percent free space on volume <vol> VKF<vol> = KB of free space on volume <vol> VPP<vol> = percent purgeable space on volume <vol> VKP<vol> = KB of purgeable space on volume <vol> VPNP<vol> = percent not yet purgeable space on volume <vol> VKNP<vol> = KB of not yet purgeable space on volume <vol> LRUM = LRU sitting time in minutes LRUS = LRU sitting time in seconds DSDB = check to see if DS Database is open DSVER = NDS version UPRB = used packet receive buffers PUPRB = percent (of max) used packet receive buffers SAPENTRIES = number of entries in the SAP table SAPENTRIES<n> = number of entries in the SAP table for SAP type <n> TSYNC = timesync status LOGINS = check to see if logins are enabled CONNS = number of currently licensed connections NLM:<nlm> = check if NLM is loaded and report version (e.g. "NLM:TSANDS.NLM") -w, --warning=INTEGER Threshold which will result in a warning status -c, --critical=INTEGER Threshold which will result in a critical status -o, --osversion Include server version string in results -t, --timeout=INTEGER Seconds before connection times out (default: 10)

Notes:- This plugin requres that the MRTGEXT.NLM file from James Drews' MRTG

3

Page 40: Nagios Plug Ins

extension for NetWare be loaded on the Novell servers you wish to check. (available from http://www.engr.wisc.edu/~drews/mrtg/)- Values for critical thresholds should be lower than warning thresholds when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, TCB, LRUS and LRUM.

4

Page 41: Nagios Plug Ins

37. check_oracle

Usage: check_oracle --tns <Oracle Sid or Hostname/IP address> check_oracle --db <ORACLE_SID> check_oracle --login <ORACLE_SID> check_oracle --cache <ORACLE_SID> <USER> <PASS> <CRITICAL> <WARNING> check_oracle --tablespace <ORACLE_SID> <USER> <PASS> <TABLESPACE> <CRITICAL> <WARNING> check_oracle --oranames <Hostname> check_oracle --help check_oracle --version

Check Oracle status

--tns SID/IP Address Check remote TNS server--db SID Check local database (search /bin/ps for PMON process) and check filesystem for sgadefORACLE_SID.dbf--login SID Attempt a dummy login and alert if not ORA-01017: invalid username/password--cache Check local database for library and buffer cache hit ratios ---> Requires Oracle user/password and SID specified. ---> Requires select on v_ and v_--tablespace Check local database for tablespace capacity in ORACLE_SID ---> Requires Oracle user/password specified. ---> Requires select on dba_data_files and dba_free_space--oranames Hostname Check remote Oracle Names server--help Print this help screen--version Print version and license information

If the plugin doesn't work, check that the ORACLE_HOME environmentvariable is set, that ORACLE_HOME/bin is in your PATH, and thetnsnames.ora file is locatable and is properly configured.

When checking local database status your ORACLE_SID is case sensitive.

If you want to use a default Oracle home, add in your oratab file:*:/opt/app/oracle/product/7.3.4:N

4

Page 42: Nagios Plug Ins

38. check_overcrUsage: check_overcr -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: 2000)-v, --variable=STRING Variable to check. Valid variables include: LOAD1 = 1 minute average CPU load LOAD5 = 5 minute average CPU load LOAD15 = 15 minute average CPU load DPU<filesys> = percent used disk space on filesystem <filesys> PROC<process> = number of running processes with name <process> NET<port> = number of active connections on TCP port <port> UPTIME = system uptime in seconds -w, --warning=INTEGER Threshold which will result in a warning status -c, --critical=INTEGER Threshold which will result in a critical status -t, --timeout=INTEGER Seconds before connection times out (default: 10)Notes: - For the available options, the critical threshold value should always be higher than the warning threshold value, EXCEPT with the uptime variable

- This plugin requres that Eric Molitors' Over-CR collector daemon be running on the remote server. Over-CR can be downloaded from http://www.molitor.org/overcr (This plugin was tested with version 0.99.53 of the Over-CR collector)

4

Page 43: Nagios Plug Ins

39. Check_pgsqlTest whether a PostgreSQL Database is accepting connections.

Usage:check_pgsql [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>] [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -P, --port=INTEGER Port number (default: 5432) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -d, --database=STRING Database to check (default: template1) -l, --logname = STRING Login name of user -p, --password = STRING Password (BIG SECURITY ISSUE) -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

All parameters are optional. This plugin tests a PostgreSQL DBMS to determine whether it is active and accepting queries. In its current operation, it simply connects to the specified database, and then disconnects. If no database is specified, it connects to the template1 database, which is present in every functioning PostgreSQL DBMS.

The plugin will connect to a local postmaster if no host is specified. To connect to a remote host, be sure that the remote postmaster accepts TCP/IP connections (start the postmaster with the -i option).

Typically, the nagios user (unless the --logname option is used) should be able to connect to the database without a password. The plugin can also send a password, but no effort is made to obsure or encrypt the password.

4

Page 44: Nagios Plug Ins

40. check_pingUse ping to check connection statistics for a remote host.Usage: check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>% [-p packets] [-t timeout] [-L] [-4|-6]Options: -h, --help Print detailed help screen -V, --version Print version information -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection-H, --hostname=HOST host to ping-w, --warning=THRESHOLD warning threshold pair-c, --critical=THRESHOLD critical threshold pair-p, --packets=INTEGER number of ICMP ECHO packets to send (Default: 5)-L, --link show HTML in the plugin output (obsoleted by urlize) -t, --timeout=INTEGER Seconds before connection times out (default: 10)THRESHOLD is <rta>,<pl>% where <rta> is the round trip average traveltime (ms) which triggers a WARNING or CRITICAL state, and <pl> is thepercentage of packet loss to trigger an alarm state.This plugin uses the ping command to probe the specified host for packet loss(percentage) and round trip average (milliseconds). It can produce HTML outputlinking to a traceroute CGI contributed by Ian Cass. The CGI can be found inthe contrib area of the downloads section at http://www.nagios.org

4

Page 45: Nagios Plug Ins

41. check_popThis plugin tests POP connections with the specified host (or unix socket).

Usage: check_POP -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

4

Page 46: Nagios Plug Ins

42. check_procsChecks all processes and generates WARNING or CRITICAL states if the specifiedmetric is outside the required threshold ranges. The metric defaults to numberof processes. Search filters can be applied to limit the processes to check.

Usage: check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid] [-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array] [-C command] [-t timeout] [-v]

Required Arguments: -w, --warning=RANGE Generate warning state if metric is outside this range -c, --critical=RANGE Generate critical state if metric is outside this range

Optional Arguments: -m, --metric=TYPE Check thresholds against metric. Valid types: PROCS - number of processes (default) VSZ - virtual memory size RSS - resident set memory size CPU - percentage cpu ELAPSED - time elapsed in seconds -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Extra information. Up to 3 verbosity levels

Optional Filters: -s, --state=STATUSFLAGS Only scan for processes that have, in the output of `ps`, one or more of the status flags you specify (for example R, Z, S, RS, RSZDT, plus others based on the output of your 'ps' command). -p, --ppid=PPID Only scan for children of the parent process ID indicated. -z, --vsz=VSZ Only scan for processes with vsz higher than indicated. -r, --rss=RSS Only scan for processes with rss higher than indicated. -P, --pcpu=PCPU Only scan for processes with pcpu higher than indicated. -u, --user=USER Only scan for processes with user name or ID indicated. -a, --argument-array=STRING Only scan for processes with args that contain STRING. -C, --command=COMMAND Only scan for exact matches of COMMAND (without path).

RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). Ifspecified 'max:min', a warning status will be generated if thecount is inside the specified range

This plugin checks the number of currently running processes andgenerates WARNING or CRITICAL states if the process count is outsidethe specified threshold ranges. The process count can be filtered byprocess owner, parent process PID, current state (e.g., 'Z'), or maybe the total number of running processes

Examples: check_procs -w 2:2 -c 2:1024 -C portsentry

4

Page 47: Nagios Plug Ins

Warning if not two processes with command name portsentry. Critical if < 2 or > 1024 processes

check_procs -w 10 -a '/usr/local/bin/perl' -u root Warning alert if > 10 processes with command arguments containing '/usr/local/bin/perl' and owned by root

check_procs -w 50000 -c 100000 --metric=VSZ Alert if vsz of any processes over 50K or 100K check_procs -w 10 -c 20 --metric=CPU Alert if cpu of any processes over 10% or 20%

4

Page 48: Nagios Plug Ins

43. check_realThis plugin tests the REAL service on the specified host.

Usage: check_real -H host [-e expect] [-p port] [-w warn] [-c crit] [-t timeout] [-v]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: 554) -u, --url=STRING Connect to this url -e, --expect=STRING String to expect in first line of server response (default: RTSP/1.) -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)This plugin will attempt to open an RTSP connection with the host.Successul connects return STATE_OK, refusals and timeouts returnSTATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,but incorrect reponse messages from the host result in STATE_WARNING returnvalues.

4

Page 49: Nagios Plug Ins

44. check_rpcCheck if a rpc service is registered and running using rpcinfo -H host -C rpc_command

Usage: check_rpc -H host -C rpc_command [-p port] [-c program_version] [-u|-t] [-v] check_rpc [-h | --help] check_rpc [-V | --version]

<host> The server providing the rpc service <rpc_command> The program name (or number). <program_version> The version you want to check for (one or more) Should prevent checks of unknown versions being syslogged e.g. 2,3,6 to check v2, v3, and v6 [-u | -t] Test UDP or TCP [-v] Verbose [-v -v] Verbose - will print supported programs and numbers

4

Page 50: Nagios Plug Ins

45. check_sensors

Usage: check_sensors

This plugin checks hardware status using the lm_sensors package.

5

Page 51: Nagios Plug Ins

46. Check_simapThis plugin tests SIMAP connections with the specified host (or unix socket).

Usage: check_SIMAP -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

5

Page 52: Nagios Plug Ins

47. check_smtpCheck status of remote machines and obtain sustem information via SNMP

Usage: check_snmp -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] [-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries] [-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter] [-m miblist] [-P snmp version] [-L seclevel] [-U secname] [-a authproto] [-A authpasswd] [-X privpasswd]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: 161) -n, --next Use SNMP GETNEXT instead of SNMP GET -P, --protocol=[1|2c|3] SNMP protocol version -L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv] SNMPv3 securityLevel -a, --authproto=[MD5|SHA] SNMPv3 auth proto -C, --community=STRING Optional community string for SNMP communication (default is "public") -U, --secname=USERNAME SNMPv3 username -A, --authpassword=PASSWORD SNMPv3 authentication password -X, --privpasswd=PASSWORD SNMPv3 crypt passwd (DES) -o, --oid=OID(s) Object identifier(s) or SNMP variables whose value you wish to query -m, --miblist=STRING List of MIBS to be loaded (default = none if using numeric oids or 'ALL' for symbolic oids.) -d, --delimiter=STRING Delimiter to use when parsing returned data. Default is "=" Any data on the right hand side of the delimiter is considered to be the data that should be used in the evaluation. -w, --warning=INTEGER_RANGE(s) Range(s) which will not result in a WARNING status -c, --critical=INTEGER_RANGE(s) Range(s) which will not result in a CRITICAL status -s, --string=STRING Return OK state (for that OID) if STRING is an exact match -r, --ereg=REGEX Return OK state (for that OID) if extended regular expression REGEX matches -R, --eregi=REGEX Return OK state (for that OID) if case-insensitive extended REGEX matches -l, --label=STRING Prefix label for output from plugin (default -s 'SNMP')

5

Page 53: Nagios Plug Ins

-u, --units=STRING Units label(s) for output data (e.g., 'sec.'). -D, --output-delimiter=STRING Separates output on multiple OID requests -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

- This plugin uses the 'snmpget' command included with the NET-SNMP package. If you don't have the package installed, you will need to download it from http://net-snmp.sourceforge.net before you can use this plugin.- Multiple OIDs may be indicated by a comma- or space-delimited list (lists with internal spaces must be quoted) [max 8 OIDs]- Ranges are inclusive and are indicated with colons. When specified as 'min:max' a STATE_OK will be returned if the result is within the indicated range or is equal to the upper or lower bound. A non-OK state will be returned if the result is outside the specified range.- If specified in the order 'max:min' a non-OK state will be returned if the result is within the (inclusive) range.- Upper or lower bounds may be omitted to skip checking the respective limit.- Bare integers are interpreted as upper limits.- When checking multiple OIDs, separate ranges by commas like '-w 1:10,1:,:20'- Note that only one string and one regex may be checked at present- All evaluation methods other than PR, STR, and SUBSTR expect that the value returned from the SNMP query is an unsigned integer.

5

Page 54: Nagios Plug Ins

48. check_snmpCheck status of remote machines and obtain sustem information via SNMP

Usage: check_snmp -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] [-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries] [-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter] [-m miblist] [-P snmp version] [-L seclevel] [-U secname] [-a authproto] [-A authpasswd] [-X privpasswd]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: 161) -n, --next Use SNMP GETNEXT instead of SNMP GET -P, --protocol=[1|2c|3] SNMP protocol version -L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv] SNMPv3 securityLevel -a, --authproto=[MD5|SHA] SNMPv3 auth proto -C, --community=STRING Optional community string for SNMP communication (default is "public") -U, --secname=USERNAME SNMPv3 username -A, --authpassword=PASSWORD SNMPv3 authentication password -X, --privpasswd=PASSWORD SNMPv3 crypt passwd (DES) -o, --oid=OID(s) Object identifier(s) or SNMP variables whose value you wish to query -m, --miblist=STRING List of MIBS to be loaded (default = none if using numeric oids or 'ALL' for symbolic oids.) -d, --delimiter=STRING Delimiter to use when parsing returned data. Default is "=" Any data on the right hand side of the delimiter is considered to be the data that should be used in the evaluation. -w, --warning=INTEGER_RANGE(s) Range(s) which will not result in a WARNING status -c, --critical=INTEGER_RANGE(s) Range(s) which will not result in a CRITICAL status -s, --string=STRING Return OK state (for that OID) if STRING is an exact match -r, --ereg=REGEX Return OK state (for that OID) if extended regular expression REGEX matches -R, --eregi=REGEX Return OK state (for that OID) if case-insensitive extended REGEX matches -l, --label=STRING Prefix label for output from plugin (default -s 'SNMP')

5

Page 55: Nagios Plug Ins

-u, --units=STRING Units label(s) for output data (e.g., 'sec.'). -D, --output-delimiter=STRING Separates output on multiple OID requests -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

- This plugin uses the 'snmpget' command included with the NET-SNMP package. If you don't have the package installed, you will need to download it from http://net-snmp.sourceforge.net before you can use this plugin.- Multiple OIDs may be indicated by a comma- or space-delimited list (lists with internal spaces must be quoted) [max 8 OIDs]- Ranges are inclusive and are indicated with colons. When specified as 'min:max' a STATE_OK will be returned if the result is within the indicated range or is equal to the upper or lower bound. A non-OK state will be returned if the result is outside the specified range.- If specified in the order 'max:min' a non-OK state will be returned if the result is within the (inclusive) range.- Upper or lower bounds may be omitted to skip checking the respective limit.- Bare integers are interpreted as upper limits.- When checking multiple OIDs, separate ranges by commas like '-w 1:10,1:,:20'- Note that only one string and one regex may be checked at present- All evaluation methods other than PR, STR, and SUBSTR expect that the value returned from the SNMP query is an unsigned integer.

5

Page 56: Nagios Plug Ins

49. check_snmp_boostedge.plSNMP Boostedge service monitor for Nagios version 1.0(c)2004-2006 Patrick Proy

Usage: ./check_snmp_boostedge.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) -s <service> -n <number> [-p <port>] [-f] [-t <timeout>] [-V]-v, --verbose print extra debugging information-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies v1 protocol)-s, --service=<service> Regexp of service to select-n, --number=<number> Number of services selected that must be in running & enabled state-2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-P, --port=PORT SNMP port (Default 161)-f, --perfparse Perfparse compatible output-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version number

5

Page 57: Nagios Plug Ins

50. check_snmp_cpfw.plSNMP Checkpoint FW-1 Monitor for Nagios version 1.0(c)2004 - to my cat Ratoune

Usage: ./check_snmp_cpfw.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-s] [-w [-p=pol_name] [-c=warn,crit]] [-m] [-a] [-f] [-p <port>] [-t <timeout>] [-V]-v, --verbose print extra debugging information (including interface list on the system)-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies v1 protocol)2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-s, --svn check for svn status-w, --fw check for fw status-a, --ha check for ha status-m, --mgmt check for management status-p, --policy=POLICY_NAME check if installed policy is POLICY_NAME (must have -w)-c, --connexions=WARN,CRIT check warn and critical number of connexions (must have -w)-f, --perfparse perfparse output (only works with -c)-P, --port=PORT SNMP port (Default 161)-t, --timeout=INTEGER timeout for SNMP (Default: Nagios default)-V, --version prints version number

5

Page 58: Nagios Plug Ins

51. check_snmp_css.plSNMP Cisco CSS monitor for Nagios version 1.0(c)2004-2006 Patrick Proy

Usage: ./check_snmp_css.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) -n <name> [-w <num>,<resp>,<conn> -c <num>,<resp>,<conn>] [-p <port>] [-f] [-t <timeout>] [-V]-v, --verbose print extra debugging information-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-n, --name=<name> regexp to select service-w, --warning=<num>,<resp>,<conn> Optional. Warning level for - minimum number of active & alive service - average response time - number of connexions Put 0 for no warnings.-c, --critical=<num>,resp>,<conn> Optional. Critical levels (0 for no critical levels) See warning levels.-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies v1 protocol)-2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-P, --port=PORT SNMP port (Default 161)-f, --perfparse Perfparse compatible output-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version number

5

Page 59: Nagios Plug Ins

52. check_snmp_env.plSNMP environemental Monitor for Nagios version 1.0(c)2004-2006 Patrick Proy

Usage: ./check_snmp_env.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -T (cisco|nokia|lp) [-f] [-t <timeout>] [-V]-v, --verbose print extra debugging information-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies v1 protocol)-2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-P, --port=PORT SNMP port (Default 161)-T, --type=cisco|nokia|bc Environemental check : cisco : voltage,temp,fan,power supply status will try to check everything present nokia : fan and power supply bc : fans, power supply, voltage, disks-f, --perfparse Perfparse compatible output-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version number

5

Page 60: Nagios Plug Ins

53. check_snmp_int.plSNMP Network Interface Monitor for Nagios version 1.4.1(c)2004-2006 to my cat Ratoune - Author : Patrick Proy

Usage: ./check_snmp_int.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>) [-p <port>] -n <name in desc_oid> [-i] [-a] [-r] [-f[e]] [-k[qB] -w<warn levels> -c<crit levels> -d<delta>] [-t <timeout>] [-s] [-V]-v, --verbose print extra debugging information (including interface list on the system)-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies v1 protocol)-l, --login=LOGIN ; -x, --passwd=PASSWD, -2, --v2c Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv -2 : use snmp v2c-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-P, --port=PORT SNMP port (Default 161)-n, --name=NAME Name in description OID (eth0, ppp0 ...). This is treated as a regexp : -n eth will match eth0,eth1,... Test it before, because there are known bugs (ex : trailling /)-i, --inverse Make critical when up-a, --admin Use administrative status instead of operational-f, --perfparse Perfparse compatible output (no output when interface is down).-e, --error Add error & discard to Perfparse output-r, --noregexp Do not use regexp to match NAME in description OID-k, --perfcheck ; -q, --extperfcheck -k check the input/ouput bandwidth of the interface -q also check the error and discard input/output-d, --delta=seconds make an average of <delta> seconds (default 300=5min)-B, --kbits Make the warning and critical levels in KBits/s instead of KBytes/s-w, --warning=input,output[,error in,error out,discard in,discard out] warning level for input / output bandwidth in KBytes/s (0 for no warning) warning for error & discard input / output in error/min (need -q)-c, --critical=input,output[,error in,error out,discard in,discard out] critical level for input / output bandwidth in KBytes/s (0 for no critical) critical for error & discard input / output in error/min (need -q)-s, --short=int Make the output shorter : only the first <n> chars of the interface(s) If the number is negative, then get the <n> LAST caracters.-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)

6

Page 61: Nagios Plug Ins

-V, --version prints version numberNote : when multiple interface are selected with regexp, all be must be up (or down with -i) to get an OK result.

6

Page 62: Nagios Plug Ins

54. check_snmp_linkproof_nhr.plSNMP Radware Linkproof NHR monitor for Nagios version 1.0(c)2004-2006 Patrick Proy

Usage: ./check_snmp_linkproof_nhr.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-f] [-t <timeout>] [-V]The plugin will test all nhr configured and will returnOK if all nhr are activeWARNING if one nhr at least is in "no new session" or "inactive" mode.CRITICAL if all nhr are inactive.-v, --verbose print extra debugging information-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies v1 protocol)-2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-P, --port=PORT SNMP port (Default 161)-f, --perfparse Perfparse compatible output-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version number

6

Page 63: Nagios Plug Ins

55. check_snmp_load.plSNMP Load & CPU Monitor for Nagios version 1.3(c)2004-2006 to my cat Ratoune - Author : Patrick Proy

Usage: ./check_snmp_load.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -w <warn level> -c <crit level> -T=[stand|netsl|netsc|as400|cisco|cata|nsc|fg|bc|nokia|hp|lp] [-f] [-t <timeout>] [-V]-v, --verbose print extra debugging information-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies v1 protocol)-2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-P, --port=PORT SNMP port (Default 161)-w, --warn=INTEGER | INT,INT,INT 1 value check : warning level for cpu in percent (on one minute) 3 value check : comma separated level for load or cpu for 1min, 5min, 15min-c, --crit=INTEGER | INT,INT,INT critical level for cpu in percent (on one minute) 1 value check : critical level for cpu in percent (on one minute) 3 value check : comma separated level for load or cpu for 1min, 5min, 15min-T, --type=stand|netsl|netsc|as400|cisco|bc|nokia|hp|lp CPU check : stand : standard MIBII (works with Windows), can handle multiple CPU. netsl : linux load provided by Net SNMP netsc : cpu usage given by net-snmp (100-idle) as400 : as400 CPU usage cisco : Cisco CPU usage cata : Cisco catalyst CPU usage nsc : NetScreen CPU usage fg : Fortigate CPU usage bc : Bluecoat CPU usage nokia : Nokia CPU usage hp : HP procurve switch CPU usage lp : Linkproof CPU usage-f, --perfparse Perfparse compatible output-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version number

6

Page 64: Nagios Plug Ins

56. check_snmp_mem.plSNMP Memory Monitor for Nagios version 1.1(c)2004-2006 to my cat Ratoune - Author: Patrick Proy

Usage: ./check_snmp_mem.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -w <warn level> -c <crit level> [-I|-N|-E] [-f] [-m] [-t <timeout>] [-V]-v, --verbose print extra debugging information (including interface list on the system)-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies SNMP v1 or v2c with option)-2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-P, --port=PORT SNMP port (Default 161)-w, --warn=INTEGER | INT,INT warning level for memory in percent (0 for no checks) Default (-N switch) : comma separated level for Real Memory and Swap -I switch : warning level-c, --crit=INTEGER | INT,INT critical level for memory in percent (0 for no checks) Default (-N switch) : comma separated level for Real Memory and Swap -I switch : critical level-N, --netsnmp (default) check linux memory & swap provided by Net SNMP-m, --memcache include cached memory in used memory (only with Net-SNMP)-I, --cisco check cisco memory (sum of all memory pools)-E, --hp check HP proccurve memory-f, --perfdata Performance data output-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --versionprints version number

6

Page 65: Nagios Plug Ins

57. check_snmp_process.plSNMP Process Monitor for Nagios version 1.3.1GPL licence, (c)2004-2006 Patrick Proy

Usage: ./check_snmp_process.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) [-p <port>] -n <name> [-w <min_proc>[,<max_proc>] -c <min_proc>[,max_proc] ] [-m<warn Mb>,<crit Mb> -a -u<warn %>,<crit%> ] [-t <timeout>] [-f ] [-r] [-V] [-g]-v, --verbose print extra debugging information (and lists all storages)-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies SNMP v1 or v2c with option)-2, --v2c Use snmp v2c-l, --login=LOGIN Login for snmpv3 authentication (implies v3 protocol with MD5)-x, --passwd=PASSWD Password for snmpv3 authentication-p, --port=PORT SNMP port (Default 161)-n, --name=NAME Name of the process (regexp) No trailing slash !-r, --noregexp Do not use regexp to match NAME in description OID-f, --fullpath Use full path name instead of process name (Windows doesn't provide full path name)-w, --warn=MIN[,MAX] Number of process that will cause a warning -1 for no warning, MAX must be >0. Ex : -w-1,50-c, --critical=MIN[,MAX] number of process that will cause an error ( -1 for no critical, MAX must be >0. Ex : -c-1,50Notes on warning and critical : with the following options : -w m1,x1 -c m2,x2 you must have : m2 <= m1 < x1 <= x2 you can omit x1 or x2 or both-m, --memory=WARN,CRIT checks memory usage (default max of all process) values are warning and critical values in Mb-a, --average makes an average of memory used by process instead of max-u, --cpu=WARN,CRIT checks cpu usage of all process values are warning and critical values in % of CPU usage if more than one CPU, value can be > 100% : 100%=1 CPU-g, --getall In some cases, it is necessary to get all data at once because process die very frequently. This option eats bandwidth an cpu (for remote host) at breakfast.-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version number

6

Page 66: Nagios Plug Ins

Note : CPU usage is in % of one cpu, so maximum can be 100% * number of CPU example : Browse process list : <script> -C <community> -H <host> -n <anything> -v the -n option allows regexp in perl format : All process of /opt/soft/bin : -n /opt/soft/bin/ -f All 'named' process : -n named

6

Page 67: Nagios Plug Ins

58. check_snmp_storage.plSNMP Disk Monitor for Nagios version 1.3(c)2004-2006 Patrick Proy

Usage: check_snmp_storage [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -m <name in desc_oid> [-q storagetype] -w <warn_level> -c <crit_level> [-t <timeout>] [-T pl|pu|bl|bu ] [-r] [-s] [-i] [-e] [-S 0|1[,1,<car>]]By default, plugin will monitor %used on drives :warn if %used > warn and critical if %used > crit-v, --verbose print extra debugging information (and lists all storages)-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies SNMP v1)2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-x, --passwd=PASSWD Password for snmpv3 authentication-p, --port=PORT SNMP port (Default 161)-m, --name=NAME Name in description OID (can be mounpoints '/home' or 'Swap Space'...) This is treated as a regexp : -m /var will match /var , /var/log, /opt/var ... Test it before, because there are known bugs (ex : trailling /) No trailing slash for mountpoints !-q, --storagetype=[Other|Ram|VirtualMemory|FixedDisk|RemovableDisk|FloppyDisk CompactDisk|RamDisk|FlashMemory|NetworkDisk] Also check the storage type in addition of the name It is possible to use regular expressions ( "FixedDisk|FloppyDisk" )-r, --noregexp Do not use regexp to match NAME in description OID-s, --sum Add all storages that match NAME (used space and total space) THEN make the tests.-i, --index Parse index table instead of description table to select storage-e, --exclude Select all storages except the one(s) selected by -m No action on storage type selection-T, --type=TYPE pl : calculate percent left pu : calculate percent used (Default) bl : calculate MegaBytes left bu : calculate MegaBytes used-w, --warn=INTEGER percent / MB of disk used to generate WARNING state you can add the % sign

6

Page 68: Nagios Plug Ins

-c, --critical=INTEGER percent / MB of disk used to generate CRITICAL state you can add the % sign-f, --perfparse Perfparse compatible output-S, --short=<type>[,<where>,<cut>] <type>: Make the output shorter : 0 : only print the global result except the disk in warning or critical ex: "< 80% : OK" 1 : Don't print all info for every disk ex : "/ : 66 %used (< 80) : OK" <where>: (optional) if = 1, put the OK/WARN/CRIT at the beginning <cut>: take the <n> first caracters or <n> last if n<0-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version numberNote : with T=pu or T=bu : OK < warn < crit with T=pl ot T=bl : crit < warn < OK

If multiple storage are selected, the worse condition will be returned i.e if one disk is critical, the return is critical

example : Browse storage list : <script> -C <community> -H <host> -m <anything> -w 1 -c 2 -v the -m option allows regexp in perl format : Test drive C,F,G,H,I on Windows : -m ^[CFGHI]: Test all mounts containing /var : -m /var Test all mounts under /var : -m ^/var Test only /var : -m /var -r Test all swap spaces : -m ^Swap Test all but swap spaces : -m ^Swap -e

6

Page 69: Nagios Plug Ins

59. check_snmp_vrrp.plSNMP VRRP Monitor for Nagios version 1.3(c)2004-2006 to my cat Ratoune - Author : Patrick Proy

Usage: ./check_snmp_vrrp.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) -s <master|backup|num,%> [-T <nokia|alteon|lp|nsc|ipsocluster>] [-p <port>] [-t <timeout>] [-V]-v, --verbose print extra debugging information (including interface list on the system)-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies v1 protocol)-2, --v2c Use snmp v2c-l, --login=LOGIN ; -x, --passwd=PASSWD Login and auth password for snmpv3 authentication If no priv password exists, implies AuthNoPriv-X, --privpass=PASSWD Priv password for snmpv3 (AuthPriv protocol)-L, --protocols=<authproto>,<privproto> <authproto> : Authentication protocol (md5|sha : default md5) <privproto> : Priv protocole (des|aes : default des)-P, --port=PORT SNMP port (Default 161)-T, --type=<nokia|alteon|lp|nsc|ipso> Type of vrrp router to check nokia (default) : Nokai vrrp. Should be working for most vrrp routers alteon : for Alteon AD4 Loadbalancers lp : Radware Linkproof nsc : Nescreen (ScreenOS 5.x NSRP) ipso : Nokia IPSO clustering-s, --state=master|backup|num,% Nokia ipso clustering : number of members, max % assigned to nodes. Other : check vrrp interface to be master or backup-g, --long Make output long even is all is OK-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version number

6

Page 70: Nagios Plug Ins

60. check_snmp_win.plSNMP Windows Monitor for Nagios version 0.5GPL licence, (c)2004-2005 Patrick Proy

Usage: check_snmp_win [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) [-p <port>] -n <name>[,<name2] [-T=service] [-r] [-s] [-N=<n>] [-t <timeout>] [-V]-v, --verbose print extra debugging information (and lists all services)-h, --help print this help message-H, --hostname=HOST name or IP address of host to check-C, --community=COMMUNITY NAME community name for the host's SNMP agent (implies SNMP v1 or v2c with option)-2, --v2c Use snmp v2c-l, --login=LOGIN Login for snmpv3 authentication (implies v3 protocol with MD5)-x, --passwd=PASSWD Password for snmpv3 authentication-p, --port=PORT SNMP port (Default 161)-T, --type=service Check type : - service (default) checks service-n, --name=NAME[,NAME2...] Comma separated names of services (perl regular expressions can be used for every one). By default, it is not case sensitive.-N, --number=<n> Compare matching services with <n> instead of the number of names provided.-s, --showall Show all services in the output, instead of only the non-active ones.-r, --noregexp Do not use regexp to match NAME in service description.-t, --timeout=INTEGER timeout for SNMP in seconds (Default: 5)-V, --version prints version numberNote : The script will return OK if ALL services are in active state, WARNING if there is more than specified (ex 2 service specified, 3 active services matching), CRITICAL if at least one of them is non active. The -n option will allows regexp in perl format -n "service" will match 'service WINS' 'sevice DNS' etc... It is not case sensitive by default : WINS = wins

7

Page 71: Nagios Plug Ins

61. check_spopThis plugin tests SPOP connections with the specified host (or unix socket).

Usage: check_SPOP -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

7

Page 72: Nagios Plug Ins

62. check_sshTry to connect to an SSH server at specified server and port

Usage: check_ssh [-46] [-t <timeout>] [-r <remote version>] [-p <port>] <host>

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: 22) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -t, --timeout=INTEGER Seconds before connection times out (default: 10) -r, --remote-version=STRING Warn if string doesn't match expected server version (ex: OpenSSH_3.9p1) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

7

Page 73: Nagios Plug Ins

63. check_ssmtpThis plugin tests SSMTP connections with the specified host (or unix socket).

Usage: check_SSMTP -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

7

Page 74: Nagios Plug Ins

64. check_swapCheck swap space on local machine.

Usage: check_swap [-av] -w <percent_free>% -c <percent_free>% check_swap [-av] -w <bytes_free> -c <bytes_free>

Options: -h, --help Print detailed help screen -V, --version Print version information

-w, --warning=INTEGER Exit with WARNING status if less than INTEGER bytes of swap space are free -w, --warning=PERCENT% Exit with WARNING status if less than PERCENT of swap space is free -c, --critical=INTEGER Exit with CRITICAL status if less than INTEGER bytes of swap space are free -c, --critical=PERCENT% Exit with CRITCAL status if less than PERCENT of swap space is free -a, --allswaps Conduct comparisons for all swap partitions, one by one -v, --verbose Verbose output. Up to 3 levels

On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s.

7

Page 75: Nagios Plug Ins

65. check_tcpThis plugin tests TCP connections with the specified host (or unix socket).

Usage: check_TCP -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

7

Page 76: Nagios Plug Ins

66. check_timeThis plugin will check the time on the specified host.

Usage: check_time -H <host_address> [-p port] [-u] [-w variance] [-c variance] [-W connect_time] [-C connect_time] [-t timeout]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: 37) -u, --udp Use UDP to connect, not TCP -w, --warning-variance=INTEGER Time difference (sec.) necessary to result in a warning status -c, --critical-variance=INTEGER Time difference (sec.) necessary to result in a critical status -W, --warning-connect=INTEGER Response time (sec.) necessary to result in warning status -C, --critical-connect=INTEGER Response time (sec.) necessary to result in critical status -t, --timeout=INTEGER Seconds before connection times out (default: 10)

7

Page 77: Nagios Plug Ins

67. check_udpThis plugin tests an UDP connection with the specified host.

Usage: check_udp -H <host_address> [-p port] [-w warn_time] [-c crit_time] [-e expect] [-s send] [-t to_sec] [-v]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -e, --expect=STRING <optional> String to expect in first line of server response -s, --send=STRING <optional> String to send to the server when initiating the connection -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)This plugin will attempt to connect to the specified port on the host.Successful connects return STATE_OK, refusals and timeouts returnSTATE_CRITICAL, other errors return STATE_UNKNOWN.

7

Page 78: Nagios Plug Ins

68. check_udp2 This plugin tests UDP2 connections with the specified host (or unix socket).

Usage: check_UDP2 -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>] [-e <expect string>] [-q <quit string>] [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>] [-S <use SSL>] [-E]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: none) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -E, --escape Can use \n, \r, \t or \ in send or quit string. Default: nothing added to send, \r\n added to end of quit -s, --send=STRING String to send to the server -e, --expect=STRING String to expect in server response -q, --quit=STRING String to send server to initiate a clean close of the connection -r, --refuse=ok|warn|crit Accept tcp refusals with states ok, warn, crit (default: crit) -M, --mismatch=ok|warn|crit Accept expected string mismatches with states ok, warn, crit (default: warn) -j, --jail Hide output from TCP socket -m, --maxbytes=INTEGER Close connection once more than this number of bytes are received -d, --delay=INTEGER Seconds to wait between sending string and polling for response -D, --certificate=INTEGER Minimum number of days a certificate has to be valid. -S, --ssl Use SSL for the connection. -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)

7

Page 79: Nagios Plug Ins

69. check_ups This plugin tests the UPS service on the specified host.Network UPS Tools from www.networkupstools.org must be running for thisplugin to work.

Usage: check_ups -H host -u ups [-p port] [-v variable] [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]

Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name, IP Address, or unix socket (must be an absolute path) -p, --port=INTEGER Port number (default: 3493) -u, --ups=STRING Name of UPS -T, --temperature Output of temperatures in Celsius -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output)This plugin attempts to determine the status of a UPS (Uninterruptible PowerSupply) on a local or remote host. If the UPS is online or calibrating, theplugin will return an OK state. If the battery is on it will return a WARNINGstate. If the UPS is off or has a low battery the plugin will return a CRITICALstate.

You may also specify a variable to check [such as temperature, utility voltage,battery load, etc.] as well as warning and critical thresholds for the value ofthat variable. If the remote host has multiple UPS that are being monitored youwill have to use the [ups] option to specify which UPS to check.

Notes:

This plugin requires that the UPSD daemon distributed with Russel Kroll'sSmart UPS Tools be installed on the remote host. If you do not have thepackage installed on your system, you can download it fromhttp://www.networkupstools.org

7

Page 80: Nagios Plug Ins

70. check_users This plugin checks the number of users currently logged in on the localsystem and generates an error if the number exceeds the thresholds specified.Usage: check_users -w <users> -c <users>

Options: -h, --help Print detailed help screen -V, --version Print version information -w, --warning=INTEGER Set WARNING status if more than INTEGER users are logged in -c, --critical=INTEGER Set CRITICAL status if more than INTEGER users are logged in

8

Page 81: Nagios Plug Ins

71. check_waveUsage: check_wave -H <host> [-w <warn>] [-c <crit>]

<warn> = Signal strength at which a warning message will be generated.<crit> = Signal strength at which a critical message will be generated.

8

Page 82: Nagios Plug Ins

72. negateNegates the status of a plugin (returns OK for CRITICAL, and vice-versa).

Usage: negate [-t timeout] <definition of wrapped plugin>

Options: -h, --help Print detailed help screen -V, --version Print version information -t, --timeout=INTEGER Seconds before connection times out (default: 9) [keep timeout than the plugin timeout to retain CRITICAL status] negate "/usr/local/nagios/libexec/check_ping -H host" Run check_ping and invert result. Must use full path to plugin negate "/usr/local/nagios/libexec/check_procs -a 'vi negate.c'" Use single quotes if you need to retain spacesThis plugin is a wrapper to take the output of another plugin and invert it.If the wrapped plugin returns STATE_OK, the wrapper will return STATE_CRITICAL.If the wrapped plugin returns STATE_CRITICAL, the wrapper will return STATE_OK.Otherwise, the output state of the wrapped plugin is unchanged.

8

Page 83: Nagios Plug Ins

73. urlizeThis plugin wraps the text output of another command (plugin) in HTML<A> tags, thus displaying the plugin output in as a clickable link inthe Nagios status screen. The return status is the same as the invokedplugin.

Usage: urlize <url> <plugin> <arg1> ... <argN>

Pay close attention to quoting to ensure that the shell passes the expecteddata to the plugin. For example, in:

urlize http://example.com/ check_http -H example.com -r 'two words'

the shell will remove the single quotes and urlize will see:

urlize http://example.com/ check_http -H example.com -r two words

You probably want:

urlize http://example.com/ "check_http -H example.com -r 'two words'"

8