############################################################################### # COMMAND CONFIGURATION # # $Id: command.cfg.in 973 2004-12-02 04:48:37Z mattkent $ # # SYNTAX: # command[<command_name>]=<command_line> # # <command_name> = A short name used to identify the command # <command_line> = The actual command line. The command line doesn't have to # be surrounded in quotes, but may contain quotes as needed within # the command line. Take care to use single quotes at the # outer edges of commands or you will have command line # expansion problems when the command is executed by the shell. # Any valid shell command can be used. Multiple commands can # be separated with semicolons, piping is allowed. The # command line can contain macros, but not are macros are valid # at all time (notifications, service checks, etc). See the # HTML documentaion for more informationon on using macros in # commands. # # Note: Service check, service notification, host check, host notification, # service event handler, and host event handler functions are all defined # here. # # Note: Use the convertcfg program in the contrib directory of the Nagios # distribution to convert this file into a object file format. # ############################################################################### # Service notification command - send email with problem summary #command[notify-by-email]=/bin/printf "$OUTPUT$" | /bin/mail -s '$SERVICESTATE$ alert for $HOSTALIAS$/$SERVICEDESC$' $CONTACTEMAIL$ # Service notification command - send email to alphanumeric pager # gateway The notify-by-epager command assumes that each contact has a # pager email gateway, and that the address has been entered into the # appropriate contact field instead of an actual pager number. # (i.e. 'pagejoe@nowhere.com' routes mail to Joe's alphanumeric pager) #command[notify-by-epager]=/bin/echo "$OUTPUT$" | /bin/mail -s '$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$' $CONTACTPAGER$ # Host notification commands (one for email, one for alphanumeric # pager with email gateway) #command[host-notify-by-email]=/bin/echo -e "***** Nagios *****\n\nHost "$HOSTALIAS$" is $HOSTSTATE$!\n\nDate/Time: $DATETIME$\n" | /bin/mail -s 'Host $HOSTNAME$ is $HOSTSTATE$!' $CONTACTEMAIL$ #command[host-notify-by-epager]=/bin/echo '$HOSTALIAS$ is $HOSTSTATE$!' | /bin/mail -s 'Host $HOSTNAME$ is $HOSTSTATE$!' $CONTACTPAGER$ ## Send notifications to a pager using modem with Qpage (www.qpage.com) command[notify-by-qpage]=/usr/bin/printf "Service: %s\nHost: %s\nAddress: %s\nState: %s\nInfo: %s\nDate: %s" '$SERVICEDESC$' '$HOSTNAME$' '$HOSTADDRESS$' '$SERVICESTATE$' '$OUTPUT$' '$DATETIME' | /usr/bin/qpage -l 0 -p $CONTACTPAGER$ command[host-notify-by-qpage]=/usr/bin/printf "Host: %s is %s\nInfo: %s\nDate: %s" '$HOSTALIAS$' '$HOSTSTATES$' '$OUTPUT$' '$DATETIME' | /usr/bin/qpage -l 0 -p $CONTACTPAGER$ ## Send notifications using SMSclient (www.smsclient.org) command[notify-by-smsclient]=/usr/bin/sms_client -q $CONTACTPAGER$ "$NOTIFICATIONTYPE$: $HOSTADDRESS$ $HOSTALIAS$: $SERVICEDESC$ is $SERVICESTATE$" command[host-notify-by-smsclient]=/usr/bin/sms_client -q $CONTACTPAGER$ "Host $HOSTALIAS$ is $HOSTSTATE$; $OUTPUT$; $DATETIME$" # These are some example service check commands. See the HTML # documentation on the plugins for examples of how to configure # command definitions. #command[check_tcp]=/usr/lib/nagios/plugins/check_tcp -H $HOSTADDRESS$ -p $ARG1$ #command[check_udp]=/usr/lib/nagios/plugins/check_udp -H $HOSTADDRESS$ -p $ARG1$ #command[check_ftp]=/usr/lib/nagios/plugins/check_ftp -H $HOSTADDRESS$ #command[check_pop]=/usr/lib/nagios/plugins/check_pop -H $HOSTADDRESS$ #command[check_smtp]=/usr/lib/nagios/plugins/check_smtp -H $HOSTADDRESS$ #command[check_nntp]=/usr/lib/nagios/plugins/check_nntp -H $HOSTADDRESS$ #command[check_telnet]=/usr/lib/nagios/plugins/check_tcp -H $HOSTADDRESS$ -p 23 command[check_users]=/usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$ command[check_ntp]=/usr/lib/nagios/plugins/check_ntp -H $HOSTADDRESS$ command[check_ntp_ntpq]=/usr/lib/nagios/plugins/check_ntp -H $HOSTADDRESS$ -j 10 -k 15 command[check_flexlm]=/usr/lib/nagios/plugins/check_flexlm -F $ARG1$ #command[check_hpjd]=/usr/lib/nagios/plugins/check_hpjd -H $HOSTADDRESS$ -C public command[check_mrtg]=/usr/lib/nagios/plugins/check_mrtg $ARG1$ 10 AVG $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ command[traffic_average]=/usr/lib/nagios/plugins/check_mrtgtraf $ARG1$ 10 AVG $ARG2$ $ARG3$ $ARG4$ $ARG5$ command[check_load]=/usr/lib/nagios/plugins/check_load $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 85% -c 95% -p $ARG1$ #command[check_dns]=/usr/lib/nagios/plugins/check_dns -H www.yahoo.com -s $HOSTADDRESS$ #command[check_http]=/usr/lib/nagios/plugins/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$ command[check_http2]=/usr/lib/nagios/plugins/check_http -H $ARG1$ -I $HOSTADDRESS$ -w $ARG2$ -c $ARG3$ command[check_pgsql]=/usr/lib/nagios/plugins/check_pgsql -H $HOSTADDRESS$ #command[check_ping]=/usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 10:20% -c 60:100% command[check_procs]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ command[check_procs_zombie]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s Z command[check_procs_httpd]=/usr/lib/nagios/plugins/check_procs -w 5:$ARG1$ -c 1:$ARG2$ -C httpd command[check_procs_vsz]=/usr/lib/nagios/plugins/check_procs -w 8096 -c 16182 -C httpd --metric VSZ command[check_ups]=/usr/lib/nagios/plugins/check_ups -H $HOSTADDRESS$ -u $ARG1$ # An example of using check_by_ssh as an active service check command[ssh_disk]=/usr/lib/nagios/plugins/check_by_ssh -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_disk -w 85% -c 95% -p $ARG1$' # # UCD_SNMP equivalents for some of the commands above # command[snmp_load]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1.5.2,.1.3.6.1.4.1.2021.10.1.5.3 -w :$ARG2$,:$ARG3$,:$ARG4$ -w :$ARG5$,:$ARG6$,:$ARG7$ -l load command[snmp_cpustats]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0,.1.3.6.1.4.1.2021.11.11.0 -l 'CPU usage (user system idle)' -u '%' command[snmp_procname]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.4.1.2021.2.1.5.$ARG2$ -w $ARG3$:$ARG4$ -c $ARG5$:$ARG6$ command[snmp_disk]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.4.1.2021.9.1.7.$ARG1$,1.3.6.1.4.1.2021.9.1.9.$ARG1$ -w $ARG2$:,:$ARG3$ -c $ARG4$:,:$ARG5$ -u 'kB free (','% used)' -l 'disk space' command[snmp_mem]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.2021.4.6.0,.1.3.6.1.4.1.2021.4.5.0 -w $ARG2$: -c $ARG3$: command[snmp_swap]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.2021.4.4.0,.1.3.6.1.4.1.2021.4.3.0 -w $ARG2$: -c $ARG3$: # # Slightly more generic SNMP OIDs # note: using partial textual OIDs here - use numeric oids if you don't have MIBDIRS defined per Net-SNMP (net-snmp.org) command[snmp_procs]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrSystem.hrSystemProcesses -w :$ARG2$ -c :$ARG3$ -l processes command[snmp_users]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrSystem.hrSystemNumUsers -w :$ARG2$ -c :$ARG3$ -l users command[snmp_mem2]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.101,host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.101 -w $ARG2$ -c $ARG3$ command[snmp_swap2]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.102,host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.102 -w $ARG2$ -c $ARG3$ command[snmp_mem3]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.101,host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.101 -w $ARG2$ -c $ARG3$ command[snmp_swap3]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.102,host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.102 -w $ARG2$ -c $ARG3$ command[snmp_disk2]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.$ARG2$ -w $ARG3$ -c $ARG4$ command[snmp_tcpopen]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o tcp.tcpCurrEstab.0 -w $ARG2$ -c $ARG3$ command[snmp_tcpstats]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o tcp.tcpActiveOpens.0,tcp.tcpPassiveOpens.0,tcp.tcpInSegs.0,tcp.tcpOutSegs.0,tcp.tcpRetransSegs.0 -l 'TCP stats' # Some snmp based network device checks (requires Net::SNMP perl module) # check all admin-up interfaces command[check_ifstatus]=/usr/lib/nagios/plugins/check_ifstatus -H $HOSTADDRESS$ -C public # check particular interface by snmp ifIndex key command[check_ifoperstatus_ifindex]=/usr/lib/nagios/plugins/check_ifoperstatus -H $HOSTADDRESS$ -C public -k $ARG1$ # check particular interface by snmp ifDescr value (verify uniqueness before using) command[check_ifoperstatus_ifdescr]=/usr/lib/nagios/plugins/check_ifoperstatus -H $HOSTADDRESS$ -C public -d $ARG1$ # verify all you BGP session on a device are running (only returns warning due to some hardcoded option - to be fixed soon) command[check_snmp_bgpstate]=/usr/lib/nagios/plugins/check_bgpstate -H $HOSTADDRESS$ -C public # # SNMP NetApp checks (Jason Truong) # # command[check_netapp_uptime]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.2.1.1.3.0 --delimiter=')' -l "Uptime is" # command[check_netapp_cpuload]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.4.1.789.1.2.1.3.0 -w 90 -c 95 -u '%' -l "CPU LOAD " # command[check_netapp_numdisks]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.4.1.789.1.6.4.1.0,.1.3.6.1.4.1.789.1.6.4.2.0,.1.3.6.1.4.1.789.1.6.4.8.0,.1.3.6.1.4.1.789.1.6.4.7.0 -u 'Total Disks','Active','Spare','Failed' -l "" # # # SNMP Compaq Insight Agent (oids courtesy of vol) # # the following 4 return the following codes: other=1, ok=2, degraded=3, failed=4 # command[check_compaq_thermalCondition]=/usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.4.1.232.6.2.1.0,.1.3.6.1.4.1.232.6.2.2.0,.1.3.6.1.4.1.232.6.2.3.0,.1.3.6.1.4.1.232.6.2.4.0 -u 'ThermalCondition','ThermalTemp','ThermalSystem','ThermalCPUFan' -w 2:2,2:2,2:2,2:2 -c 1:2,1:2,1:2,1:2 -l "Thermal status " # # # This command checks to see if a host is "alive" by pinging it. The # check must result in a 100% packet loss or 5 second (5000ms) round # trip average to produce an error. # This command checks to see if a host is "alive" by pinging it. #command[check-host-alive]=/usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1 # This command checks to see if a printer is "alive" by pinging it. command[check-printer-alive]=/usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1 # This command checks to see if a switch is "alive" by pinging it. command[check-switch-alive]=/usr/lib/nagios/plugins/check_ping $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1 # This command checks to see if a router is "alive" by pinging it. command[check-router-alive]=/usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1 # Check if a host is alive by doing a fast ping instead of a regular ping command[check-fast-alive]=/usr/lib/nagios/plugins/check_fping -H $HOSTADDRESS$ # Check if the IMAP service is alive (default port=143) command[check-imap]=/usr/lib/nagios/plugins/check_imap -H $HOSTADDRESS$ # Check RPC services command[check-rpc]=/usr/lib/nagios/plugins/check_rpc -H $HOSTADDRESS$ -C $ARG1$ # Check if the NFS server is running (version 2 and version 3) command[check-nfs]=/usr/lib/nagios/plugins/check_rpc -H $HOSTADDRESS$ -C nfs -c2,3 # Check game servers command[check_quake]=/usr/lib/nagios/plugins/check_game qs $HOSTADDRESS$ command[check_unreal]=/usr/lib/nagios/plugins/check_game uns $HOSTADDRESS$ -p $ARG1$ -pf 8 # Check a port that should be open command[check_nmap]=/usr/lib/nagios/plugins/check_nmap -H $HOSTADDRESS$ -t 30 -p $ARG1$ # Check a port that should be open and another that *could* be open, # but no warning is given if optional port is closed. command[check_nmap_optional]=/usr/lib/nagios/plugins/check_nmap -H $HOSTADDRESS$ -t 60 -p $ARG1$ -o $ARG2$ # Specify range to nmap command[check_nmap_range]=/usr/lib/nagios/plugins/check_nmap -H $HOSTADDRESS$ -t 60 -p $ARG1$ -r $ARG2$ # Specify both optional and range command[check_nmap_opt_range]=/usr/lib/nagios/plugins/check_nmap -H $HOSTADDRESS$ -t 60 -p $ARG1$ -o $ARG2$ -r$ARG3$ # Check Radius command[check_radius]=/usr/lib/nagios/plugins/check_radius $ARG1$ $ARG2$ $HOSTADDRESS$ 1812 $ARG3$ # Check HTTP proxy # This is a command for checking squid or other proxy servers which uses check # http to ensure an HTTP 200 comes back ..... i.e. squid actually # serves the page and not an error message. # Using check_http will allow verification of authenticated proxies # # Note:: This used to call "check_reply" which was pretty close to check_tcp # The functionality of check_reply has been merged into check_tcp command[check_squid]=/usr/lib/nagios/plugins/check_http -H $HOSTADDRESS$ -p $ARG1$ -u $ARG2$ -e 'HTTP/1.0 200 OK' ## Check RealAudio url command[check_real_url]=/usr/lib/nagios/plugins/check_real $HOSTADDRESS$ -p $ARG1$ -wt $ARG2$ -ct $ARG3$ -to 5 -u $ARG4$ ## Check RealAudio server response command[check_real]=/usr/lib/nagios/plugins/check_real $HOSTADDRESS$ -p $ARG1$ -wt $ARG2$ -ct $ARG3$ -to 5 # NetWare checks via check_nwstat ( see "check_nwstat -h" for more options) # how many current logins command[check_netware_logins]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v "LOGINS" -w $ARG1$ -c $ARG2$ # how many current connections command[check_nwstat_conns]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v CONNS -w $ARG1$ -c $ARG2$ # 1 minute avg cpu load command[check_netware_1load]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v "LOAD1" -w 70 -c 90 # 5 minute avg cpu load command[check_netware_5load]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v "LOAD5" -w 70 -c 90 # 15 minute avg cpu load command[check_netware_15load]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v "LOAD15" -w 70 -c 90 # Disk volume (% free) command[check_nwstat_vol_p]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v VPF$ARG1$ -w $ARG2$ -c $ARG3$ # Disk volume (KB free) command[check_nwstat_vol_k]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v VKF$ARG1$ -w $ARG2$ -c $ARG3$ # % Long term cache hits command[check_nwstat_ltch]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v LTCH -w $ARG1$ -c $ARG2$ # % (of max) used packet receive buffers command[check_nwstat_puprb]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v PUPRB -w $ARG1$ -c $ARG2$ # Check to see if the DS database is open command[check_nwstat_dsdb]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v DSDB # Netware 5 abends command[check_netware_abend]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v "ABENDS" -w 10 -c 30 # Netware 5 number of current service procs command[check_nwstat_csprocs]=/usr/lib/nagios/plugins/check_nwstat -H $HOSTADDRESS$ -v CSPROCS -w $ARG1$ -c $ARG2$ # Still have to write sample entries for the following: # # check_ldap # check_overcr