478 |
|
|
479 |
resource operator value [cycles] action |
resource operator value [cycles] action |
480 |
|
|
481 |
I<resource> is a choice of "CPUUSAGE", "MEMUSAGE", "MEMKBYTE", |
I<resource> is a choice of "CPU", "MEMORY", "CHILDREN", |
482 |
"LOADAVG([1min|5min|15min]), "CHILDREN", "TOTALMEMUSAGE", |
"TOTALMEMORY", "LOADAVG([1min|5min|15min]): |
|
"TOTALMEMKBYTE": |
|
|
|
|
|
CPUUSAGE is the CPU usage of the process and it's children in |
|
|
parts of hundred (percent). This resource I<value> is a floating |
|
|
point number. For instance, 60.0. |
|
|
|
|
|
MEMUSAGE is the memory usage of the process in parts of hundred |
|
|
(percent). This resource I<value> is also a floating point |
|
|
number. |
|
483 |
|
|
484 |
MEMKBYTE is the memory amount of the process in KiB (1024 |
CPU is the CPU usage of the process and it's children in |
485 |
byte). This resource I<value> is an integer number. |
parts of hundred (percent). |
486 |
|
|
487 |
LOADAVG([1min|5min|15min]) refers to the system's load average. |
MEMORY is the memory usage of the process without it's child |
488 |
The load average is the number of processes in the system run |
processes in wheather in parts of hundred (percent) or as an |
489 |
queue averaged over the specified time period. This resource |
amount (Byte, kB, MB, GB). |
|
I<value> is again a floating point number. |
|
490 |
|
|
491 |
CHILDREN is the number of child processes of the process. |
CHILDREN is the number of child processes of the process. |
|
This resource I<value> is an integer number. |
|
492 |
|
|
493 |
TOTALMEMUSAGE is the memory usage of the process and it's child |
TOTALMEMORY is the memory usage of the process and it's child |
494 |
processes in parts of hundred (percent). This resource |
processes in whether in parts of hundred (percent) or as an |
495 |
I<value> is also a floating point number. |
amount (Byte, kB, MB, GB). |
496 |
|
|
497 |
TOTALMEMKBYTE is the memory amount of the process and it's child |
LOADAVG([1min|5min|15min]) refers to the system's load average. |
498 |
processes in KiB (1024 byte). This resource I<value> is an |
The load average is the number of processes in the system run |
499 |
integer number. |
queue averaged over the specified time period. This resource |
500 |
|
|
501 |
I<operator> is a choice of "<",">","!=","==" in c notation, "gt", |
I<operator> is a choice of "<",">","!=","==" in c notation, "gt", |
502 |
"lt", "eq", "ne" in shell sh notation and "greater", "less", |
"lt", "eq", "ne" in shell sh notation and "greater", "less", |
503 |
"equal", "notequal" in human readable form (if not specified, |
"equal", "notequal" in human readable form (if not specified, |
504 |
default is EQUAL). |
default is EQUAL). |
505 |
|
|
506 |
|
I<value> is whether an integer number or a fixed point number |
507 |
|
(except for CHILDREN). For CPU, MEMORY and TOTALMEMORY you need |
508 |
|
to specify a I<unit>. This could be "%" or if applicable "B" |
509 |
|
(Byte), "kB" (1024 Byte), "MB" (1024 KiloByte) or "GB" (1024 |
510 |
|
MegaByte). |
511 |
|
|
512 |
I<cycles> is the maximum number of cycles the expression above |
I<cycles> is the maximum number of cycles the expression above |
513 |
has to be true in order to start an action. If I<cycles> is |
has to be true in order to start an action. If I<cycles> is |
514 |
omitted then it is set to one. |
omitted then it is set to one. |
537 |
beyond 50% for five cycles before restarting it, the following |
beyond 50% for five cycles before restarting it, the following |
538 |
expression could be used: |
expression could be used: |
539 |
|
|
540 |
if cpuusage is greater than 50.0 for 5 cycles then restart |
if cpu is greater than 50 % for 5 cycles then restart |
541 |
|
|
542 |
Or the short version without noise keywords: |
Or the short version without noise keywords: |
543 |
|
|
544 |
cpuusage > 50.0 5 restart |
cpu > 50 % 5 restart |
545 |
|
|
546 |
See also the example section below. |
See also the example section below. |
547 |
|
|
1426 |
active mode only if a service was started under |
active mode only if a service was started under |
1427 |
monit's control otherwise the service isn't |
monit's control otherwise the service isn't |
1428 |
monitored. |
monitored. |
1429 |
cpuusage Must be followed by a compare operator, a |
cpu Must be followed by a compare operator, a number |
1430 |
floating point number, optionally a maximum |
with "%", optionally a maximum number of cycles |
1431 |
number of cycles and an action. This statement |
and an action. This statement is used to check |
1432 |
is used to check the cpu usage in percent of a |
the cpu usage in percent of a process with it's |
1433 |
process with it's children over a number of |
children over a number of cylces. If the |
1434 |
cylces. If the compare expression matches then |
compare expression matches then the action |
1435 |
the action restart, alert or stop is activated |
restart, alert or stop is activated. |
1436 |
memusage The equivalent to cpuusage for memory of a |
mem The equivalent to the cpu token for memory of a |
1437 |
process (w/o children!). The syntax is the same |
process (w/o children!). This token must be |
1438 |
as above. |
followed by a compare operator a number with |
1439 |
memkbyte The equivalent to memusage but with amounts |
unit {B|KB|MB|GB|%|byte|kilobyte|megabyte| |
1440 |
in Kb instead of percentages. |
gigabyte|percent}, optionally a maximum number |
1441 |
|
of cycles and an action. |
1442 |
loadavg Must be followed by [1min,5min,15min] in (), a |
loadavg Must be followed by [1min,5min,15min] in (), a |
1443 |
compare operator, a floating point number, |
compare operator, a number, optionally a maximum |
1444 |
optionally a maximum number of cycles and an |
number of cycles and an action. |
1445 |
action. This statement is used to check the |
This statement is used to check the system load |
1446 |
system load average over a number of cylces. If |
average over a number of cylces. If the compare |
1447 |
the compare expression matches then the action |
expression matches then the action start, alert |
1448 |
start, alert or stop is avtivated. |
or stop is activated. |
1449 |
children This is the number of child processes of a |
children This is the number of child processes of a |
1450 |
process. The syntax is the same as above. |
process. The syntax is the same as above. |
1451 |
totalmemusage The equivalent to cpuusage for memory of a |
totalmem The equivalent to memory for memory of a |
1452 |
process and it's child processes. The syntax |
process and it's child processes. The syntax |
1453 |
is the same as above. |
is the same as above. |
1454 |
totalmemkbyte The equivalent to totalmemusage but with amounts |
space Must be followed by a compare operator, a |
|
in Kb instead of percentages. |
|
|
space Must be followed by a compare operator, integer |
|
1455 |
number, unit {B|KB|MB|GB|%|byte|kilobyte| |
number, unit {B|KB|MB|GB|%|byte|kilobyte| |
1456 |
megabyte|gigabyte|percent} and action. |
megabyte|gigabyte|percent} and action. |
1457 |
inode(s) Must be followed by a compare operator, integer |
inode(s) Must be followed by a compare operator, integer |
1474 |
I<every>, I<mode>, I<active>, I<passive>, I<manual>, I<depends>, |
I<every>, I<mode>, I<active>, I<passive>, I<manual>, I<depends>, |
1475 |
I<host>, I<default>, I<http>, I<ftp>, I<smtp>, I<pop>, I<nntp>, |
I<host>, I<default>, I<http>, I<ftp>, I<smtp>, I<pop>, I<nntp>, |
1476 |
I<imap>, I<ssh>, I<dwp>, I<ldap2>, I<ldap3>, I<request>, |
I<imap>, I<ssh>, I<dwp>, I<ldap2>, I<ldap3>, I<request>, |
1477 |
I<cpuusage>, I<memusage>, I<memkbyte>, I<totalmemusage>, |
I<cpu>, I<mem>, I<totalmem>, I<children>, I<loadavg>, |
1478 |
I<totalmemkbyte>, I<children>, I<loadavg>, I<timestamp>, |
I<timestamp>, I<second(s)>, I<minute(s)>, I<hour(s)>, I<day(s)>, |
1479 |
I<second(s)>, I<minute(s)>, I<hour(s)>, I<day(s)>, I<space>, |
I<space>, I<inode>, I<perm>, I<process>, I<file>, I<directory> |
1480 |
I<inode>, I<perm>, I<process>, I<file>, I<directory> and I<device> |
and I<device> |
1481 |
|
|
1482 |
And here is a complete list of B<noise keywords> ignored by |
And here is a complete list of B<noise keywords> ignored by |
1483 |
monit: |
monit: |
1623 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
1624 |
start program = "/etc/init.d/httpd start" |
start program = "/etc/init.d/httpd start" |
1625 |
stop program = "/etc/init.d/httpd stop" |
stop program = "/etc/init.d/httpd stop" |
1626 |
if cpuusage > 60.0 for 2 cycles then alert |
if cpu > 60.0 % for 2 cycles then alert |
1627 |
if cpuusage > 80.0 for 5 cycles then restart |
if cpu > 80 % for 5 cycles then restart |
1628 |
if memkbyte > 100000 for 5 cycles then stop |
if mem > 100 MB for 5 cycles then stop |
1629 |
if loadavg(5min) greater than 10.0 for 8 cycles then stop |
if loadavg(5min) greater than 10.0 for 8 cycles then stop |
1630 |
|
|
1631 |
|
|
1719 |
and use the request "/login.cgi" |
and use the request "/login.cgi" |
1720 |
host shop.sol.no port 443 type tcpssl proto http |
host shop.sol.no port 443 type tcpssl proto http |
1721 |
timeout (2,3) |
timeout (2,3) |
1722 |
if cpuusage is greater than 60.0 for 2 cycles then alert |
if cpu is greater than 60 % for 2 cycles then alert |
1723 |
if cpuusage > 80.0 for 5 cycles then restart |
if cpu > 80.0 % for 5 cycles then restart |
1724 |
if memkbyte > 100000 then stop |
if mem > 100 MB then stop |
1725 |
if timestamp "/usr/local/apache/logs/httpd.pid" > 7 days |
if timestamp "/usr/local/apache/logs/httpd.pid" > 7 days |
1726 |
then restart |
then restart |
1727 |
alert foo@bar on { checksum } |
alert foo@bar on { checksum } |