command.cfg.in 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. ###############################################################################
  2. # COMMAND CONFIGURATION
  3. #
  4. # SYNTAX:
  5. # command[<command_name>]=<command_line>
  6. #
  7. # <command_name> = A short name used to identify the command
  8. # <command_line> = The actual command line. The command line doesn't have to
  9. # be surrounded in quotes, but may contain quotes as needed within
  10. # the command line. Take care to use single quotes at the
  11. # outer edges of commands or you will have command line
  12. # expansion problems when the command is executed by the shell.
  13. # Any valid shell command can be used. Multiple commands can
  14. # be separated with semicolons, piping is allowed. The
  15. # command line can contain macros, but not are macros are valid
  16. # at all time (notifications, service checks, etc). See the
  17. # HTML documentaion for more informationon on using macros in
  18. # commands.
  19. #
  20. # Note: Service check, service notification, host check, host notification,
  21. # service event handler, and host event handler functions are all defined
  22. # here.
  23. #
  24. # Note: Use the convertcfg program in the contrib directory of the Nagios
  25. # distribution to convert this file into a object file format.
  26. #
  27. ###############################################################################
  28. # Service notification command - send email with problem summary
  29. command[notify-by-email]=/bin/printf "$OUTPUT$" | /bin/mail -s '$SERVICESTATE$ alert for $HOSTALIAS$/$SERVICEDESC$' $CONTACTEMAIL$
  30. # Service notification command - send email to alphanumeric pager
  31. # gateway The notify-by-epager command assumes that each contact has a
  32. # pager email gateway, and that the address has been entered into the
  33. # appropriate contact field instead of an actual pager number.
  34. # (i.e. 'pagejoe@nowhere.com' routes mail to Joe's alphanumeric pager)
  35. command[notify-by-epager]=/bin/echo "$OUTPUT$" | /bin/mail -s '$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$' $CONTACTPAGER$
  36. # Host notification commands (one for email, one for alphanumeric
  37. # pager with email gateway)
  38. 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$
  39. command[host-notify-by-epager]=/bin/echo '$HOSTALIAS$ is $HOSTSTATE$!' | /bin/mail -s 'Host $HOSTNAME$ is $HOSTSTATE$!' $CONTACTPAGER$
  40. ## Send notifications to a pager using modem with Qpage (www.qpage.com)
  41. 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/local/bin/qpage -l 0 -p $CONTACTPAGER$
  42. command[host-notify-by-qpage]=/usr/bin/printf "Host: %s is %s\nInfo: %s\nDate: %s" '$HOSTALIAS$' '$HOSTSTATES$' '$OUTPUT$' '$DATETIME' | /usr/local/bin/qpage -l 0 -p $CONTACTPAGER$
  43. ## Send notifications using SMSclient (www.smsclient.org)
  44. command[notify-by-smsclient]=/usr/bin/sms_client -q $CONTACTPAGER$ "$NOTIFICATIONTYPE$: $HOSTADDRESS$ $HOSTALIAS$: $SERVICEDESC$ is $SERVICESTATE$"
  45. command[host-notify-by-smsclient]=/usr/bin/sms_client -q $CONTACTPAGER$ "Host $HOSTALIAS$ is $HOSTSTATE$; $OUTPUT$; $DATETIME$"
  46. # These are some example service check commands. See the HTML
  47. # documentation on the plugins for examples of how to configure
  48. # command definitions.
  49. command[check_tcp]=@libexecdir@/check_tcp -H $HOSTADDRESS$ -p $ARG1$
  50. command[check_udp]=@libexecdir@/check_udp -H $HOSTADDRESS$ -p $ARG1$
  51. command[check_ftp]=@libexecdir@/check_ftp -H $HOSTADDRESS$
  52. command[check_pop]=@libexecdir@/check_pop -H $HOSTADDRESS$
  53. command[check_smtp]=@libexecdir@/check_smtp -H $HOSTADDRESS$
  54. command[check_nntp]=@libexecdir@/check_nntp -H $HOSTADDRESS$
  55. command[check_telnet]=@libexecdir@/check_tcp -H $HOSTADDRESS$ -p 23
  56. command[check_users]=@libexecdir@/check_users -w $ARG1$ -c $ARG2$
  57. command[check_ntp]=@libexecdir@/check_ntp -H $HOSTADDRESS$
  58. command[check_ntp_ntpq]=@libexecdir@/check_ntp -H $HOSTADDRESS$ -j 10 -k 15
  59. command[check_flexlm]=@libexecdir@/check_flexlm -F $ARG1$
  60. command[check_hpjd]=@libexecdir@/check_hpjd -H $HOSTADDRESS$ -C public
  61. command[check_mrtg]=@libexecdir@/check_mrtg $ARG1$ 10 AVG $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$
  62. command[traffic_average]=@libexecdir@/check_mrtgtraf $ARG1$ 10 AVG $ARG2$ $ARG3$ $ARG4$ $ARG5$
  63. command[check_load]=@libexecdir@/check_load $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$
  64. command[check_disk]=@libexecdir@/check_disk -w 85% -c 95% -p $ARG1$
  65. command[check_dns]=@libexecdir@/check_dns -H www.yahoo.com -s $HOSTADDRESS$
  66. command[check_http]=@libexecdir@/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$
  67. command[check_http2]=@libexecdir@/check_http -H $ARG1$ -I $HOSTADDRESS$ -w $ARG2$ -c $ARG3$
  68. command[check_pgsql]=@libexecdir@/check_pgsql -H $HOSTADDRESS$
  69. command[check_ping]=@libexecdir@/check_ping -H $HOSTADDRESS$ -w 10:20% -c 60:100%
  70. command[check_procs]=@libexecdir@/check_procs -w $ARG1$ -c $ARG2$
  71. command[check_procs_zombie]=@libexecdir@/check_procs -w $ARG1$ -c $ARG2$ -s Z
  72. command[check_procs_httpd]=@libexecdir@/check_procs -w 5:$ARG1$ -c 1:$ARG2$ -C httpd
  73. command[check_procs_vsz]=@libexecdir@/check_procs -w 8096 -c 16182 -C httpd --metric VSZ
  74. command[check_ups]=@libexecdir@/check_ups -H $HOSTADDRESS$ -u $ARG1$
  75. # An example of using check_by_ssh as an active service check
  76. command[ssh_disk]=@libexecdir@/check_by_ssh -H $HOSTADDRESS$ -C '@libexecdir@/check_disk -w 85% -c 95% -p $ARG1$'
  77. #
  78. # UCD_SNMP equivalents for some of the commands above
  79. #
  80. command[snmp_load]=@libexecdir@/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
  81. command[snmp_cpustats]=@libexecdir@/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 '%'
  82. command[snmp_procname]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o 1.3.6.1.4.1.2021.2.1.5.$ARG2$ -w $ARG3$:$ARG4$ -c $ARG5$:$ARG6$
  83. command[snmp_disk]=@libexecdir@/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'
  84. command[snmp_mem]=@libexecdir@/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$:
  85. command[snmp_swap]=@libexecdir@/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$:
  86. #
  87. # Slightly more generic SNMP OIDs
  88. # note: using partial textual OIDs here - use numeric oids if you don't have MIBDIRS defined per Net-SNMP (net-snmp.org)
  89. command[snmp_procs]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrSystem.hrSystemProcesses -w :$ARG2$ -c :$ARG3$ -l processes
  90. command[snmp_users]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrSystem.hrSystemNumUsers -w :$ARG2$ -c :$ARG3$ -l users
  91. command[snmp_mem2]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.101,host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.101 -w $ARG2$ -c $ARG3$
  92. command[snmp_swap2]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.102,host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.102 -w $ARG2$ -c $ARG3$
  93. command[snmp_mem3]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.101,host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.101 -w $ARG2$ -c $ARG3$
  94. command[snmp_swap3]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.102,host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.102 -w $ARG2$ -c $ARG3$
  95. command[snmp_disk2]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.$ARG2$ -w $ARG3$ -c $ARG4$
  96. command[snmp_tcpopen]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o tcp.tcpCurrEstab.0 -w $ARG2$ -c $ARG3$
  97. command[snmp_tcpstats]=@libexecdir@/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'
  98. # Some snmp based network device checks (requires Net::SNMP perl module)
  99. # check all admin-up interfaces
  100. command[check_ifstatus]=@libexecdir@/check_ifstatus -H $HOSTADDRESS$ -C public
  101. # check particular interface by snmp ifIndex key
  102. command[check_ifoperstatus_ifindex]=@libexecdir@/check_ifoperstatus -H $HOSTADDRESS$ -C public -k $ARG1$
  103. # check particular interface by snmp ifDescr value (verify uniqueness before using)
  104. command[check_ifoperstatus_ifdescr]=@libexecdir@/check_ifoperstatus -H $HOSTADDRESS$ -C public -d $ARG1$
  105. # verify all you BGP session on a device are running (only returns warning due to some hardcoded option - to be fixed soon)
  106. command[check_snmp_bgpstate]=@libexecdir@/check_bgpstate -H $HOSTADDRESS$ -C public
  107. #
  108. # SNMP NetApp checks (Jason Truong)
  109. #
  110. #
  111. #command[check_netapp_uptime]=@libexecdir@/check_snmp -H $HOSTADDRESS$ -C public -o .1.3.6.1.2.1.1.3.0 --delimiter=')' -l "Uptime is"
  112. #
  113. #command[check_netapp_cpuload]=@libexecdir@/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 "
  114. #
  115. #command[check_netapp_numdisks]=@libexecdir@/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 ""
  116. #
  117. #
  118. # SNMP Compaq Insight Agent (oids courtesy of vol)
  119. #
  120. # the following 4 return the following codes: other=1, ok=2, degraded=3, failed=4
  121. #
  122. #command[check_compaq_thermalCondition]=@libexec@/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 "
  123. #
  124. #
  125. # This command checks to see if a host is "alive" by pinging it. The
  126. # check must result in a 100% packet loss or 5 second (5000ms) round
  127. # trip average to produce an error.
  128. # This command checks to see if a host is "alive" by pinging it.
  129. command[check-host-alive]=@libexecdir@/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1
  130. # This command checks to see if a printer is "alive" by pinging it.
  131. command[check-printer-alive]=@libexecdir@/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1
  132. # This command checks to see if a switch is "alive" by pinging it.
  133. command[check-switch-alive]=@libexecdir@/check_ping $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1
  134. # This command checks to see if a router is "alive" by pinging it.
  135. command[check-router-alive]=@libexecdir@/check_ping -H $HOSTADDRESS$ -w 5000,100% -c 5000,100% -p 1
  136. # Check if a host is alive by doing a fast ping instead of a regular ping
  137. command[check-fast-alive]=@libexecdir@/check_fping -H $HOSTADDRESS$
  138. # Check if the IMAP service is alive (default port=143)
  139. command[check-imap]=@libexecdir@/check_imap -H $HOSTADDRESS$
  140. # Check RPC services
  141. command[check-rpc]=@libexecdir@/check_rpc -H $HOSTADDRESS$ -C $ARG1$
  142. # Check if the NFS server is running (version 2 and version 3)
  143. command[check-nfs]=@libexecdir@/check_rpc -H $HOSTADDRESS$ -C nfs -c2,3
  144. # Check game servers
  145. command[check_quake]=@libexecdir@/check_game qs $HOSTADDRESS$
  146. command[check_unreal]=@libexecdir@/check_game uns $HOSTADDRESS$ -p $ARG1$ -pf 8
  147. # Check a port that should be open
  148. command[check_nmap]=@libexecdir@/check_nmap -H $HOSTADDRESS$ -t 30 -p $ARG1$
  149. # Check a port that should be open and another that *could* be open,
  150. # but no warning is given if optional port is closed.
  151. command[check_nmap_optional]=@libexecdir@/check_nmap -H $HOSTADDRESS$ -t 60 -p $ARG1$ -o $ARG2$
  152. # Specify range to nmap
  153. command[check_nmap_range]=@libexecdir@/check_nmap -H $HOSTADDRESS$ -t 60 -p $ARG1$ -r $ARG2$
  154. # Specify both optional and range
  155. command[check_nmap_opt_range]=@libexecdir@/check_nmap -H $HOSTADDRESS$ -t 60 -p $ARG1$ -o $ARG2$ -r$ARG3$
  156. # Check Radius
  157. command[check_radius]=@libexecdir@/check_radius $ARG1$ $ARG2$ $HOSTADDRESS$ 1812 $ARG3$
  158. # Check HTTP proxy
  159. # This is a command for checking squid or other proxy servers which uses check
  160. # http to ensure an HTTP 200 comes back ..... i.e. squid actually
  161. # serves the page and not an error message.
  162. # Using check_http will allow verification of authenticated proxies
  163. #
  164. # Note:: This used to call "check_reply" which was pretty close to check_tcp
  165. # The functionality of check_reply has been merged into check_tcp
  166. command[check_squid]=@libexecdir@/check_http -H $HOSTADDRESS$ -p $ARG1$ -u $ARG2$ -e 'HTTP/1.0 200 OK'
  167. ## Check RealAudio url
  168. command[check_real_url]=@libexecdir@/check_real $HOSTADDRESS$ -p $ARG1$ -wt $ARG2$ -ct $ARG3$ -to 5 -u $ARG4$
  169. ## Check RealAudio server response
  170. command[check_real]=@libexecdir@/check_real $HOSTADDRESS$ -p $ARG1$ -wt $ARG2$ -ct $ARG3$ -to 5
  171. # NetWare checks via check_nwstat ( see "check_nwstat -h" for more options)
  172. # how many current logins
  173. command[check_netware_logins]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v "LOGINS" -w $ARG1$ -c $ARG2$
  174. # how many current connections
  175. command[check_nwstat_conns]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v CONNS -w $ARG1$ -c $ARG2$
  176. # 1 minute avg cpu load
  177. command[check_netware_1load]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v "LOAD1" -w 70 -c 90
  178. # 5 minute avg cpu load
  179. command[check_netware_5load]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v "LOAD5" -w 70 -c 90
  180. # 15 minute avg cpu load
  181. command[check_netware_15load]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v "LOAD15" -w 70 -c 90
  182. # Disk volume (% free)
  183. command[check_nwstat_vol_p]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v VPF$ARG1$ -w $ARG2$ -c $ARG3$
  184. # Disk volume (KB free)
  185. command[check_nwstat_vol_k]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v VKF$ARG1$ -w $ARG2$ -c $ARG3$
  186. # % Long term cache hits
  187. command[check_nwstat_ltch]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v LTCH -w $ARG1$ -c $ARG2$
  188. # % (of max) used packet receive buffers
  189. command[check_nwstat_puprb]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v PUPRB -w $ARG1$ -c $ARG2$
  190. # Check to see if the DS database is open
  191. command[check_nwstat_dsdb]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v DSDB
  192. # Netware 5 abends
  193. command[check_netware_abend]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v "ABENDS" -w 10 -c 30
  194. # Netware 5 number of current service procs
  195. command[check_nwstat_csprocs]=@libexecdir@/check_nwstat -H $HOSTADDRESS$ -v CSPROCS -w $ARG1$ -c $ARG2$
  196. # Still have to write sample entries for the following:
  197. #
  198. # check_ldap
  199. # check_overcr