1356 |
B<action> is a choice of "ALERT", "RESTART", "STOP", "EXEC" or |
B<action> is a choice of "ALERT", "RESTART", "STOP", "EXEC" or |
1357 |
"UNMONITOR". |
"UNMONITOR". |
1358 |
|
|
|
In addition Monit can check ICMP Echo for remote host checks. |
|
|
Syntax: |
|
1359 |
|
|
1360 |
IF FAILED ICMP TYPE ECHO [WITH] [TIMEOUT number SECONDS] THEN action |
=head4 Remote host ping test |
1361 |
|
|
1362 |
For action and timeout apllies above rules. |
In addition monit can perform ICMP Echo tests in remote host |
1363 |
|
checks. The icmp test may only be used in a check host entry and |
1364 |
|
monit must run with super user privileges, that is, the root user |
1365 |
|
must run monit. The reason is that the icmp test utilize a raw |
1366 |
|
socket to send the icmp package and only the super user is |
1367 |
|
allowed to create a raw socket. |
1368 |
|
|
1369 |
|
The full syntax for the ICMP Echo statement used for ping testing |
1370 |
|
is as follows (keywords are in capital and optional statements in |
1371 |
|
[brackets]): |
1372 |
|
|
1373 |
|
IF FAILED ICMP TYPE ECHO [WITH] [TIMEOUT number SECONDS] |
1374 |
|
THEN action |
1375 |
|
|
1376 |
|
The rules for action and timeout is the same as those mentioned |
1377 |
|
above in the CONNECTION TESTING section. An icmp ping test is |
1378 |
|
very useful for testing if a host is up, before testing ports at |
1379 |
|
the host. If an icmp ping test is used in a check host entry, |
1380 |
|
this test is run first and if the ping test should fail we assume |
1381 |
|
that the connection to the host is down and monit does I<not> |
1382 |
|
continue to test any port connections. Here's an example: |
1383 |
|
|
1384 |
|
check host xyzzy with address xyzzy.org |
1385 |
|
if failed icmp type echo with timeout 15 seconds |
1386 |
|
then alert |
1387 |
|
if failed port 80 proto http then alert |
1388 |
|
if failed port 443 type TCPSSL proto http then alert |
1389 |
|
alert foo@bar |
1390 |
|
|
1391 |
|
In this case, if the icmp test should fail you will get I<one> |
1392 |
|
alert and only one alert as long as the host is down, and equally |
1393 |
|
important, monit will I<not> test port 80 and port 443. Likewise |
1394 |
|
if the icmp ping test should succeed (again) monit will continue |
1395 |
|
to test both port 80 and 443. |
1396 |
|
|
1397 |
|
Keep in mind though that some firewalls can block icmp packages |
1398 |
|
and thus render the test useless. |
1399 |
|
|
1400 |
|
|
1401 |
=head4 Examples |
=head4 Examples |