271 |
monit will raise an email alert if: |
monit will raise an email alert if: |
272 |
|
|
273 |
o A service timed out |
o A service timed out |
274 |
o A service was restarted |
o A service was started or restarted |
275 |
o A service was stopped |
o A service was stopped |
276 |
o A timestamp test didn't pass |
o A timestamp test didn't pass |
277 |
o A resource statement match (see also the section RESOURCE |
o A resource statement match (see also the section RESOURCE |
291 |
alert foo@bar |
alert foo@bar |
292 |
|
|
293 |
will send a default email alert to the address foo@bar whenever a |
will send a default email alert to the address foo@bar whenever a |
294 |
timeout, restart, checksum, resource, stop or timestamp error |
timeout, start, restart, checksum, resource, stop or timestamp |
295 |
occurs. |
error occurs. |
296 |
|
|
297 |
If you only want an alert message sent when a certain event |
If you only want an alert message sent when a certain event |
298 |
occurs for example a timeout or when a service is restarted, |
occurs for example a timeout or when a service is restarted, |
325 |
|
|
326 |
The following alert-statement: |
The following alert-statement: |
327 |
|
|
328 |
alert foo@bar { timeout |
alert foo@bar { start |
329 |
restart |
stop |
330 |
|
restart |
331 |
checksum |
checksum |
332 |
resource |
resource |
333 |
stop |
timeout |
334 |
timestamp } |
timestamp } |
335 |
|
|
336 |
is equivalent to: |
is equivalent to: |
338 |
alert foo@bar |
alert foo@bar |
339 |
|
|
340 |
which as stated above, will send a message when a timeout, a |
which as stated above, will send a message when a timeout, a |
341 |
restart, checksum, resource, stop or timestamp error occurs. (If |
start, restart, checksum, resource, stop or timestamp error |
342 |
the postfix variant is used, then note that the parenthesis are |
occurs. (If the postfix variant is used, then note that the |
343 |
I<mandatory>). |
parenthesis are I<mandatory>). |
344 |
|
|
345 |
A restart alert is also sent I<if monit fails to execute> a start |
A start, stop or restart alert is also sent I<if monit fails to |
346 |
or stop program for an entry. B<It is therefor strongly advised> |
execute> a start or stop program for an entry. B<It is therefor |
347 |
that at least one alert statement register interest for restart |
strongly advised> that at least one alert statement register |
348 |
alerts. |
interest for either, start, stop or restart alerts. |
349 |
|
|
350 |
monit will provide a default mail message layout that is short |
monit will provide a default mail message layout that is short |
351 |
and to the point. Here's an example of a standard alert mail sent |
and to the point. Here's an example of a standard alert mail sent |
352 |
by monit: |
by monit: |
353 |
|
|
354 |
From: monit@tildeslash.com |
From: monit@tildeslash.com |
355 |
Subject: monit alert -- apache restarted |
Subject: monit alert -- Restart apache |
356 |
To: hauk@tildeslash.com |
To: hauk@tildeslash.com |
357 |
Date: Tue, 28 May 2002 20:42:30 +0200 |
Date: Tue, 28 May 2002 20:42:30 +0200 |
358 |
|
|
359 |
Service apache restarted |
Restart service apache |
360 |
|
|
361 |
Date: Tue May 28 20:42:30 2002 |
Date: Tue May 28 20:42:30 2002 |
362 |
Host: www.tildeslash.com |
Host: www.tildeslash.com |
397 |
text with a special value: |
text with a special value: |
398 |
|
|
399 |
I<$EVENT> A string describing the event that occured. The values |
I<$EVENT> A string describing the event that occured. The values |
400 |
are fixed and are, "restarted", "timed out", "stopped and |
are fixed and are, "Start", "Stop", "Restart", Checksum error", |
401 |
"checksum error" |
"Resource limit matched", "Timeout", and "Timestamp error" |
402 |
|
|
403 |
I<$SERVICE> The service entry name in monitrc (old form I<$PROGRAM> |
I<$SERVICE> The service entry name in monitrc (old form I<$PROGRAM> |
404 |
is supported too but not recommended). |
is supported too but not recommended). |