1 |
# |
# |
2 |
# The right margin in this file is 65 characters. |
# The right margin in this file is 65 characters. |
3 |
# In XEmacs use -- set-variable: fill-column = 65 |
# In Emacs use -- set-variable: fill-column = 65 |
4 |
# |
# |
5 |
|
|
6 |
=head1 NAME |
=head1 NAME |
15 |
|
|
16 |
=head1 DESCRIPTION |
=head1 DESCRIPTION |
17 |
|
|
18 |
B<monit> is a utility for monitoring and managing daemons or |
B<monit> is a utility for monitoring and managing services on a |
19 |
similar programs running on a Unix system, devices, files or |
Unix system. It will execute appropriate actions if the monitored |
20 |
directories. Monit will do appropriate action if attributes of |
services should entered an erroneous state. |
|
monitored device, file, directory or process entered erroneous |
|
|
state. |
|
21 |
|
|
22 |
The monit utility can run in a daemon mode to repeatedly poll one |
The monit utility can run in a daemon mode to repeatedly poll one |
23 |
or more monitored services at a specified interval. |
or more monitored services at a specified interval. |
51 |
B<-p> I<pidfile> |
B<-p> I<pidfile> |
52 |
Use this lock file in daemon mode |
Use this lock file in daemon mode |
53 |
|
|
54 |
|
B<-s> I<statefile> |
55 |
|
Write state information to this file |
56 |
|
|
57 |
B<-i> |
B<-i> |
58 |
Validate mode, startup in validate mode |
Validate mode, startup in validate mode |
59 |
|
|
538 |
beyond 50% for five cycles before restarting it, the following |
beyond 50% for five cycles before restarting it, the following |
539 |
expression could be used: |
expression could be used: |
540 |
|
|
541 |
if cpu is greater than 50 % for 5 cycles then restart |
if cpu is greater than 50% for 5 cycles then restart |
542 |
|
|
543 |
Or the short version without noise keywords: |
Or the short version without noise keywords: |
544 |
|
|
545 |
cpu > 50 % 5 restart |
cpu > 50% 5 restart |
546 |
|
|
547 |
See also the example section below. |
See also the example section below. |
548 |
|
|
773 |
"equal", "notequal" in human readable form (if not specified, |
"equal", "notequal" in human readable form (if not specified, |
774 |
default is EQUAL). |
default is EQUAL). |
775 |
|
|
776 |
I<unit> is optional. If not specified, value is absolute count |
I<unit> is optional. If not specified, the value is an absolute |
777 |
of inodes. You can use "%" character or long alternative "percent" |
count of inodes. You can use the "%" character or the longer |
778 |
as unit. |
alternative "percent" as a unit. |
779 |
|
|
780 |
I<action> is a choice of "ALERT", "RESTART", "STOP": |
I<action> is a choice of "ALERT", "RESTART", "STOP": |
781 |
|
|
1285 |
set logfile Name of a file to dump error- and status- |
set logfile Name of a file to dump error- and status- |
1286 |
messages to. If syslog is specified as the |
messages to. If syslog is specified as the |
1287 |
file, monit will utilize the syslog daemon |
file, monit will utilize the syslog daemon |
1288 |
to log messages. This can optionally be followed |
to log messages. This can optionally be |
1289 |
by 'facility <facility>' where facility is |
followed by 'facility <facility>' where |
1290 |
'log_local0' - 'log_local7' or 'log_daemon'. If no |
facility is 'log_local0' - 'log_local7' or |
1291 |
facility is specified, LOG_USER is used. |
'log_daemon'. If no facility is specified, |
1292 |
|
LOG_USER is used. |
1293 |
|
|
1294 |
set mailserver The mailserver used for sending alert |
set mailserver The mailserver used for sending alert |
1295 |
notifications. If the mailserver is not |
notifications. If the mailserver is not |
1299 |
messages emitted by monit. |
messages emitted by monit. |
1300 |
set pidfile Explicit set the location of the monit lock |
set pidfile Explicit set the location of the monit lock |
1301 |
file. E.g. set pidfile /run/monit.pid. |
file. E.g. set pidfile /run/monit.pid. |
1302 |
|
set statefile Explicit set the location of file monit |
1303 |
|
will write state data to. If not set the |
1304 |
|
default is $HOME/.monit.state. |
1305 |
set httpd port Activates monit http server at the given |
set httpd port Activates monit http server at the given |
1306 |
portnumber. |
portnumber. |
1307 |
ssl enable Enables ssl support for the httpd server. |
ssl enable Enables ssl support for the httpd server. |
1472 |
|
|
1473 |
I<set>, I<daemon>, I<logfile>, I<syslog>, I<address>, I<httpd>, |
I<set>, I<daemon>, I<logfile>, I<syslog>, I<address>, I<httpd>, |
1474 |
I<ssl>, I<enable>, I<disable>, I<pemfile>, I<allow>, I<check>, |
I<ssl>, I<enable>, I<disable>, I<pemfile>, I<allow>, I<check>, |
1475 |
I<init>, I<pidfile>, I<group>, I<start>, I<stop>, |
I<init>, I<pidfile>, I<statefile>, I<group>, I<start>, I<stop>, |
1476 |
I<port(number)>, I<unix(socket)>, I<type>, I<proto(col)>, I<tcp>, |
I<uid>, I<gid>, I<port(number)>, I<unix(socket)>, I<type>, |
1477 |
I<tcpssl>, I<udp>, I<alert>, I<mail-format>, I<restart>, |
I<proto(col)>, I<tcp>, I<tcpssl>, I<udp>, I<alert>, |
1478 |
I<timeout>, I<checksum>, I<resource>, I<expect>, I<mailserver>, |
I<mail-format>, I<restart>, I<timeout>, I<checksum>, I<resource>, |
1479 |
I<every>, I<mode>, I<active>, I<passive>, I<manual>, I<depends>, |
I<expect>, I<mailserver>, I<every>, I<mode>, I<active>, |
1480 |
I<host>, I<default>, I<http>, I<ftp>, I<smtp>, I<pop>, I<nntp>, |
I<passive>, I<manual>, I<depends>, I<host>, I<default>, I<http>, |
1481 |
I<imap>, I<ssh>, I<dwp>, I<ldap2>, I<ldap3>, I<request>, |
I<ftp>, I<smtp>, I<pop>, I<nntp>, I<imap>, I<ssh>, I<dwp>, |
1482 |
I<cpu>, I<mem>, I<totalmem>, I<children>, I<loadavg>, |
I<ldap2>, I<ldap3>, I<request>, I<cpu>, I<mem>, I<totalmem>, |
1483 |
I<timestamp>, I<second(s)>, I<minute(s)>, I<hour(s)>, I<day(s)>, |
I<children>, I<loadavg>, I<timestamp>, I<second(s)>, |
1484 |
I<space>, I<inode>, I<perm>, I<process>, I<file>, I<directory> |
I<minute(s)>, I<hour(s)>, I<day(s)>, I<space>, I<inode>, I<perm>, |
1485 |
and I<device> |
I<process>, I<file>, I<directory> and I<device> |
1486 |
|
|
1487 |
And here is a complete list of B<noise keywords> ignored by |
And here is a complete list of B<noise keywords> ignored by |
1488 |
monit: |
monit: |
1621 |
Here is an example to show the usage of the resource checks. It |
Here is an example to show the usage of the resource checks. It |
1622 |
will send an alert when the CPU usage of the http daemon and it's |
will send an alert when the CPU usage of the http daemon and it's |
1623 |
child processes raises beyond 60% for over two cycles. It is |
child processes raises beyond 60% for over two cycles. It is |
1624 |
restarted when the CPU usage it over 80% for five cycles, the |
restarted when the CPU usage if over 80% for five cycles, the |
1625 |
memory usage over 100Mb for five cycles or if the machines load |
memory usage over 100Mb for five cycles or if the machines load |
1626 |
average is beyond 10 for 8 cycles: |
average is beyond 10 for 8 cycles: |
1627 |
|
|
1628 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
1629 |
start program = "/etc/init.d/httpd start" |
start program = "/etc/init.d/httpd start" |
1630 |
stop program = "/etc/init.d/httpd stop" |
stop program = "/etc/init.d/httpd stop" |
1631 |
if cpu > 60.0 % for 2 cycles then alert |
if cpu > 60% for 2 cycles then alert |
1632 |
if cpu > 80 % for 5 cycles then restart |
if cpu > 80% for 5 cycles then restart |
1633 |
if mem > 100 MB for 5 cycles then stop |
if mem > 100 MB for 5 cycles then stop |
1634 |
if loadavg(5min) greater than 10.0 for 8 cycles then stop |
if loadavg(5min) greater than 10.0 for 8 cycles then stop |
1635 |
|
|
1724 |
and use the request "/login.cgi" |
and use the request "/login.cgi" |
1725 |
host shop.sol.no port 443 type tcpssl proto http |
host shop.sol.no port 443 type tcpssl proto http |
1726 |
timeout (2,3) |
timeout (2,3) |
1727 |
if cpu is greater than 60 % for 2 cycles then alert |
if cpu is greater than 60% for 2 cycles then alert |
1728 |
if cpu > 80.0 % for 5 cycles then restart |
if cpu > 80% for 5 cycles then restart |
1729 |
if mem > 100 MB then stop |
if mem > 100 MB then stop |
1730 |
if timestamp "/usr/local/apache/logs/httpd.pid" > 7 days |
if timestamp "/usr/local/apache/logs/httpd.pid" > 7 days |
1731 |
then restart |
then restart |
1913 |
monit save its state to this file and utilize |
monit save its state to this file and utilize |
1914 |
information found in this file to recover from |
information found in this file to recover from |
1915 |
a crash. This is a binary file and it's content is |
a crash. This is a binary file and it's content is |
1916 |
only of interest to monit. |
only of interest to monit. You may set the location |
1917 |
|
of this file in the monit control file or by using |
1918 |
|
the -s switch when monit is started. |
1919 |
|
|
1920 |
=head1 SIGNALS |
=head1 SIGNALS |
1921 |
|
|