| 1 |
############################################################################### |
| 2 |
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS @VERSION@ |
| 3 |
# |
| 4 |
# |
| 5 |
# NOTES: This config file provides you with some example command definitions |
| 6 |
# that you can reference in host, service, and contact definitions. |
| 7 |
# |
| 8 |
# You don't need to keep commands in a separate file from your other |
| 9 |
# object definitions. This has been done just to make things easier to |
| 10 |
# understand. |
| 11 |
# |
| 12 |
############################################################################### |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
################################################################################ |
| 17 |
# |
| 18 |
# SAMPLE NOTIFICATION COMMANDS |
| 19 |
# |
| 20 |
# These are some example notification commands. They may or may not work on |
| 21 |
# your system without modification. As an example, some systems will require |
| 22 |
# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below. |
| 23 |
# |
| 24 |
################################################################################ |
| 25 |
|
| 26 |
define command { |
| 27 |
|
| 28 |
command_name notify-host-by-email |
| 29 |
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ |
| 30 |
} |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
define command { |
| 35 |
|
| 36 |
command_name notify-service-by-email |
| 37 |
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ |
| 38 |
} |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
################################################################################ |
| 43 |
# |
| 44 |
# SAMPLE HOST CHECK COMMANDS |
| 45 |
# |
| 46 |
################################################################################ |
| 47 |
|
| 48 |
# This command checks to see if a host is "alive" by pinging it |
| 49 |
# The check must result in a 100% packet loss or 5 second (5000ms) round trip |
| 50 |
# average time to produce a critical error. |
| 51 |
# Note: Five ICMP echo packets are sent (determined by the '-p 5' argument) |
| 52 |
|
| 53 |
define command { |
| 54 |
|
| 55 |
command_name check-host-alive |
| 56 |
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5 |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
################################################################################ |
| 62 |
# |
| 63 |
# SAMPLE SERVICE CHECK COMMANDS |
| 64 |
# |
| 65 |
# These are some example service check commands. They may or may not work on |
| 66 |
# your system, as they must be modified for your plugins. See the HTML |
| 67 |
# documentation on the plugins for examples of how to configure command definitions. |
| 68 |
# |
| 69 |
# NOTE: The following 'check_local_...' functions are designed to monitor |
| 70 |
# various metrics on the host that Nagios is running on (i.e. this one). |
| 71 |
################################################################################ |
| 72 |
|
| 73 |
define command { |
| 74 |
|
| 75 |
command_name check_local_disk |
| 76 |
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
define command { |
| 82 |
|
| 83 |
command_name check_local_load |
| 84 |
command_line $USER1$/check_load -w $ARG1$ -c $ARG2$ |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
define command { |
| 90 |
|
| 91 |
command_name check_local_procs |
| 92 |
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$ |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
define command { |
| 98 |
|
| 99 |
command_name check_local_users |
| 100 |
command_line $USER1$/check_users -w $ARG1$ -c $ARG2$ |
| 101 |
} |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
define command { |
| 106 |
|
| 107 |
command_name check_local_swap |
| 108 |
command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$ |
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
define command { |
| 114 |
|
| 115 |
command_name check_local_mrtgtraf |
| 116 |
command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$ |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
################################################################################ |
| 122 |
# NOTE: The following 'check_...' commands are used to monitor services on |
| 123 |
# both local and remote hosts. |
| 124 |
################################################################################ |
| 125 |
|
| 126 |
define command { |
| 127 |
|
| 128 |
command_name check_ftp |
| 129 |
command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$ |
| 130 |
} |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
define command { |
| 135 |
|
| 136 |
command_name check_hpjd |
| 137 |
command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$ |
| 138 |
} |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
define command { |
| 143 |
|
| 144 |
command_name check_snmp |
| 145 |
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$ |
| 146 |
} |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
define command { |
| 151 |
|
| 152 |
command_name check_http |
| 153 |
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$ |
| 154 |
} |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
define command { |
| 159 |
|
| 160 |
command_name check_ssh |
| 161 |
command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$ |
| 162 |
} |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
define command { |
| 167 |
|
| 168 |
command_name check_dhcp |
| 169 |
command_line $USER1$/check_dhcp $ARG1$ |
| 170 |
} |
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
define command { |
| 175 |
|
| 176 |
command_name check_ping |
| 177 |
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 |
| 178 |
} |
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
define command { |
| 183 |
|
| 184 |
command_name check_pop |
| 185 |
command_line $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$ |
| 186 |
} |
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
define command { |
| 191 |
|
| 192 |
command_name check_imap |
| 193 |
command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$ |
| 194 |
} |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
define command { |
| 199 |
|
| 200 |
command_name check_smtp |
| 201 |
command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$ |
| 202 |
} |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
define command { |
| 207 |
|
| 208 |
command_name check_tcp |
| 209 |
command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$ |
| 210 |
} |
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
define command { |
| 215 |
|
| 216 |
command_name check_udp |
| 217 |
command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$ |
| 218 |
} |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
define command { |
| 223 |
|
| 224 |
command_name check_nt |
| 225 |
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$ |
| 226 |
} |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
################################################################################ |
| 231 |
# |
| 232 |
# SAMPLE PERFORMANCE DATA COMMANDS |
| 233 |
# |
| 234 |
# These are sample performance data commands that can be used to send performance |
| 235 |
# data output to two text files (one for hosts, another for services). If you |
| 236 |
# plan on simply writing performance data out to a file, consider using the |
| 237 |
# host_perfdata_file and service_perfdata_file options in the main config file. |
| 238 |
# |
| 239 |
################################################################################ |
| 240 |
|
| 241 |
define command { |
| 242 |
|
| 243 |
command_name process-host-perfdata |
| 244 |
command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> @localstatedir@/host-perfdata.out |
| 245 |
} |
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
define command { |
| 250 |
|
| 251 |
command_name process-service-perfdata |
| 252 |
command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> @localstatedir@/service-perfdata.out |
| 253 |
} |