1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
<HTML> |
2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<HEAD> |
3 |
<head> |
<TITLE>monit - utility for monitoring services on a Unix system</TITLE> |
4 |
<title>monit - utility for monitoring services on a Unix system</title> |
<LINK REV="made" HREF="mailto:bhcompile@daffy.perf.redhat.com"> |
5 |
<link rev="made" href="mailto:root@localhost" /> |
</HEAD> |
|
</head> |
|
6 |
|
|
7 |
<body style="background-color: white"> |
<BODY> |
8 |
|
|
9 |
<p><a name="__index__"></a></p> |
<A NAME="__index__"></A> |
10 |
<!-- INDEX BEGIN --> |
<!-- INDEX BEGIN --> |
11 |
|
|
12 |
<ul> |
<UL> |
13 |
|
|
14 |
<li><a href="#name">NAME</a></li> |
<LI><A HREF="#name">NAME</A></LI> |
15 |
<li><a href="#synopsis">SYNOPSIS</a></li> |
<LI><A HREF="#synopsis">SYNOPSIS</A></LI> |
16 |
<li><a href="#description">DESCRIPTION</a></li> |
<LI><A HREF="#description">DESCRIPTION</A></LI> |
17 |
<li><a href="#general_operation">GENERAL OPERATION</a></li> |
<LI><A HREF="#general operation">GENERAL OPERATION</A></LI> |
18 |
<ul> |
<UL> |
19 |
|
|
20 |
<li><a href="#general_options_and_arguments">General Options and Arguments</a></li> |
<LI><A HREF="#general options and arguments">General Options and Arguments</A></LI> |
21 |
</ul> |
</UL> |
22 |
|
|
23 |
<li><a href="#what_to_monitor">WHAT TO MONITOR</a></li> |
<LI><A HREF="#what to monitor">WHAT TO MONITOR</A></LI> |
24 |
<li><a href="#how_to_monitor">HOW TO MONITOR</a></li> |
<LI><A HREF="#how to monitor">HOW TO MONITOR</A></LI> |
25 |
<li><a href="#logging">LOGGING</a></li> |
<LI><A HREF="#logging">LOGGING</A></LI> |
26 |
<li><a href="#daemon_mode">DAEMON MODE</a></li> |
<LI><A HREF="#daemon mode">DAEMON MODE</A></LI> |
27 |
<li><a href="#init_support">INIT SUPPORT</a></li> |
<LI><A HREF="#init support">INIT SUPPORT</A></LI> |
28 |
<li><a href="#group_support">GROUP SUPPORT</a></li> |
<LI><A HREF="#group support">GROUP SUPPORT</A></LI> |
29 |
<li><a href="#monitoring_mode">MONITORING MODE</a></li> |
<LI><A HREF="#monitoring mode">MONITORING MODE</A></LI> |
30 |
<li><a href="#alert_messages">ALERT MESSAGES</a></li> |
<LI><A HREF="#alert messages">ALERT MESSAGES</A></LI> |
31 |
<ul> |
<UL> |
32 |
|
|
33 |
<li><a href="#alert_message_layout">Alert message layout</a></li> |
<LI><A HREF="#alert message layout">Alert message layout</A></LI> |
34 |
<li><a href="#setting_a_global_mail_format">Setting a global mail format</a></li> |
<LI><A HREF="#setting a global mail format">Setting a global mail format</A></LI> |
35 |
</ul> |
</UL> |
36 |
|
|
37 |
<li><a href="#service_timeout">SERVICE TIMEOUT</a></li> |
<LI><A HREF="#service timeout">SERVICE TIMEOUT</A></LI> |
38 |
<li><a href="#service_tests">SERVICE TESTS</a></li> |
<LI><A HREF="#service tests">SERVICE TESTS</A></LI> |
39 |
<ul> |
<UL> |
40 |
|
|
41 |
<li><a href="#resource_testing">RESOURCE TESTING</a></li> |
<LI><A HREF="#resource testing">RESOURCE TESTING</A></LI> |
42 |
<li><a href="#file_checksum_testing">FILE CHECKSUM TESTING</a></li> |
<LI><A HREF="#file checksum testing">FILE CHECKSUM TESTING</A></LI> |
43 |
<li><a href="#timestamp_testing">TIMESTAMP TESTING</a></li> |
<LI><A HREF="#timestamp testing">TIMESTAMP TESTING</A></LI> |
44 |
<li><a href="#file_size_testing">FILE SIZE TESTING</a></li> |
<LI><A HREF="#file size testing">FILE SIZE TESTING</A></LI> |
45 |
<li><a href="#space_testing">SPACE TESTING</a></li> |
<LI><A HREF="#space testing">SPACE TESTING</A></LI> |
46 |
<li><a href="#inode_testing">INODE TESTING</a></li> |
<LI><A HREF="#inode testing">INODE TESTING</A></LI> |
47 |
<li><a href="#permission_testing">PERMISSION TESTING</a></li> |
<LI><A HREF="#permission testing">PERMISSION TESTING</A></LI> |
48 |
<li><a href="#uid_testing">UID TESTING</a></li> |
<LI><A HREF="#uid testing">UID TESTING</A></LI> |
49 |
<li><a href="#gid_testing">GID TESTING</a></li> |
<LI><A HREF="#gid testing">GID TESTING</A></LI> |
50 |
<li><a href="#connection_testing">CONNECTION TESTING</a></li> |
<LI><A HREF="#connection testing">CONNECTION TESTING</A></LI> |
51 |
<ul> |
<UL> |
52 |
|
|
53 |
<ul> |
<UL> |
54 |
|
|
55 |
<li><a href="#examples">Examples</a></li> |
<LI><A HREF="#examples">Examples</A></LI> |
56 |
</ul> |
</UL> |
57 |
|
|
58 |
</ul> |
</UL> |
59 |
|
|
60 |
</ul> |
</UL> |
61 |
|
|
62 |
<li><a href="#monit_httpd">MONIT HTTPD</a></li> |
<LI><A HREF="#monit httpd">MONIT HTTPD</A></LI> |
63 |
<ul> |
<UL> |
64 |
|
|
65 |
<li><a href="#monit_httpd_authentication">Monit HTTPD Authentication</a></li> |
<LI><A HREF="#monit httpd authentication">Monit HTTPD Authentication</A></LI> |
66 |
<ul> |
<UL> |
67 |
|
|
68 |
<ul> |
<UL> |
69 |
|
|
70 |
<li><a href="#host_allow_list">Host allow list</a></li> |
<LI><A HREF="#host allow list">Host allow list</A></LI> |
71 |
<li><a href="#basic_authentication">Basic Authentication</a></li> |
<LI><A HREF="#basic authentication">Basic Authentication</A></LI> |
72 |
</ul> |
</UL> |
73 |
|
|
74 |
</ul> |
</UL> |
75 |
|
|
76 |
</ul> |
</UL> |
77 |
|
|
78 |
<li><a href="#dependency_tree">DEPENDENCY TREE</a></li> |
<LI><A HREF="#dependency tree">DEPENDENCY TREE</A></LI> |
79 |
<li><a href="#the_run_control_file">THE RUN CONTROL FILE</a></li> |
<LI><A HREF="#the run control file">THE RUN CONTROL FILE</A></LI> |
80 |
<ul> |
<UL> |
81 |
|
|
82 |
<li><a href="#run_control_syntax">Run Control Syntax</a></li> |
<LI><A HREF="#run control syntax">Run Control Syntax</A></LI> |
83 |
<li><a href="#configuration_examples">CONFIGURATION EXAMPLES</a></li> |
<LI><A HREF="#configuration examples">CONFIGURATION EXAMPLES</A></LI> |
84 |
</ul> |
</UL> |
85 |
|
|
86 |
<li><a href="#monit_with_heartbeat">MONIT WITH HEARTBEAT</a></li> |
<LI><A HREF="#monit with heartbeat">MONIT WITH HEARTBEAT</A></LI> |
87 |
<li><a href="#files">FILES</a></li> |
<LI><A HREF="#files">FILES</A></LI> |
88 |
<li><a href="#environment">ENVIRONMENT</a></li> |
<LI><A HREF="#environment">ENVIRONMENT</A></LI> |
89 |
<li><a href="#signals">SIGNALS</a></li> |
<LI><A HREF="#signals">SIGNALS</A></LI> |
90 |
<li><a href="#notes">NOTES</a></li> |
<LI><A HREF="#notes">NOTES</A></LI> |
91 |
<li><a href="#authors">AUTHORS</a></li> |
<LI><A HREF="#authors">AUTHORS</A></LI> |
92 |
<li><a href="#copyright">COPYRIGHT</a></li> |
<LI><A HREF="#copyright">COPYRIGHT</A></LI> |
93 |
<li><a href="#see_also">SEE ALSO</a></li> |
<LI><A HREF="#see also">SEE ALSO</A></LI> |
94 |
</ul> |
</UL> |
95 |
<!-- INDEX END --> |
<!-- INDEX END --> |
96 |
|
|
97 |
<hr /> |
<HR> |
98 |
<p> |
<P> |
99 |
</p> |
<H1><A NAME="name">NAME</A></H1> |
100 |
<h1><a name="name">NAME</a></h1> |
<P>monit - utility for monitoring services on a Unix system</P> |
101 |
<p>monit - utility for monitoring services on a Unix system</p> |
<P> |
102 |
<p> |
<HR> |
103 |
</p> |
<H1><A NAME="synopsis">SYNOPSIS</A></H1> |
104 |
<hr /> |
<P><STRONG>monit</STRONG> [options] {arguments}</P> |
105 |
<h1><a name="synopsis">SYNOPSIS</a></h1> |
<P> |
106 |
<p><strong>monit</strong> [options] {arguments}</p> |
<HR> |
107 |
<p> |
<H1><A NAME="description">DESCRIPTION</A></H1> |
108 |
</p> |
<P><STRONG>monit</STRONG> is a utility for managing and monitoring processes, |
|
<hr /> |
|
|
<h1><a name="description">DESCRIPTION</a></h1> |
|
|
<p><strong>monit</strong> is a utility for managing and monitoring processes, |
|
109 |
files, directories and devices on a Unix system. Monit conducts |
files, directories and devices on a Unix system. Monit conducts |
110 |
automatic maintenance and repair and can execute meaningful |
automatic maintenance and repair and can execute meaningful |
111 |
causal actions in error situations. E.g. monit can start a |
causal actions in error situations. E.g. monit can start a |
112 |
process if it does not run, restart a process if it does not |
process if it does not run, restart a process if it does not |
113 |
respond and stop a process if it uses to much resources. You may |
respond and stop a process if it uses to much resources. You may |
114 |
use monit to monitor files, directories and devices for changes, |
use monit to monitor files, directories and devices for changes, |
115 |
such as timestamps changes, checksum changes or size changes.</p> |
such as timestamps changes, checksum changes or size changes.</P> |
116 |
<p>Monit is controlled via an easy to configure control file based |
<P>Monit is controlled via an easy to configure control file based |
117 |
on a free-format, token-oriented syntax. Monit logs to syslog or |
on a free-format, token-oriented syntax. Monit logs to syslog or |
118 |
to its own log file and notifies you about error conditions via |
to its own log file and notifies you about error conditions via |
119 |
customizable alert messages. Monit can perform various TCP/IP |
customizable alert messages. Monit can perform various TCP/IP |
120 |
network checks, protocol checks and can utilize SSL for such |
network checks, protocol checks and can utilize SSL for such |
121 |
checks. Monit provides a <code>http(s)</code> interface and you may use a |
checks. Monit provides a <CODE>http(s)</CODE> interface and you may use a |
122 |
browser to access the monit program.</p> |
browser to access the monit program.</P> |
123 |
<p> |
<P> |
124 |
</p> |
<HR> |
125 |
<hr /> |
<H1><A NAME="general operation">GENERAL OPERATION</A></H1> |
126 |
<h1><a name="general_operation">GENERAL OPERATION</a></h1> |
<P>The behavior of monit is controlled by command-line options |
127 |
<p>The behavior of monit is controlled by command-line options |
<EM>and</EM> a run control file, <EM>~/.monitrc</EM>, the syntax of which we |
|
<em>and</em> a run control file, <em>~/.monitrc</em>, the syntax of which we |
|
128 |
describe in a later section. Command-line options override |
describe in a later section. Command-line options override |
129 |
<em>.monitrc</em> declarations.</p> |
<EM>.monitrc</EM> declarations.</P> |
130 |
<p>The following options are recognized by monit. However, it is |
<P>The following options are recognized by monit. However, it is |
131 |
recommended that you set options (when applicable) directly in |
recommended that you set options (when applicable) directly in |
132 |
the <em>.monitrc</em> control file.</p> |
the <EM>.monitrc</EM> control file.</P> |
133 |
<p> |
<P> |
134 |
</p> |
<H2><A NAME="general options and arguments">General Options and Arguments</A></H2> |
135 |
<h2><a name="general_options_and_arguments">General Options and Arguments</a></h2> |
<P><STRONG>-c</STRONG> <EM>file</EM> |
136 |
<p><strong>-c</strong> <em>file</em> |
Use this control file</P> |
137 |
Use this control file</p> |
<P><STRONG>-d</STRONG> <EM>n</EM> |
138 |
<p><strong>-d</strong> <em>n</em> |
Run as a daemon once per <EM>n</EM> seconds</P> |
139 |
Run as a daemon once per <em>n</em> seconds</p> |
<P><STRONG>-g</STRONG> |
140 |
<p><strong>-g</strong> |
Set group name for start, stop, restart and status</P> |
141 |
Set group name for start, stop, restart and status</p> |
<P><STRONG>-l</STRONG> <EM>logfile</EM> |
142 |
<p><strong>-l</strong> <em>logfile</em> |
Print log information to this file</P> |
143 |
Print log information to this file</p> |
<P><STRONG>-p</STRONG> <EM>pidfile</EM> |
144 |
<p><strong>-p</strong> <em>pidfile</em> |
Use this lock file in daemon mode</P> |
145 |
Use this lock file in daemon mode</p> |
<P><STRONG>-s</STRONG> <EM>statefile</EM> |
146 |
<p><strong>-s</strong> <em>statefile</em> |
Write state information to this file</P> |
147 |
Write state information to this file</p> |
<P><STRONG>-I</STRONG> |
148 |
<p><strong>-I</strong> |
Run from init (do not run in background)</P> |
149 |
Run from init (do not run in background)</p> |
<P><STRONG>-t</STRONG> |
150 |
<p><strong>-t</strong> |
Run syntax check for the control file</P> |
151 |
Run syntax check for the control file</p> |
<P><STRONG>-v</STRONG> |
152 |
<p><strong>-v</strong> |
Verbose mode, work noisy (diagnostic output)</P> |
153 |
Verbose mode, work noisy (diagnostic output)</p> |
<P><STRONG>-V</STRONG> |
154 |
<p><strong>-V</strong> |
Print version number and patch level</P> |
155 |
Print version number and patch level</p> |
<P><STRONG>-h</STRONG> |
156 |
<p><strong>-h</strong> |
Print a help text</P> |
157 |
Print a help text</p> |
<P>In addition to the options above, monit can be started with one |
|
<p>In addition to the options above, monit can be started with one |
|
158 |
of the following action arguments; monit will then execute the |
of the following action arguments; monit will then execute the |
159 |
action and exit without transforming itself to a daemon.</p> |
action and exit without transforming itself to a daemon.</P> |
160 |
<p><strong>start all</strong> |
<P><STRONG>start all</STRONG> |
161 |
Start all services listed in the control file and |
Start all services listed in the control file and |
162 |
enable monitoring for them. If the group option is |
enable monitoring for them. If the group option is |
163 |
set, only start and enable monitoring of services in |
set, only start and enable monitoring of services in |
164 |
the named group.</p> |
the named group.</P> |
165 |
<p><strong>start name</strong> |
<P><STRONG>start name</STRONG> |
166 |
Start the named service and enable monitoring for |
Start the named service and enable monitoring for |
167 |
it. The name is a service entry name from the |
it. The name is a service entry name from the |
168 |
monitrc file.</p> |
monitrc file.</P> |
169 |
<p><strong>stop all</strong> |
<P><STRONG>stop all</STRONG> |
170 |
Stop all services listed in the control file and |
Stop all services listed in the control file and |
171 |
disable their monitoring. If the group option is |
disable their monitoring. If the group option is |
172 |
set, only stop and disable monitoring of the services |
set, only stop and disable monitoring of the services |
173 |
in the named group.</p> |
in the named group.</P> |
174 |
<p><strong>stop name</strong> |
<P><STRONG>stop name</STRONG> |
175 |
Stop the named service and disable its monitoring. |
Stop the named service and disable its monitoring. |
176 |
The name is a service entry name from the monitrc |
The name is a service entry name from the monitrc |
177 |
file. available</p> |
file. available</P> |
178 |
<p><strong>restart all</strong> |
<P><STRONG>restart all</STRONG> |
179 |
Stop and start <em>all</em> services. If the group option |
Stop and start <EM>all</EM> services. If the group option |
180 |
is set, only restart the services in the named group.</p> |
is set, only restart the services in the named group.</P> |
181 |
<p><strong>restart name</strong> |
<P><STRONG>restart name</STRONG> |
182 |
Restart the named service. The name is a service entry |
Restart the named service. The name is a service entry |
183 |
name from the monitrc file.</p> |
name from the monitrc file.</P> |
184 |
<p><strong>monitor all</strong> |
<P><STRONG>monitor all</STRONG> |
185 |
Enable monitoring of all services listed in the |
Enable monitoring of all services listed in the |
186 |
control file. If the group option is set, only start |
control file. If the group option is set, only start |
187 |
the services monitoring in the named group.</p> |
the services monitoring in the named group.</P> |
188 |
<p><strong>monitor name</strong> |
<P><STRONG>monitor name</STRONG> |
189 |
Enable monitoring of the named service. The name is |
Enable monitoring of the named service. The name is |
190 |
a service entry name from the monitrc file. Monit will |
a service entry name from the monitrc file. Monit will |
191 |
also enable monitoring of all services this service |
also enable monitoring of all services this service |
192 |
depends on.</p> |
depends on.</P> |
193 |
<p><strong>unmonitor all</strong> |
<P><STRONG>unmonitor all</STRONG> |
194 |
Disable monitoring of all services listed in the |
Disable monitoring of all services listed in the |
195 |
control file. If the group option is set, only disable |
control file. If the group option is set, only disable |
196 |
monitoring of services in the named group.</p> |
monitoring of services in the named group.</P> |
197 |
<p><strong>unmonitor name</strong> |
<P><STRONG>unmonitor name</STRONG> |
198 |
Disable monitoring of the named service. The name is |
Disable monitoring of the named service. The name is |
199 |
a service entry name from the monitrc file. Monit |
a service entry name from the monitrc file. Monit |
200 |
will also disable monitoring of all services that |
will also disable monitoring of all services that |
201 |
depends on this service.</p> |
depends on this service.</P> |
202 |
<p><strong>status</strong> |
<P><STRONG>status</STRONG> |
203 |
Print status information for each service. If the |
Print status information for each service. If the |
204 |
group option is set, only print the status for the |
group option is set, only print the status for the |
205 |
named group.</p> |
named group.</P> |
206 |
<p><strong>reload</strong> |
<P><STRONG>reload</STRONG> |
207 |
Reinitialize a running monit daemon, the daemon will |
Reinitialize a running monit daemon, the daemon will |
208 |
reread its configuration, close and reopen log files.</p> |
reread its configuration, close and reopen log files.</P> |
209 |
<p><strong>quit</strong> |
<P><STRONG>quit</STRONG> |
210 |
Kill a monit daemon process</p> |
Kill a monit daemon process</P> |
211 |
<p><strong>validate</strong> |
<P><STRONG>validate</STRONG> |
212 |
Check all services listed in the control file. This |
Check all services listed in the control file. This |
213 |
action is also the default behavior when monit runs |
action is also the default behavior when monit runs |
214 |
in daemon mode.</p> |
in daemon mode.</P> |
215 |
<p> |
<P> |
216 |
</p> |
<HR> |
217 |
<hr /> |
<H1><A NAME="what to monitor">WHAT TO MONITOR</A></H1> |
218 |
<h1><a name="what_to_monitor">WHAT TO MONITOR</a></h1> |
<P>You may use monit to monitor daemon processes or similar programs |
|
<p>You may use monit to monitor daemon processes or similar programs |
|
219 |
running on localhost. Monit is particular useful for monitoring |
running on localhost. Monit is particular useful for monitoring |
220 |
daemon processes, such as those started at system boot time from |
daemon processes, such as those started at system boot time from |
221 |
/etc/init.d/. For instance sendmail, sshd, apache and mysql. In |
/etc/init.d/. For instance sendmail, sshd, apache and mysql. In |
225 |
(e.g. if a DoS attack is in progress) monit can stop or restart |
(e.g. if a DoS attack is in progress) monit can stop or restart |
226 |
apache and send you an alert message. Monit does also monitor |
apache and send you an alert message. Monit does also monitor |
227 |
process characteristics, such as; if a process has become a |
process characteristics, such as; if a process has become a |
228 |
zombie and how much memory or cpu cycles a process is using.</p> |
zombie and how much memory or cpu cycles a process is using.</P> |
229 |
<p>You may also use monit to monitor files, directories and devices |
<P>You may also use monit to monitor files, directories and devices |
230 |
on localhost. Monit can monitor these items for changes, such as |
on localhost. Monit can monitor these items for changes, such as |
231 |
timestamps changes, checksum changes or size changes. This is |
timestamps changes, checksum changes or size changes. This is |
232 |
also useful for security reasons - you can monitor the md5 |
also useful for security reasons - you can monitor the md5 |
233 |
checksum of files that should not change.</p> |
checksum of files that should not change.</P> |
234 |
<p>You may even use monit to monitor remote hosts. First and |
<P>You may even use monit to monitor remote hosts. First and |
235 |
foremost monit is a utility for monitoring and mending services |
foremost monit is a utility for monitoring and mending services |
236 |
on localhost, but if a service depends on a remote service, |
on localhost, but if a service depends on a remote service, |
237 |
e.g. a database server or an application server, it might by |
e.g. a database server or an application server, it might by |
238 |
useful to be able to test a remote host as well.</p> |
useful to be able to test a remote host as well.</P> |
239 |
<p> |
<P> |
240 |
</p> |
<HR> |
241 |
<hr /> |
<H1><A NAME="how to monitor">HOW TO MONITOR</A></H1> |
242 |
<h1><a name="how_to_monitor">HOW TO MONITOR</a></h1> |
<P>monit is configured and controlled via a control file called |
243 |
<p>monit is configured and controlled via a control file called |
<STRONG>monitrc</STRONG>. The default location for this file is ~/.monitrc. If |
|
<strong>monitrc</strong>. The default location for this file is ~/.monitrc. If |
|
244 |
this file does not exist, monit will try /etc/monitrc and finally |
this file does not exist, monit will try /etc/monitrc and finally |
245 |
./monitrc.</p> |
./monitrc.</P> |
246 |
<p>A monit control file consists of a series of service entries and |
<P>A monit control file consists of a series of service entries and |
247 |
global option statements in a free-format, token-oriented syntax. |
global option statements in a free-format, token-oriented syntax. |
248 |
Comments begin with a # and extend through the end of the line. |
Comments begin with a # and extend through the end of the line. |
249 |
There are three kinds of tokens in the control file: grammar |
There are three kinds of tokens in the control file: grammar |
250 |
keywords, numbers and strings.</p> |
keywords, numbers and strings.</P> |
251 |
<p>On a semantic level, the control file consists of two types of |
<P>On a semantic level, the control file consists of two types of |
252 |
entries:</p> |
entries:</P> |
253 |
<ol> |
<OL> |
254 |
<li><strong><a name="item_global_set%2dstatements">Global set-statements</a></strong><br /> |
<LI><STRONG><A NAME="item_Global_set%2Dstatements">Global set-statements</A></STRONG><BR> |
255 |
</li> |
|
256 |
A global set-statement starts with the keyword <em>set</em> and the |
A global set-statement starts with the keyword <EM>set</EM> and the |
257 |
item to configure. |
item to configure. |
258 |
<p></p> |
<P></P> |
259 |
<li><strong><a name="item_one_or_more_service_entry_statements%2e">One or more service entry statements.</a></strong><br /> |
<LI><STRONG><A NAME="item_One_or_more_service_entry_statements%2E">One or more service entry statements.</A></STRONG><BR> |
260 |
</li> |
|
261 |
A service entry starts with the keyword <em>check</em> followed by the |
A service entry starts with the keyword <EM>check</EM> followed by the |
262 |
service type. |
service type. |
263 |
<p></p></ol> |
<P></P></OL> |
264 |
<p>This is the hello galaxy version of a monit control file:</p> |
<P>This is the hello galaxy version of a monit control file:</P> |
265 |
<pre> |
<PRE> |
266 |
# |
# |
267 |
# monit control file |
# monit control file |
268 |
#</pre> |
#</PRE> |
269 |
<pre> |
<PRE> |
270 |
set daemon 120 # Poll at 2-minute intervals |
set daemon 120 # Poll at 2-minute intervals |
271 |
set logfile syslog facility log_daemon |
set logfile syslog facility log_daemon |
272 |
set httpd port 2812 and use address localhost |
set httpd port 2812 and use address localhost |
273 |
allow localhost # Allow localhost to connect |
allow localhost # Allow localhost to connect |
274 |
allow admin:monit # Allow Basic Auth</pre> |
allow admin:monit # Allow Basic Auth</PRE> |
275 |
<pre> |
<PRE> |
276 |
check process apache |
check process apache |
277 |
with pidfile "/usr/local/apache/logs/httpd.pid" |
with pidfile "/usr/local/apache/logs/httpd.pid" |
278 |
start program = "/etc/init.d/httpd start" |
start program = "/etc/init.d/httpd start" |
284 |
if cpu usage > 95% for 3 cycles then restart |
if cpu usage > 95% for 3 cycles then restart |
285 |
if failed port 80 protocol http then restart |
if failed port 80 protocol http then restart |
286 |
group server |
group server |
287 |
depends on httpd.conf, httpd.bin</pre> |
depends on httpd.conf, httpd.bin</PRE> |
288 |
<pre> |
<PRE> |
289 |
check file httpd.conf |
check file httpd.conf |
290 |
with path /usr/local/apache/conf/httpd.conf |
with path /usr/local/apache/conf/httpd.conf |
291 |
# Restart apache if the httpd.conf file was changed |
# Restart apache if the httpd.conf file was changed |
292 |
if failed checksum |
if failed checksum |
293 |
then exec "/usr/local/apache/bin/apachectl graceful"</pre> |
then exec "/usr/local/apache/bin/apachectl graceful"</PRE> |
294 |
<pre> |
<PRE> |
295 |
check file httpd.bin |
check file httpd.bin |
296 |
with path /usr/local/apache/bin/httpd |
with path /usr/local/apache/bin/httpd |
297 |
# Alert and unmonitor apache if the binary was changed |
# Alert and unmonitor apache if the binary was changed |
298 |
if failed checksum then unmonitor |
if failed checksum then unmonitor |
299 |
alert foo@bar.baz</pre> |
alert foo@bar.baz</PRE> |
300 |
<p>This example illustrate a service entry for monitoring the apache |
<P>This example illustrate a service entry for monitoring the apache |
301 |
web server process as well as related files. The meaning of the |
web server process as well as related files. The meaning of the |
302 |
various statements will be explained in the following sections.</p> |
various statements will be explained in the following sections.</P> |
303 |
<p> |
<P> |
304 |
</p> |
<HR> |
305 |
<hr /> |
<H1><A NAME="logging">LOGGING</A></H1> |
306 |
<h1><a name="logging">LOGGING</a></h1> |
<P>monit will log status and error messages to a log file. If |
307 |
<p>monit will log status and error messages to a log file. If |
<STRONG>syslog</STRONG> is given as a value for the <EM>-l</EM> command-line switch |
308 |
<strong>syslog</strong> is given as a value for the <em>-l</em> command-line switch |
(or the keyword <EM>set logfile syslog</EM> is found in the control |
309 |
(or the keyword <em>set logfile syslog</em> is found in the control |
file) monit will use the <STRONG>syslog</STRONG> system daemon for logging |
|
file) monit will use the <strong>syslog</strong> system daemon for logging |
|
310 |
messages. To turn off logging, simply do not set the logfile in |
messages. To turn off logging, simply do not set the logfile in |
311 |
the control file (and of course, do not use the -l switch)</p> |
the control file (and of course, do not use the -l switch)</P> |
312 |
<p> |
<P> |
313 |
</p> |
<HR> |
314 |
<hr /> |
<H1><A NAME="daemon mode">DAEMON MODE</A></H1> |
315 |
<h1><a name="daemon_mode">DAEMON MODE</a></h1> |
<P>The <EM>-d interval</EM> command-line switch runs monit in daemon |
|
<p>The <em>-d interval</em> command-line switch runs monit in daemon |
|
316 |
mode. You must specify a numeric argument which is a polling |
mode. You must specify a numeric argument which is a polling |
317 |
interval in seconds.</p> |
interval in seconds.</P> |
318 |
<p>In daemon mode, monit detaches from the console, puts itself in |
<P>In daemon mode, monit detaches from the console, puts itself in |
319 |
the background and runs continuously, monitoring each specified |
the background and runs continuously, monitoring each specified |
320 |
service and then goes to sleep for the given poll interval.</p> |
service and then goes to sleep for the given poll interval.</P> |
321 |
<pre> |
<PRE> |
322 |
Simply invoking</pre> |
Simply invoking</PRE> |
323 |
<pre> |
<PRE> |
324 |
monit -d 300</pre> |
monit -d 300</PRE> |
325 |
<p>will poll all services described in your <em>~/.monitrc</em> file every |
<P>will poll all services described in your <EM>~/.monitrc</EM> file every |
326 |
5 minutes.</p> |
5 minutes.</P> |
327 |
<p>It is possible and also strongly recommended to set the poll |
<P>It is possible and also strongly recommended to set the poll |
328 |
interval in your ~/.monitrc file by using 'set daemon <strong>n</strong>', |
interval in your ~/.monitrc file by using 'set daemon <STRONG>n</STRONG>', |
329 |
where <strong>n</strong> is an integer number of seconds. If you do this, |
where <STRONG>n</STRONG> is an integer number of seconds. If you do this, |
330 |
monit will always start in daemon mode (as long as no action |
monit will always start in daemon mode (as long as no action |
331 |
arguments are given).</p> |
arguments are given).</P> |
332 |
<p>Monit makes a per-instance lockfile in daemon mode. If you need |
<P>Monit makes a per-instance lockfile in daemon mode. If you need |
333 |
more monit instances, you will need more configuration files, |
more monit instances, you will need more configuration files, |
334 |
each pointing to its own lockfile.</p> |
each pointing to its own lockfile.</P> |
335 |
<p>Calling monit with a monit daemon running in the background sends |
<P>Calling monit with a monit daemon running in the background sends |
336 |
a wakeup signal to the daemon, forcing it to check services |
a wakeup signal to the daemon, forcing it to check services |
337 |
immediately.</p> |
immediately.</P> |
338 |
<p>The <em>quit</em> argument will kill a running daemon process instead |
<P>The <EM>quit</EM> argument will kill a running daemon process instead |
339 |
of waking it up.</p> |
of waking it up.</P> |
340 |
<p> |
<P> |
341 |
</p> |
<HR> |
342 |
<hr /> |
<H1><A NAME="init support">INIT SUPPORT</A></H1> |
343 |
<h1><a name="init_support">INIT SUPPORT</a></h1> |
<P>Monit can run and be controlled from <EM>init</EM>. If monit should |
344 |
<p>Monit can run and be controlled from <em>init</em>. If monit should |
crash <EM>init</EM> will re-spawn a new monit process. Using init to |
|
crash <em>init</em> will re-spawn a new monit process. Using init to |
|
345 |
start monit is probably the best way to run monit if you want to |
start monit is probably the best way to run monit if you want to |
346 |
be certain that you always have a running monit daemon on your |
be certain that you always have a running monit daemon on your |
347 |
system. (It's obvious, but never the less worth to stress; Make |
system. (It's obvious, but never the less worth to stress; Make |
348 |
sure that the control file does not have any syntax errors before |
sure that the control file does not have any syntax errors before |
349 |
you start monit from init. Also, make sure that if you run monit |
you start monit from init. Also, make sure that if you run monit |
350 |
from init, that you do not start monit in your startup scripts as |
from init, that you do not start monit in your startup scripts as |
351 |
well).</p> |
well).</P> |
352 |
<p>To setup monit to run from init, you can either use the 'set |
<P>To setup monit to run from init, you can either use the 'set |
353 |
init' statement in monit's control file or use the -I option from |
init' statement in monit's control file or use the -I option from |
354 |
the command line. Here is a sample /etc/inittab entry for monit:</p> |
the command line. Here is a sample /etc/inittab entry for monit:</P> |
355 |
<pre> |
<PRE> |
356 |
# Run monit in standard run-levels |
# Run monit in standard run-levels |
357 |
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc</pre> |
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc</PRE> |
358 |
<p>After you have modified init's configuration file, you can run |
<P>After you have modified init's configuration file, you can run |
359 |
the following command to re-examine /etc/inittab and start monit:</p> |
the following command to re-examine /etc/inittab and start monit:</P> |
360 |
<pre> |
<PRE> |
361 |
telinit q |
telinit q |
362 |
|
</PRE> |
363 |
For systems without telinit:</pre> |
<PRE> |
364 |
<pre> |
|
365 |
kill -1 1</pre> |
For systems without telinit:</PRE> |
366 |
<p>In the case, that you are using SYSV init script for starting the |
<PRE> |
367 |
|
kill -1 1</PRE> |
368 |
|
<P>In the case, that you are using SYSV init script for starting the |
369 |
monitored services and monit (either from init or rc its own rc |
monitored services and monit (either from init or rc its own rc |
370 |
script), in the special case of slow starting monitored service |
script), in the special case of slow starting monitored service |
371 |
you can observe the race condition between particular service's |
you can observe the race condition between particular service's |
372 |
startup and its monitoring. In such case monit can produce false |
startup and its monitoring. In such case monit can produce false |
373 |
alarms. Possible solutions:</p> |
alarms. Possible solutions:</P> |
374 |
<dl> |
<DL> |
375 |
<dt><strong><a name="item_start_critical_services_from_monit_directly%3a">start critical services from monit directly:</a></strong><br /> |
<DT><STRONG><A NAME="item_start_critical_services_from_monit_directly%3A">start critical services from monit directly:</A></STRONG><BR> |
376 |
</dt> |
<DD> |
|
<dd> |
|
377 |
This is the recommended solution - monit will takeover the |
This is the recommended solution - monit will takeover the |
378 |
responsibility for service's startup. To use it you need to |
responsibility for service's startup. To use it you need to |
379 |
replace the service's start and stop in appropriate runlevels. |
replace the service's start and stop in appropriate runlevels. |
380 |
You can use for example on RedHat: |
You can use for example on RedHat: |
381 |
</dd> |
<PRE> |
382 |
<dd> |
chkconfig myprocess off</PRE> |
383 |
<pre> |
<P>on Debian:</P> |
384 |
chkconfig myprocess off</pre> |
<PRE> |
385 |
</dd> |
update-rc.d -f myprocess remove</PRE> |
386 |
<dd> |
<P>general example:</P> |
387 |
<p>on Debian:</p> |
<PRE> |
388 |
</dd> |
mv /etc/rc2.d/S99myprocess /etc/rc2.d/s99myprocess</PRE> |
389 |
<dd> |
<P>To stop the service on system shutdown, you need either to add |
390 |
<pre> |
for example following line to monit's rc script:</P> |
391 |
update-rc.d -f myprocess remove</pre> |
<PRE> |
392 |
</dd> |
/usr/local/bin/monit -c /etc/monitrc stop myprocess</PRE> |
393 |
<dd> |
<P>or to stop all services:</P> |
394 |
<p>general example:</p> |
<PRE> |
395 |
</dd> |
/usr/local/bin/monit -c /etc/monitrc stop all</PRE> |
396 |
<dd> |
<P>If you are running monit from init then you can add the second |
397 |
<pre> |
line of following example to stop the service:</P> |
398 |
mv /etc/rc2.d/S99myprocess /etc/rc2.d/s99myprocess</pre> |
<PRE> |
|
</dd> |
|
|
<dd> |
|
|
<p>To stop the service on system shutdown, you need either to add |
|
|
for example following line to monit's rc script:</p> |
|
|
</dd> |
|
|
<dd> |
|
|
<pre> |
|
|
/usr/local/bin/monit -c /etc/monitrc stop myprocess</pre> |
|
|
</dd> |
|
|
<dd> |
|
|
<p>or to stop all services:</p> |
|
|
</dd> |
|
|
<dd> |
|
|
<pre> |
|
|
/usr/local/bin/monit -c /etc/monitrc stop all</pre> |
|
|
</dd> |
|
|
<dd> |
|
|
<p>If you are running monit from init then you can add the second |
|
|
line of following example to stop the service:</p> |
|
|
</dd> |
|
|
<dd> |
|
|
<pre> |
|
399 |
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc |
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc |
400 |
m0:06:wait:/usr/local/bin/monit -Ic /etc/monitrc stop myprocess</pre> |
m0:06:wait:/usr/local/bin/monit -Ic /etc/monitrc stop myprocess</PRE> |
401 |
</dd> |
<P>or to stop all services:</P> |
402 |
<dd> |
<PRE> |
|
<p>or to stop all services:</p> |
|
|
</dd> |
|
|
<dd> |
|
|
<pre> |
|
403 |
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc |
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc |
404 |
m0:06:wait:/usr/local/bin/monit -Ic /etc/monitrc stop all</pre> |
m0:06:wait:/usr/local/bin/monit -Ic /etc/monitrc stop all</PRE> |
405 |
</dd> |
<P>The monitored service must have start and stop methods defined, |
406 |
<dd> |
such as for example:</P> |
407 |
<p>The monitored service must have start and stop methods defined, |
<PRE> |
|
such as for example:</p> |
|
|
</dd> |
|
|
<dd> |
|
|
<pre> |
|
408 |
check process myprocess with pidfile /var/run/myprocess.pid |
check process myprocess with pidfile /var/run/myprocess.pid |
409 |
start program = "/etc/init.d/myprocess start" |
start program = "/etc/init.d/myprocess start" |
410 |
stop program = "/etc/init.d/myprocess stop" |
stop program = "/etc/init.d/myprocess stop" |
411 |
alert foo@bar.baz</pre> |
alert foo@bar.baz</PRE> |
412 |
</dd> |
<P></P> |
413 |
<p></p> |
<DT><STRONG><A NAME="item_wait_for_service_to_start">wait for service to start</A></STRONG><BR> |
414 |
<dt><strong><a name="item_wait_for_service_to_start">wait for service to start</a></strong><br /> |
<DD> |
|
</dt> |
|
|
<dd> |
|
415 |
This solution will cause that init process will wait for the service |
This solution will cause that init process will wait for the service |
416 |
to start before it will continue to start other services. If you are |
to start before it will continue to start other services. If you are |
417 |
running monit from init, you must define monit's line as last in |
running monit from init, you must define monit's line as last in |
418 |
/etc/inittab (short example): |
/etc/inittab (short example): |
419 |
</dd> |
<PRE> |
|
<dd> |
|
|
<pre> |
|
420 |
si::sysinit:/etc/init.d/rcS |
si::sysinit:/etc/init.d/rcS |
421 |
... |
... |
422 |
l2:2:wait:/etc/init.d/rc 2 |
l2:2:wait:/etc/init.d/rc 2 |
423 |
... |
... |
424 |
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc</pre> |
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc</PRE> |
425 |
</dd> |
<P>The rc script of the monitored service must be modified so, that it |
|
<dd> |
|
|
<p>The rc script of the monitored service must be modified so, that it |
|
426 |
will not return unless the service will be online or the startup |
will not return unless the service will be online or the startup |
427 |
timed out. As dumb method sleep is sufficient.</p> |
timed out. As dumb method sleep is sufficient.</P> |
428 |
</dd> |
<P>The monitored service must have start and stop methods defined, |
429 |
<dd> |
such as for example:</P> |
430 |
<p>The monitored service must have start and stop methods defined, |
<PRE> |
|
such as for example:</p> |
|
|
</dd> |
|
|
<dd> |
|
|
<pre> |
|
431 |
check process myprocess with pidfile /var/run/myprocess.pid |
check process myprocess with pidfile /var/run/myprocess.pid |
432 |
start program = "/etc/init.d/myprocess start" |
start program = "/etc/init.d/myprocess start" |
433 |
stop program = "/etc/init.d/myprocess stop" |
stop program = "/etc/init.d/myprocess stop" |
434 |
alert foo@bar.baz</pre> |
alert foo@bar.baz</PRE> |
435 |
</dd> |
<P></P> |
436 |
<p></p> |
<DT><STRONG><A NAME="item_enable_the_service_monitoring_manualy">enable the service monitoring manualy</A></STRONG><BR> |
437 |
<dt><strong><a name="item_enable_the_service_monitoring_manualy">enable the service monitoring manualy</a></strong><br /> |
<DD> |
438 |
</dt> |
<PRE> |
|
<dd> |
|
|
<pre> |
|
439 |
check file myprocess.pid with path /var/run/myprocess.pid |
check file myprocess.pid with path /var/run/myprocess.pid |
440 |
if timestamp > 5 minutes then |
if timestamp > 5 minutes then |
441 |
exec "/bin/bash -c ' |
exec "/bin/bash -c ' |
446 |
start program = "/etc/init.d/myprocess start" |
start program = "/etc/init.d/myprocess start" |
447 |
stop program = "/etc/init.d/myprocess stop" |
stop program = "/etc/init.d/myprocess stop" |
448 |
alert foo@bar.baz |
alert foo@bar.baz |
449 |
mode manual</pre> |
mode manual</PRE> |
450 |
</dd> |
<P>This will cause to wait for 5 minutes before it will enable |
451 |
<dd> |
monitoring of the service myprocess.</P> |
452 |
<p>This will cause to wait for 5 minutes before it will enable |
</DL> |
453 |
monitoring of the service myprocess.</p> |
<P> |
454 |
</dd> |
<HR> |
455 |
</dl> |
<H1><A NAME="group support">GROUP SUPPORT</A></H1> |
456 |
<p> |
<P>Service entries in the control file, <EM>monitrc</EM>, can be grouped |
457 |
</p> |
together by the <EM>group</EM> statement. The syntax is simply (keyword |
458 |
<hr /> |
in capital):</P> |
459 |
<h1><a name="group_support">GROUP SUPPORT</a></h1> |
<PRE> |
460 |
<p>Service entries in the control file, <em>monitrc</em>, can be grouped |
GROUP groupname</PRE> |
461 |
together by the <em>group</em> statement. The syntax is simply (keyword |
<P>With this statement it is possible to group similar service |
|
in capital):</p> |
|
|
<pre> |
|
|
GROUP groupname</pre> |
|
|
<p>With this statement it is possible to group similar service |
|
462 |
entries together and manage them as a whole. Monit provides |
entries together and manage them as a whole. Monit provides |
463 |
functions to start, stop and restart a group of services, like |
functions to start, stop and restart a group of services, like |
464 |
so:</p> |
so:</P> |
465 |
<p>To start a group of services from the console:</p> |
<P>To start a group of services from the console:</P> |
466 |
<pre> |
<PRE> |
467 |
monit -g <groupname> start</pre> |
monit -g <groupname> start</PRE> |
468 |
<p>To stop a group of services:</p> |
<P>To stop a group of services:</P> |
469 |
<pre> |
<PRE> |
470 |
monit -g <groupname> stop</pre> |
monit -g <groupname> stop</PRE> |
471 |
<p>To restart a group of services:</p> |
<P>To restart a group of services:</P> |
472 |
<pre> |
<PRE> |
473 |
monit -g <groupname> restart</pre> |
monit -g <groupname> restart</PRE> |
474 |
<p>Show the status of a service group:</p> |
<P>Show the status of a service group:</P> |
475 |
<pre> |
<PRE> |
476 |
monit -g <groupname> status</pre> |
monit -g <groupname> status</PRE> |
477 |
<p> |
<P> |
478 |
</p> |
<HR> |
479 |
<hr /> |
<H1><A NAME="monitoring mode">MONITORING MODE</A></H1> |
480 |
<h1><a name="monitoring_mode">MONITORING MODE</a></h1> |
<P>Monit supports three monitoring modes per service: <EM>active</EM>, |
481 |
<p>Monit supports three monitoring modes per service: <em>active</em>, |
<EM>passive</EM> and <EM>manual</EM>. See also the example section below for |
482 |
<em>passive</em> and <em>manual</em>. See also the example section below for |
usage of the mode statement.</P> |
483 |
usage of the mode statement.</p> |
<P>In <EM>active</EM> mode, monit will monitor a service and in case of |
|
<p>In <em>active</em> mode, monit will monitor a service and in case of |
|
484 |
problems monit will act and raise alerts, start, stop or restart |
problems monit will act and raise alerts, start, stop or restart |
485 |
the service. Active mode is the default mode.</p> |
the service. Active mode is the default mode.</P> |
486 |
<p>In <em>passive</em> mode, monit will passively monitor a service and |
<P>In <EM>passive</EM> mode, monit will passively monitor a service and |
487 |
specifically <strong>not</strong> try to fix a problem, but it will still raise |
specifically <STRONG>not</STRONG> try to fix a problem, but it will still raise |
488 |
alerts in case of a problem.</p> |
alerts in case of a problem.</P> |
489 |
<p>For use in clustered environments there is also a <em>manual</em> |
<P>For use in clustered environments there is also a <EM>manual</EM> |
490 |
mode. In this mode, monit will enter <em>active</em> mode <strong>only</strong> if a |
mode. In this mode, monit will enter <EM>active</EM> mode <STRONG>only</STRONG> if a |
491 |
service was brought under monit's control, for example by |
service was brought under monit's control, for example by |
492 |
executing the following command in the console:</p> |
executing the following command in the console:</P> |
493 |
<pre> |
<PRE> |
494 |
monit start sybase |
monit start sybase |
495 |
(monit will call sybase's start method and enable monitoring)</pre> |
(monit will call sybase's start method and enable monitoring)</PRE> |
496 |
<p>If a service was not started by monit or was stopped or disabled |
<P>If a service was not started by monit or was stopped or disabled |
497 |
for example by:</p> |
for example by:</P> |
498 |
<pre> |
<PRE> |
499 |
monit stop sybase |
monit stop sybase |
500 |
(monit will call sybase's stop method and disable monitoring)</pre> |
(monit will call sybase's stop method and disable monitoring)</PRE> |
501 |
<p>monit will not monitor the service. This allows for having |
<P>monit will not monitor the service. This allows for having |
502 |
services configured in monitrc and start it with monit only if it |
services configured in monitrc and start it with monit only if it |
503 |
should run. This feature can be used to build a simple failsafe |
should run. This feature can be used to build a simple failsafe |
504 |
cluster. To see how, read more about how to setup a cluster with |
cluster. To see how, read more about how to setup a cluster with |
505 |
monit using the <em>heartbeat</em> system in the examples sections |
monit using the <EM>heartbeat</EM> system in the examples sections |
506 |
below.</p> |
below.</P> |
507 |
<p> |
<P> |
508 |
</p> |
<HR> |
509 |
<hr /> |
<H1><A NAME="alert messages">ALERT MESSAGES</A></H1> |
510 |
<h1><a name="alert_messages">ALERT MESSAGES</a></h1> |
<P>monit will raise an email alert if:</P> |
511 |
<p>monit will raise an email alert if:</p> |
<PRE> |
|
<pre> |
|
512 |
o A service timed out |
o A service timed out |
513 |
o A service was stopped |
o A service was stopped |
514 |
o A port connection failed |
o A port connection failed |
520 |
o A service was started or restarted |
o A service was started or restarted |
521 |
o A file/directory/device uid error occurred |
o A file/directory/device uid error occurred |
522 |
o A file/directory/device gid error occurred |
o A file/directory/device gid error occurred |
523 |
o Monitoring of a service was disabled (unmonitor)</pre> |
o Monitoring of a service was disabled (unmonitor)</PRE> |
524 |
<p>You should use an alert statement to notify monit that you want |
<P>You should use an alert statement to notify monit that you want |
525 |
alert messages sent to an email address. If you do not specify an |
alert messages sent to an email address. If you do not specify an |
526 |
alert statement, monit will not send alert messages.</p> |
alert statement, monit will not send alert messages.</P> |
527 |
<p>An alert statement is bound to a service entry and you can also |
<P>An alert statement is bound to a service entry and you can also |
528 |
use more than one alert statement in an entry. In other words, |
use more than one alert statement in an entry. In other words, |
529 |
you can send many different emails to many different |
you can send many different emails to many different |
530 |
addresses. (Just to make it clear, in case you now got a new |
addresses. (Just to make it clear, in case you now got a new |
531 |
business idea; monit is not suitable for sending spam). The full |
business idea; monit is not suitable for sending spam). The full |
532 |
syntax for the alert statement is as follows (keywords are in |
syntax for the alert statement is as follows (keywords are in |
533 |
capital):</p> |
capital):</P> |
534 |
<dl> |
<DL> |
535 |
<dt><strong><a name="item_alert_mail%2daddress_%5b%7bevents%7d%5d_%5bmail%2d">ALERT mail-address [{events}] [MAIL-FORMAT {mail-format}]</a></strong><br /> |
<DT><STRONG><A NAME="item_ALERT_mail%2Daddress_%5B%7Bevents%7D%5D_%5BMAIL%2D">ALERT mail-address [{events}] [MAIL-FORMAT {mail-format}]</A></STRONG><BR> |
536 |
</dt> |
<DD> |
537 |
</dl> |
</DL> |
538 |
<p>Simply using:</p> |
<P>Simply using:</P> |
539 |
<pre> |
<PRE> |
540 |
alert foo@bar</pre> |
alert foo@bar</PRE> |
541 |
<p>will send a default email alert to the address foo@bar whenever |
<P>will send a default email alert to the address foo@bar whenever |
542 |
an event occurred on the service. Such an event may be that a |
an event occurred on the service. Such an event may be that a |
543 |
service timed out, a service was started or stopped and so on.</p> |
service timed out, a service was started or stopped and so on.</P> |
544 |
<p>If you only want an alert message sent for certain events, for |
<P>If you only want an alert message sent for certain events, for |
545 |
example only for timeout events or only if a service was |
example only for timeout events or only if a service was |
546 |
restarted, then postfix the alert-statement with a filter block, |
restarted, then postfix the alert-statement with a filter block, |
547 |
respectively:</p> |
respectively:</P> |
548 |
<pre> |
<PRE> |
549 |
alert foo@bar only on { timeout } and |
alert foo@bar only on { timeout } and |
550 |
alert foo@bar only on { restart }</pre> |
alert foo@bar only on { restart }</PRE> |
551 |
<p>(<em>only</em> and <em>on</em> are noise keywords, ignored by monit. As a |
<P>(<EM>only</EM> and <EM>on</EM> are noise keywords, ignored by monit. As a |
552 |
side note; Noise keywords are used in the control file grammar to |
side note; Noise keywords are used in the control file grammar to |
553 |
make an entry resemble English and thus make it easier to read |
make an entry resemble English and thus make it easier to read |
554 |
(or, so goes the philosophy). The full set of available noise |
(or, so goes the philosophy). The full set of available noise |
555 |
keywords are listed below in the Control File section)</p> |
keywords are listed below in the Control File section)</P> |
556 |
<p>It is also possible to combine alert events and send mail to |
<P>It is also possible to combine alert events and send mail to |
557 |
different email addresses depending on the events. Like so:</p> |
different email addresses depending on the events. Like so:</P> |
558 |
<pre> |
<PRE> |
559 |
alert foo@bar { restart, timeout, resource, connection } |
alert foo@bar { restart, timeout, resource, connection } |
560 |
alert security@bar on { checksum, permission, uid, gid, stop } |
alert security@bar on { checksum, permission, uid, gid, stop } |
561 |
alert manager@bar</pre> |
alert manager@bar</PRE> |
562 |
<p>This will send an alert message to foo@bar whenever a restart, |
<P>This will send an alert message to foo@bar whenever a restart, |
563 |
timeout, resource or connection error occurs and a message to |
timeout, resource or connection error occurs and a message to |
564 |
security@bar if a checksum, permission, uid, gid or stop error |
security@bar if a checksum, permission, uid, gid or stop error |
565 |
occurs. And finally, a message to manager@bar whenever any error |
occurs. And finally, a message to manager@bar whenever any error |
566 |
event occurs.</p> |
event occurs.</P> |
567 |
<p>The following alert-statement:</p> |
<P>The following alert-statement:</P> |
568 |
<pre> |
<PRE> |
569 |
alert foo@bar {uid |
alert foo@bar {uid |
570 |
gid |
gid |
571 |
size |
size |
578 |
timestamp |
timestamp |
579 |
unmonitor |
unmonitor |
580 |
connection |
connection |
581 |
permission}</pre> |
permission}</PRE> |
582 |
<p>is equivalent to:</p> |
<P>is equivalent to:</P> |
583 |
<pre> |
<PRE> |
584 |
alert foo@bar</pre> |
alert foo@bar</PRE> |
585 |
<p> |
<P> |
586 |
</p> |
<H2><A NAME="alert message layout">Alert message layout</A></H2> |
587 |
<h2><a name="alert_message_layout">Alert message layout</a></h2> |
<P>monit provides a default mail message layout that is short and to |
|
<p>monit provides a default mail message layout that is short and to |
|
588 |
the point. Here's an example of a standard alert mail sent by |
the point. Here's an example of a standard alert mail sent by |
589 |
monit:</p> |
monit:</P> |
590 |
<pre> |
<PRE> |
591 |
From: monit@tildeslash.com |
From: monit@tildeslash.com |
592 |
Subject: monit alert -- Restarted apache |
Subject: monit alert -- Restarted apache |
593 |
To: hauk@tildeslash.com |
To: hauk@tildeslash.com |
594 |
Date: Thu, 04 Sep 2003 02:33:03 +0200</pre> |
Date: Thu, 04 Sep 2003 02:33:03 +0200</PRE> |
595 |
<pre> |
<PRE> |
596 |
Restarted Service apache</pre> |
Restarted Service apache</PRE> |
597 |
<pre> |
<PRE> |
598 |
Date: Thu, 04 Sep 2003 02:33:03 +0200 |
Date: Thu, 04 Sep 2003 02:33:03 +0200 |
599 |
Host: www.tildeslash.com</pre> |
Host: www.tildeslash.com</PRE> |
600 |
<pre> |
<PRE> |
601 |
Your faithful employee, |
Your faithful employee, |
602 |
monit</pre> |
monit</PRE> |
603 |
<p>If you want to, you can change the format of this message with |
<P>If you want to, you can change the format of this message with |
604 |
the optional <em>mail-format</em> statement. The syntax for this |
the optional <EM>mail-format</EM> statement. The syntax for this |
605 |
statement is as follows:</p> |
statement is as follows:</P> |
606 |
<pre> |
<PRE> |
607 |
mail-format { |
mail-format { |
608 |
from: monit@localhost |
from: monit@localhost |
609 |
subject: $SERVICE $EVENT at $DATE |
subject: $SERVICE $EVENT at $DATE |
610 |
message: Monit restarted $SERVICE at $DATE on $HOST. |
message: Monit restarted $SERVICE at $DATE on $HOST. |
611 |
Yours sincerely, |
Yours sincerely, |
612 |
monit |
monit |
613 |
}</pre> |
}</PRE> |
614 |
<p>Where the keyword <em>from:</em> is the email address monit should |
<P>Where the keyword <EM>from:</EM> is the email address monit should |
615 |
pretend it is sending from. It does not have to be a real mail |
pretend it is sending from. It does not have to be a real mail |
616 |
address, but it must be a proper formated mail address, on the |
address, but it must be a proper formated mail address, on the |
617 |
form: name@domain. The keyword <em>subject:</em> is for the email |
form: name@domain. The keyword <EM>subject:</EM> is for the email |
618 |
subject line. The subject must be on only <em>one</em> line. The |
subject line. The subject must be on only <EM>one</EM> line. The |
619 |
<em>message:</em> keyword denotes the mail body. If used, this keyword |
<EM>message:</EM> keyword denotes the mail body. If used, this keyword |
620 |
should always be the last in a mail-format statement. The mail |
should always be the last in a mail-format statement. The mail |
621 |
body can be as long as you want and must <strong>not</strong> contain the '}' |
body can be as long as you want and must <STRONG>not</STRONG> contain the '}' |
622 |
character.</p> |
character.</P> |
623 |
<p>All of these format keywords are optional but you must provide at |
<P>All of these format keywords are optional but you must provide at |
624 |
least one. Thus if you only want to change the from address monit |
least one. Thus if you only want to change the from address monit |
625 |
is using you can do:</p> |
is using you can do:</P> |
626 |
<pre> |
<PRE> |
627 |
alert foo@bar with mail-format { from: bofh@xyzzy.no }</pre> |
alert foo@bar with mail-format { from: bofh@xyzzy.no }</PRE> |
628 |
<p>From the previous example you will notice that 4 special |
<P>From the previous example you will notice that 4 special |
629 |
variables was used. If used, they will be substituted and |
variables was used. If used, they will be substituted and |
630 |
expanded into the text with these values:</p> |
expanded into the text with these values:</P> |
631 |
<ul> |
<UL> |
632 |
<li></li> |
<LI> |
633 |
<em>$EVENT</em> A string describing the event that occurred. The values |
<EM>$EVENT</EM> A string describing the event that occurred. The values |
634 |
are fixed and are, ``Started'', ``Stopped'', ``Restarted'', Checksum |
are fixed and are, ``Started'', ``Stopped'', ``Restarted'', Checksum |
635 |
changed``, ''Resource limit matched``, ''Timeout``, ''Size rule |
changed``, ''Resource limit matched``, ''Timeout``, ''Size rule |
636 |
matched``, ''Permission error``, ''Connection test failed``, ''UID |
matched``, ''Permission error``, ''Connection test failed``, ''UID |
637 |
error``, ''GID error``, ''Monitoring disabled`` and ''Timestamp rule |
error``, ''GID error``, ''Monitoring disabled`` and ''Timestamp rule |
638 |
matched``. |
matched``. |
639 |
<p></p> |
<P></P> |
640 |
<li></li> |
<LI> |
641 |
<em>$SERVICE</em> The service entry name in monitrc |
<EM>$SERVICE</EM> The service entry name in monitrc |
642 |
<p></p> |
<P></P> |
643 |
<li></li> |
<LI> |
644 |
<em>$DATE</em> The current time and date (RFC 822 date style). |
<EM>$DATE</EM> The current time and date (RFC 822 date style). |
645 |
<p></p> |
<P></P> |
646 |
<li></li> |
<LI> |
647 |
<em>$HOST</em> The name of the host monit is running on |
<EM>$HOST</EM> The name of the host monit is running on |
648 |
<p></p></ul> |
<P></P></UL> |
649 |
<p> |
<P> |
650 |
</p> |
<H2><A NAME="setting a global mail format">Setting a global mail format</A></H2> |
651 |
<h2><a name="setting_a_global_mail_format">Setting a global mail format</a></h2> |
<P>Finally, it is possible to set a standard mail format with the |
652 |
<p>Finally, it is possible to set a standard mail format with the |
following global set-statement (keywords are in capital):</P> |
653 |
following global set-statement (keywords are in capital):</p> |
<DL> |
654 |
<dl> |
<DT><STRONG><A NAME="item_SET_MAIL%2DFORMAT_%7Bmail%2Dformat%7D">SET MAIL-FORMAT {mail-format}</A></STRONG><BR> |
655 |
<dt><strong><a name="item_set_mail%2dformat_%7bmail%2dformat%7d">SET MAIL-FORMAT {mail-format}</a></strong><br /> |
<DD> |
656 |
</dt> |
</DL> |
657 |
</dl> |
<P>Format set with this statement will apply to every alert |
658 |
<p>Format set with this statement will apply to every alert |
statement that does <EM>not</EM> have its own specified mail-format. |
|
statement that does <em>not</em> have its own specified mail-format. |
|
659 |
This statement is most useful for setting a default from address |
This statement is most useful for setting a default from address |
660 |
for messages sent by monit, like so:</p> |
for messages sent by monit, like so:</P> |
661 |
<pre> |
<PRE> |
662 |
set mail-format { from: monit@foo.bar.no }</pre> |
set mail-format { from: monit@foo.bar.no }</PRE> |
663 |
<p> |
<P> |
664 |
</p> |
<HR> |
665 |
<hr /> |
<H1><A NAME="service timeout">SERVICE TIMEOUT</A></H1> |
666 |
<h1><a name="service_timeout">SERVICE TIMEOUT</a></h1> |
<P><STRONG>monit</STRONG> provides a service timeout mechanism for situations |
|
<p><strong>monit</strong> provides a service timeout mechanism for situations |
|
667 |
where a service simply refuses to start or respond over a longer |
where a service simply refuses to start or respond over a longer |
668 |
period. In cases like this, and particularly if monits poll-cycle |
period. In cases like this, and particularly if monits poll-cycle |
669 |
is low, monit will simply increase the machine load by trying to |
is low, monit will simply increase the machine load by trying to |
670 |
restart the service.</p> |
restart the service.</P> |
671 |
<p>The timeout mechanism monit provides is based on two variables, |
<P>The timeout mechanism monit provides is based on two variables, |
672 |
i.e. the number the service has been started and the number of |
i.e. the number the service has been started and the number of |
673 |
poll-cycles. For example, if a service had <em>x</em> restarts within |
poll-cycles. For example, if a service had <EM>x</EM> restarts within |
674 |
<em>y</em> poll-cycles (where <em>x</em> <= <em>y</em>) then monit will timeout and |
<EM>y</EM> poll-cycles (where <EM>x</EM> <= <EM>y</EM>) then monit will timeout and |
675 |
not (re)start the service on the next cycle. If a timeout occurs |
not (re)start the service on the next cycle. If a timeout occurs |
676 |
monit will send you an alert message if you have register |
monit will send you an alert message if you have register |
677 |
interest for this event.</p> |
interest for this event.</P> |
678 |
<p>The syntax for the timestamp statement is as follows (keywords |
<P>The syntax for the timestamp statement is as follows (keywords |
679 |
are in capital):</p> |
are in capital):</P> |
680 |
<dl> |
<DL> |
681 |
<dt><strong><a name="item_cycle">IF NUMBER RESTART NUMBER <code>CYCLE(S)</code> THEN TIMEOUT</a></strong><br /> |
<DT><STRONG><A NAME="item_CYCLE">IF NUMBER RESTART NUMBER <CODE>CYCLE(S)</CODE> THEN TIMEOUT</A></STRONG><BR> |
682 |
</dt> |
<DD> |
683 |
</dl> |
</DL> |
684 |
<p>Where the first number is the number of service restarts and the |
<P>Where the first number is the number of service restarts and the |
685 |
second, the number of poll-cycles. If the number of cycles was |
second, the number of poll-cycles. If the number of cycles was |
686 |
reached without a timeout, the service start-counter is reset to |
reached without a timeout, the service start-counter is reset to |
687 |
zero. This provides some granularity to catch exceptional cases |
zero. This provides some granularity to catch exceptional cases |
688 |
and do a service timeout, but let occasional service start and |
and do a service timeout, but let occasional service start and |
689 |
restarts happen without having an accumulated timeout.</p> |
restarts happen without having an accumulated timeout.</P> |
690 |
<p>Here is an example where monit will timeout (not check the |
<P>Here is an example where monit will timeout (not check the |
691 |
service) if the service was restarted 2 times within 3 cycles:</p> |
service) if the service was restarted 2 times within 3 cycles:</P> |
692 |
<pre> |
<PRE> |
693 |
if 2 restarts within 3 cycles then timeout</pre> |
if 2 restarts within 3 cycles then timeout</PRE> |
694 |
<p>To have monit check the service again after a timeout, run 'monit |
<P>To have monit check the service again after a timeout, run 'monit |
695 |
start service' from the command line. This will remove the |
start service' from the command line. This will remove the |
696 |
timeout lock in the daemon and make the daemon start and check |
timeout lock in the daemon and make the daemon start and check |
697 |
the service again.</p> |
the service again.</P> |
698 |
<p> |
<P> |
699 |
</p> |
<HR> |
700 |
<hr /> |
<H1><A NAME="service tests">SERVICE TESTS</A></H1> |
701 |
<h1><a name="service_tests">SERVICE TESTS</a></h1> |
<P>monit provides several if-tests you may utilize in a service |
|
<p>monit provides several if-tests you may utilize in a service |
|
702 |
entry to test a service. Each if-test statement is on the |
entry to test a service. Each if-test statement is on the |
703 |
following general format:</p> |
following general format:</P> |
704 |
<dl> |
<DL> |
705 |
<dt><strong><a name="item_if_%3ctest%3e_then_action">IF <TEST> THEN ACTION</a></strong><br /> |
<DT><STRONG><A NAME="item_IF_%3CTEST%3E_THEN_ACTION">IF <TEST> THEN ACTION</A></STRONG><BR> |
706 |
</dt> |
<DD> |
707 |
</dl> |
</DL> |
708 |
<p>If the <TEST> should validate to true then the selected action is |
<P>If the <TEST> should validate to true then the selected action is |
709 |
executed. You must select an action to be executed from this |
executed. You must select an action to be executed from this |
710 |
list:</p> |
list:</P> |
711 |
<ul> |
<UL> |
712 |
<li></li> |
<LI> |
713 |
<strong>ALERT</strong> sends the user an alert event. |
<STRONG>ALERT</STRONG> sends the user an alert event. |
714 |
<p></p> |
<P></P> |
715 |
<li></li> |
<LI> |
716 |
<strong>RESTART</strong> restarts the service <em>and</em> sends an alert. Restart is |
<STRONG>RESTART</STRONG> restarts the service <EM>and</EM> sends an alert. Restart is |
717 |
conducted by first calling the service's registered stop method |
conducted by first calling the service's registered stop method |
718 |
and then the service's start method. |
and then the service's start method. |
719 |
<p></p> |
<P></P> |
720 |
<li></li> |
<LI> |
721 |
<strong>STOP</strong> stops the service by calling the service's registered stop |
<STRONG>STOP</STRONG> stops the service by calling the service's registered stop |
722 |
method <em>and</em> send an alert. If monit stops a service it will not |
method <EM>and</EM> send an alert. If monit stops a service it will not |
723 |
be checked by monit anymore nor restarted again later. To |
be checked by monit anymore nor restarted again later. To |
724 |
reactivate monitoring of the service again you must explicitly |
reactivate monitoring of the service again you must explicitly |
725 |
enable monitoring from the web interface or from the console, |
enable monitoring from the web interface or from the console, |
726 |
e.g. 'monit monitor apache'. |
e.g. 'monit monitor apache'. |
727 |
<p></p> |
<P></P> |
728 |
<li></li> |
<LI> |
729 |
<strong>EXEC</strong> may be used to execute an arbitrary program <em>and</em> send |
<STRONG>EXEC</STRONG> may be used to execute an arbitrary program <EM>and</EM> send |
730 |
an alert. If you choose this action you must state the program to |
an alert. If you choose this action you must state the program to |
731 |
be executed. You may also optionally specify the uid and gid the |
be executed. You may also optionally specify the uid and gid the |
732 |
executed program should switch to upon start. For instance: |
executed program should switch to upon start. For instance: |
733 |
<pre> |
<PRE> |
734 |
exec "/usr/local/tomcat/bin/startup.sh" |
exec "/usr/local/tomcat/bin/startup.sh" |
735 |
as uid nobody and gid nobody</pre> |
as uid nobody and gid nobody</PRE> |
736 |
<p>This may be useful if the program to be started cannot change to |
<P>This may be useful if the program to be started cannot change to |
737 |
a lesser privileged user and group. This is typically needed for |
a lesser privileged user and group. This is typically needed for |
738 |
Java Servers. If monit is run by the superuser, the program monit |
Java Servers. If monit is run by the superuser, the program monit |
739 |
execute will be started with superuser privileges unless the uid |
execute will be started with superuser privileges unless the uid |
740 |
and gid extension was used.</p> |
and gid extension was used.</P> |
741 |
<p></p> |
<P></P> |
742 |
<li></li> |
<LI> |
743 |
<strong>UNMONITOR</strong> will disable monitoring of the service <em>and</em> send |
<STRONG>UNMONITOR</STRONG> will disable monitoring of the service <EM>and</EM> send |
744 |
an alert. The service will not be checked by monit anymore nor |
an alert. The service will not be checked by monit anymore nor |
745 |
restarted again later. To reactivate monitoring of the service |
restarted again later. To reactivate monitoring of the service |
746 |
you must explicitly enable monitoring from monit's web interface |
you must explicitly enable monitoring from monit's web interface |
747 |
or from the console using the monitor argument. |
or from the console using the monitor argument. |
748 |
<p></p></ul> |
<P></P></UL> |
749 |
<p> |
<P> |
750 |
</p> |
<H2><A NAME="resource testing">RESOURCE TESTING</A></H2> |
751 |
<h2><a name="resource_testing">RESOURCE TESTING</a></h2> |
<P>Monit can examine how much system resources a service or the |
|
<p>Monit can examine how much system resources a service or the |
|
752 |
system is using. This test may only be used within a process |
system is using. This test may only be used within a process |
753 |
service entry in the monit control file.</p> |
service entry in the monit control file.</P> |
754 |
<p>Depending on process characteristics, services can be stopped or |
<P>Depending on process characteristics, services can be stopped or |
755 |
restarted and alerts can be generated. Thus it is possible to |
restarted and alerts can be generated. Thus it is possible to |
756 |
utilize systems which are idle and to spare system under high |
utilize systems which are idle and to spare system under high |
757 |
load.</p> |
load.</P> |
758 |
<p>The full syntax for the resource-statements used for resource |
<P>The full syntax for the resource-statements used for resource |
759 |
testing is as follows (keywords are in capital and optional |
testing is as follows (keywords are in capital and optional |
760 |
statements in [brackets]),</p> |
statements in [brackets]),</P> |
761 |
<dl> |
<DL> |
762 |
<dt><strong><a name="item_if_resource_operator_value_%5bcycles%5d_then_actio">IF resource operator value [cycles] THEN action</a></strong><br /> |
<DT><STRONG><A NAME="item_IF_resource_operator_value_%5Bcycles%5D_THEN_actio">IF resource operator value [cycles] THEN action</A></STRONG><BR> |
763 |
</dt> |
<DD> |
764 |
</dl> |
</DL> |
765 |
<p><em>resource</em> is a choice of ``CPU'', ``MEMORY'', ``CHILDREN'', |
<P><EM>resource</EM> is a choice of ``CPU'', ``MEMORY'', ``CHILDREN'', |
766 |
``TOTALMEMORY'', ``LOADAVG([1min|5min|15min]):</p> |
``TOTALMEMORY'', ``LOADAVG([1min|5min|15min]):</P> |
767 |
<p>CPU is the CPU usage of the process and it's children in |
<P>CPU is the CPU usage of the process and it's children in |
768 |
parts of hundred (percent).</p> |
parts of hundred (percent).</P> |
769 |
<p>MEMORY is the memory usage of the process without it's child |
<P>MEMORY is the memory usage of the process without it's child |
770 |
processes in either percent (of the systems total) or as an |
processes in either percent (of the systems total) or as an |
771 |
amount (Byte, kB, MB, GB).</p> |
amount (Byte, kB, MB, GB).</P> |
772 |
<p>CHILDREN is the number of child processes of the process.</p> |
<P>CHILDREN is the number of child processes of the process.</P> |
773 |
<p>TOTALMEMORY is the memory usage of the process and it's child |
<P>TOTALMEMORY is the memory usage of the process and it's child |
774 |
processes in either percent or as an amount (Byte, kB, MB, GB).</p> |
processes in either percent or as an amount (Byte, kB, MB, GB).</P> |
775 |
<p><code>LOADAVG([1min|5min|15min])</code> refers to the system's load average. |
<P><CODE>LOADAVG([1min|5min|15min])</CODE> refers to the system's load average. |
776 |
The load average is the number of processes in the system run |
The load average is the number of processes in the system run |
777 |
queue, averaged over the specified time period.</p> |
queue, averaged over the specified time period.</P> |
778 |
<p><em>operator</em> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``gt'', |
<P><EM>operator</EM> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``gt'', |
779 |
``lt'', ``eq'', ``ne'' in shell sh notation and ``greater'', ``less'', |
``lt'', ``eq'', ``ne'' in shell sh notation and ``greater'', ``less'', |
780 |
``equal'', ``notequal'' in human readable form (if not specified, |
``equal'', ``notequal'' in human readable form (if not specified, |
781 |
default is EQUAL).</p> |
default is EQUAL).</P> |
782 |
<p><em>value</em> is either an integer or a real number (except for |
<P><EM>value</EM> is either an integer or a real number (except for |
783 |
CHILDREN). For CPU, MEMORY and TOTALMEMORY you need to specify a |
CHILDREN). For CPU, MEMORY and TOTALMEMORY you need to specify a |
784 |
<em>unit</em>. This could be ``%'' or if applicable ``B'' (Byte), ``kB'' |
<EM>unit</EM>. This could be ``%'' or if applicable ``B'' (Byte), ``kB'' |
785 |
(1024 Byte), ``MB'' (1024 KiloByte) or ``GB'' (1024 MegaByte).</p> |
(1024 Byte), ``MB'' (1024 KiloByte) or ``GB'' (1024 MegaByte).</P> |
786 |
<p><em>cycles</em> is the maximum number of cycles the expression above |
<P><EM>cycles</EM> is the maximum number of cycles the expression above |
787 |
has to be true in order to start an action. To specify the number |
has to be true in order to start an action. To specify the number |
788 |
of cycles you must state a number followed by the keyword CYCLES. |
of cycles you must state a number followed by the keyword CYCLES. |
789 |
If <em>cycles</em> is omitted then the default is one cycle.</p> |
If <EM>cycles</EM> is omitted then the default is one cycle.</P> |
790 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
791 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
792 |
<p>To calculate the cycles, a counter is raised whenever the |
<P>To calculate the cycles, a counter is raised whenever the |
793 |
expression above is true and it is lowered whenever it is false |
expression above is true and it is lowered whenever it is false |
794 |
(but not below 0). All counters are reset in case of a restart.</p> |
(but not below 0). All counters are reset in case of a restart.</P> |
795 |
<p>The following is an example to check that the CPU usage of a |
<P>The following is an example to check that the CPU usage of a |
796 |
service is not going beyond 50% during five poll cycles. If it |
service is not going beyond 50% during five poll cycles. If it |
797 |
does, monit will restart the service:</p> |
does, monit will restart the service:</P> |
798 |
<pre> |
<PRE> |
799 |
if cpu is greater than 50% for 5 cycles then restart</pre> |
if cpu is greater than 50% for 5 cycles then restart</PRE> |
800 |
<p>See also the example section below.</p> |
<P>See also the example section below.</P> |
801 |
<p> |
<P> |
802 |
</p> |
<H2><A NAME="file checksum testing">FILE CHECKSUM TESTING</A></H2> |
803 |
<h2><a name="file_checksum_testing">FILE CHECKSUM TESTING</a></h2> |
<P>If specified in the control file, monit will compute a md5 |
|
<p>If specified in the control file, monit will compute a md5 |
|
804 |
checksum for a file. The checksum is used to verify that a file |
checksum for a file. The checksum is used to verify that a file |
805 |
does not change. The checksum statement may only be used in a |
does not change. The checksum statement may only be used in a |
806 |
file service entry.</p> |
file service entry.</P> |
807 |
<p>The full syntax for the checksum statement is as follows: |
<P>The full syntax for the checksum statement is as follows: |
808 |
(keywords are in capital)</p> |
(keywords are in capital)</P> |
809 |
<dl> |
<DL> |
810 |
<dt><strong><a name="item_if_failed_checksum_%5bexpect_checksum%5d_then_acti">IF FAILED CHECKSUM [EXPECT checksum] THEN action</a></strong><br /> |
<DT><STRONG><A NAME="item_IF_FAILED_CHECKSUM_%5BEXPECT_checksum%5D_THEN_acti">IF FAILED CHECKSUM [EXPECT checksum] THEN action</A></STRONG><BR> |
811 |
</dt> |
<DD> |
812 |
</dl> |
</DL> |
813 |
<p><em>expect</em> is optional and if used specifies a md5 string monit |
<P><EM>expect</EM> is optional and if used specifies a md5 string monit |
814 |
should expect when testing a file's checksum. If <em>expect</em> is |
should expect when testing a file's checksum. If <EM>expect</EM> is |
815 |
used, monit will not compute an initial checksum for the file, |
used, monit will not compute an initial checksum for the file, |
816 |
but instead use the string you submit. For example:</p> |
but instead use the string you submit. For example:</P> |
817 |
<pre> |
<PRE> |
818 |
if failed checksum and |
if failed checksum and |
819 |
expect the sum 8f7f419955cefa0b33a2ba316cba3659 |
expect the sum 8f7f419955cefa0b33a2ba316cba3659 |
820 |
then alert</pre> |
then alert</PRE> |
821 |
<p>You can, for example, use the GNU utility <em>md5sum(1)</em> to create |
<P>You can, for example, use the GNU utility <EM>md5sum(1)</EM> to create |
822 |
a checksum string for a file and then use this string in the |
a checksum string for a file and then use this string in the |
823 |
expect-statement.</p> |
expect-statement.</P> |
824 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
825 |
``UNMONITOR''</p> |
``UNMONITOR''</P> |
826 |
<p>The checksum statement may be used to check a file for changes |
<P>The checksum statement may be used to check a file for changes |
827 |
and if changed, do a specified action. For instance to reload a |
and if changed, do a specified action. For instance to reload a |
828 |
server if its configuration file was changed. The following |
server if its configuration file was changed. The following |
829 |
illustrate this for the apache web server:</p> |
illustrate this for the apache web server:</P> |
830 |
<pre> |
<PRE> |
831 |
check file httpd.conf path /usr/local/apache/conf/httpd.conf |
check file httpd.conf path /usr/local/apache/conf/httpd.conf |
832 |
if failed checksum |
if failed checksum |
833 |
then exec "/usr/local/apache/bin/apachectl restart"</pre> |
then exec "/usr/local/apache/bin/apachectl restart"</PRE> |
834 |
<p>If you plan to use the checksum statement for security reasons, |
<P>If you plan to use the checksum statement for security reasons, |
835 |
(a very good idea, by the way) and to monitor a file or files |
(a very good idea, by the way) and to monitor a file or files |
836 |
which should not change, then please read the DEPENDENCY TREE |
which should not change, then please read the DEPENDENCY TREE |
837 |
section below to see a detailed example on how to do this |
section below to see a detailed example on how to do this |
838 |
properly.</p> |
properly.</P> |
839 |
<p> |
<P> |
840 |
</p> |
<H2><A NAME="timestamp testing">TIMESTAMP TESTING</A></H2> |
841 |
<h2><a name="timestamp_testing">TIMESTAMP TESTING</a></h2> |
<P>Monit can monitor files and directories for timestamp changes. A |
|
<p>Monit can monitor files and directories for timestamp changes. A |
|
842 |
timestamp test may only be used within a file or in a directory |
timestamp test may only be used within a file or in a directory |
843 |
entry in the monit control file.</p> |
entry in the monit control file.</P> |
844 |
<p>The timestamp statement comes in two flavors. The first and basic |
<P>The timestamp statement comes in two flavors. The first and basic |
845 |
version is simply to test an existing file for timestamp changes |
version is simply to test an existing file for timestamp changes |
846 |
and if changed, execute an action. The second, and more compound, |
and if changed, execute an action. The second, and more compound, |
847 |
version is used to test a file or directory for various timestamp |
version is used to test a file or directory for various timestamp |
848 |
changes.</p> |
changes.</P> |
849 |
<p>The full syntax for the timestamp statement is as follows |
<P>The full syntax for the timestamp statement is as follows |
850 |
(keywords are in capital and optional statements in [brackets]):</p> |
(keywords are in capital and optional statements in [brackets]):</P> |
851 |
<ol> |
<OL> |
852 |
<li><strong><a name="item_if_timestamp_was_changed_then_action">IF TIMESTAMP was CHANGED THEN action</a></strong><br /> |
<LI><STRONG><A NAME="item_IF_TIMESTAMP_was_CHANGED_THEN_action">IF TIMESTAMP was CHANGED THEN action</A></STRONG><BR> |
853 |
</li> |
|
854 |
<li><strong><a name="item_if_timestamp_%5boperator%5d_value_%5bunit%5d_then_">IF TIMESTAMP [operator] value [unit] THEN action</a></strong><br /> |
<LI><STRONG><A NAME="item_IF_TIMESTAMP_%5Boperator%5D_value_%5Bunit%5D_THEN_">IF TIMESTAMP [operator] value [unit] THEN action</A></STRONG><BR> |
855 |
</li> |
|
856 |
</ol> |
</OL> |
857 |
<p><em>operator</em> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``GT'', |
<P><EM>operator</EM> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``GT'', |
858 |
``LT'', ``EQ'', ``NE'' in shell sh notation and ``GREATER'', ``LESS'', |
``LT'', ``EQ'', ``NE'' in shell sh notation and ``GREATER'', ``LESS'', |
859 |
``EQUAL'', ``NOTEQUAL'' in human readable form (if not specified, |
``EQUAL'', ``NOTEQUAL'' in human readable form (if not specified, |
860 |
default is EQUAL).</p> |
default is EQUAL).</P> |
861 |
<p><em>value</em> is a time watermark.</p> |
<P><EM>value</EM> is a time watermark.</P> |
862 |
<p><em>unit</em> is either ``SECOND'', ``MINUTE'', ``HOUR'' or ``DAY'' (it is also |
<P><EM>unit</EM> is either ``SECOND'', ``MINUTE'', ``HOUR'' or ``DAY'' (it is also |
863 |
possible to use ``SECONDS'', ``MINUTES'', ``HOURS'', or ``DAYS'').</p> |
possible to use ``SECONDS'', ``MINUTES'', ``HOURS'', or ``DAYS'').</P> |
864 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
865 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
866 |
<p>The basic timestamp statement is useful for checking a file for |
<P>The basic timestamp statement is useful for checking a file for |
867 |
changes and then execute an action. This version was written |
changes and then execute an action. This version was written |
868 |
particularly with configuration files in mind. For instance, if |
particularly with configuration files in mind. For instance, if |
869 |
you monitor the apache web server you can use this statement to |
you monitor the apache web server you can use this statement to |
870 |
reload apache if the <em>httpd.conf</em> (apache's configuration file) |
reload apache if the <EM>httpd.conf</EM> (apache's configuration file) |
871 |
was changed. Like so:</p> |
was changed. Like so:</P> |
872 |
<pre> |
<PRE> |
873 |
check file httpd.conf with path /usr/local/apache/conf/httpd.conf |
check file httpd.conf with path /usr/local/apache/conf/httpd.conf |
874 |
if timestamp was changed |
if timestamp was changed |
875 |
then exec "/usr/local/apache/bin/apachectl graceful"</pre> |
then exec "/usr/local/apache/bin/apachectl graceful"</PRE> |
876 |
<p>The second timestamp version is useful for monitoring systems |
<P>The second timestamp version is useful for monitoring systems |
877 |
able to report its state by changing the timestamp of certain |
able to report its state by changing the timestamp of certain |
878 |
state files. For instance the <em>iPlanet Messaging server stored |
state files. For instance the <EM>iPlanet Messaging server stored |
879 |
process</em> system updates the timestamp of:</p> |
process</EM> system updates the timestamp of:</P> |
880 |
<pre> |
<PRE> |
881 |
o stored.ckp |
o stored.ckp |
882 |
o stored.lcu |
o stored.lcu |
883 |
o stored.per</pre> |
o stored.per</PRE> |
884 |
<p>If a task should fail, the system keeps the timestamp. To report |
<P>If a task should fail, the system keeps the timestamp. To report |
885 |
stored problems you can use the following statements:</p> |
stored problems you can use the following statements:</P> |
886 |
<pre> |
<PRE> |
887 |
check file stored.ckp with path /msg-foo/config/stored.ckp |
check file stored.ckp with path /msg-foo/config/stored.ckp |
888 |
if timestamp > 1 minute then alert</pre> |
if timestamp > 1 minute then alert</PRE> |
889 |
<pre> |
<PRE> |
890 |
check file stored.lcu with path /msg-foo/config/stored.lcu |
check file stored.lcu with path /msg-foo/config/stored.lcu |
891 |
if timestamp 5 minutes then alert</pre> |
if timestamp 5 minutes then alert</PRE> |
892 |
<pre> |
<PRE> |
893 |
check file stored.per with path /msg-foo/config/stored.per |
check file stored.per with path /msg-foo/config/stored.per |
894 |
if timestamp > 1 hour then alert</pre> |
if timestamp > 1 hour then alert</PRE> |
895 |
<p>As mentioned above, you can also use the timestamp statement for |
<P>As mentioned above, you can also use the timestamp statement for |
896 |
monitoring directories for changes. If files are added or removed |
monitoring directories for changes. If files are added or removed |
897 |
from a directory, it's timestamp is changed:</p> |
from a directory, it's timestamp is changed:</P> |
898 |
<pre> |
<PRE> |
899 |
check directory mydir path /foo/directory |
check directory mydir path /foo/directory |
900 |
if timestamp > 1 hour then alert</pre> |
if timestamp > 1 hour then alert</PRE> |
901 |
<p>or</p> |
<P>or</P> |
902 |
<pre> |
<PRE> |
903 |
check directory myotherdir path /foo/secure/directory |
check directory myotherdir path /foo/secure/directory |
904 |
if timestamp < 1 hour then alert</pre> |
if timestamp < 1 hour then alert</PRE> |
905 |
<p>The following example is a hack for restarting a process after a |
<P>The following example is a hack for restarting a process after a |
906 |
certain time. Sometimes this is a necessary workaround for some |
certain time. Sometimes this is a necessary workaround for some |
907 |
third-party applications, until the vendor fix a problem (we |
third-party applications, until the vendor fix a problem (we |
908 |
didn't mention zeus did we?):</p> |
didn't mention zeus did we?):</P> |
909 |
<pre> |
<PRE> |
910 |
check file zerver.pid path /var/run/zerver.pid |
check file zerver.pid path /var/run/zerver.pid |
911 |
if timestamp > 7 days |
if timestamp > 7 days |
912 |
then exec "/usr/local/zerver/restart-zerver"</pre> |
then exec "/usr/local/zerver/restart-zerver"</PRE> |
913 |
<p> |
<P> |
914 |
</p> |
<H2><A NAME="file size testing">FILE SIZE TESTING</A></H2> |
915 |
<h2><a name="file_size_testing">FILE SIZE TESTING</a></h2> |
<P>Monit can monitor files for size changes and act on changes. This |
|
<p>Monit can monitor files for size changes and act on changes. This |
|
916 |
test may only be used within a file service entry in the monit |
test may only be used within a file service entry in the monit |
917 |
control file.</p> |
control file.</P> |
918 |
<p>The size statement also comes in two flavors. The first and basic |
<P>The size statement also comes in two flavors. The first and basic |
919 |
version is simply to test an existing file for size changes and |
version is simply to test an existing file for size changes and |
920 |
if changed, execute an action. The second, and more compound, |
if changed, execute an action. The second, and more compound, |
921 |
version is used to test a file for various size changes.</p> |
version is used to test a file for various size changes.</P> |
922 |
<p>The full syntax for the size statement is as follows |
<P>The full syntax for the size statement is as follows |
923 |
(keywords are in capital and optional statements in [brackets]):</p> |
(keywords are in capital and optional statements in [brackets]):</P> |
924 |
<ol> |
<OL> |
925 |
<li><strong><a name="item_if_size_was_changed_then_action">IF SIZE was CHANGED THEN action</a></strong><br /> |
<LI><STRONG><A NAME="item_IF_SIZE_was_CHANGED_THEN_action">IF SIZE was CHANGED THEN action</A></STRONG><BR> |
926 |
</li> |
|
927 |
<li><strong><a name="item_if_size_%5boperator%5d_value_%5bunit%5d_then_actio">IF SIZE [operator] value [unit] THEN action</a></strong><br /> |
<LI><STRONG><A NAME="item_IF_SIZE_%5Boperator%5D_value_%5Bunit%5D_THEN_actio">IF SIZE [operator] value [unit] THEN action</A></STRONG><BR> |
928 |
</li> |
|
929 |
</ol> |
</OL> |
930 |
<p><em>operator</em> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``GT'', |
<P><EM>operator</EM> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``GT'', |
931 |
``LT'', ``EQ'', ``NE'' in shell sh notation and ``GREATER'', ``LESS'', |
``LT'', ``EQ'', ``NE'' in shell sh notation and ``GREATER'', ``LESS'', |
932 |
``EQUAL'', ``NOTEQUAL'' in human readable form (if not specified, |
``EQUAL'', ``NOTEQUAL'' in human readable form (if not specified, |
933 |
default is EQUAL).</p> |
default is EQUAL).</P> |
934 |
<p><em>value</em> is a size watermark.</p> |
<P><EM>value</EM> is a size watermark.</P> |
935 |
<p><em>unit</em> is a choice of ``B'',``KB'',``MB'',``GB'' or long alternatives |
<P><EM>unit</EM> is a choice of ``B'',``KB'',``MB'',``GB'' or long alternatives |
936 |
``byte'', ``kilobyte'', ``megabyte'', ``gigabyte''. If it is not specified, |
``byte'', ``kilobyte'', ``megabyte'', ``gigabyte''. If it is not specified, |
937 |
``byte'' unit is assumed by default.</p> |
``byte'' unit is assumed by default.</P> |
938 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
939 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
940 |
<p>The basic size statement is useful for checking a file for |
<P>The basic size statement is useful for checking a file for |
941 |
changes and send an alert or execute an action. Monit will |
changes and send an alert or execute an action. Monit will |
942 |
register the size of the file at startup and monitor the file for |
register the size of the file at startup and monitor the file for |
943 |
changes. One example of use for this statement is to conduct |
changes. One example of use for this statement is to conduct |
944 |
security checks, for instance:</p> |
security checks, for instance:</P> |
945 |
<pre> |
<PRE> |
946 |
check file su with path /bin/su |
check file su with path /bin/su |
947 |
if size was changed then exec "/sbin/ifconfig eth0 down"</pre> |
if size was changed then exec "/sbin/ifconfig eth0 down"</PRE> |
948 |
<p>which will ``cut the cable'' and stop a possible intruder from |
<P>which will ``cut the cable'' and stop a possible intruder from |
949 |
compromising the system further. This test is just one of many |
compromising the system further. This test is just one of many |
950 |
you may use to increase the security awareness on a system. If |
you may use to increase the security awareness on a system. If |
951 |
you plan to use monit for security reasons we recommend that you |
you plan to use monit for security reasons we recommend that you |
952 |
use this test in combination with other supported tests like |
use this test in combination with other supported tests like |
953 |
checksum, timestamp, and so on.</p> |
checksum, timestamp, and so on.</P> |
954 |
<p>The second size version may be useful in different contexts. It |
<P>The second size version may be useful in different contexts. It |
955 |
can, for instance, be used to test if a certain file size was |
can, for instance, be used to test if a certain file size was |
956 |
exceeded and then alert you or monit may execute a certain action |
exceeded and then alert you or monit may execute a certain action |
957 |
specified by you. An example is to use this statement to rotate |
specified by you. An example is to use this statement to rotate |
958 |
log files after they have reached a certain size or to check that |
log files after they have reached a certain size or to check that |
959 |
a database file does not grow beyond a specified threshold.</p> |
a database file does not grow beyond a specified threshold.</P> |
960 |
<p>To rotate a log file:</p> |
<P>To rotate a log file:</P> |
961 |
<pre> |
<PRE> |
962 |
check file myapp.log with path /var/log/myapp.log |
check file myapp.log with path /var/log/myapp.log |
963 |
if size > 50 MB then |
if size > 50 MB then |
964 |
exec "/usr/local/bin/rotate /var/log/myapp.log myapp"</pre> |
exec "/usr/local/bin/rotate /var/log/myapp.log myapp"</PRE> |
965 |
<p>where /usr/local/bin/rotate may be a simple script, such as:</p> |
<P>where /usr/local/bin/rotate may be a simple script, such as:</P> |
966 |
<pre> |
<PRE> |
967 |
#/bin/bash |
#/bin/bash |
968 |
/bin/mv $1 $1.`date +%y-%m-%d` |
/bin/mv $1 $1.`date +%y-%m-%d` |
969 |
/usr/bin/pkill -HUP $2</pre> |
/usr/bin/pkill -HUP $2</PRE> |
970 |
<p>Or you may use this statement to trigger the <code>logrotate(8)</code> |
<P>Or you may use this statement to trigger the <CODE>logrotate(8)</CODE> |
971 |
program, to do an ``emergency'' rotate. Or to send an alert if a |
program, to do an ``emergency'' rotate. Or to send an alert if a |
972 |
file becomes a known bottleneck if it grows behind a certain size |
file becomes a known bottleneck if it grows behind a certain size |
973 |
because of limits in a database engine:</p> |
because of limits in a database engine:</P> |
974 |
<pre> |
<PRE> |
975 |
check file mydb with path /data/mydatabase.db |
check file mydb with path /data/mydatabase.db |
976 |
if size > 1 GB then alert</pre> |
if size > 1 GB then alert</PRE> |
977 |
<p>This is a more restrictive form of the first example where the |
<P>This is a more restrictive form of the first example where the |
978 |
size is explicitly defined (Note that this is system dependent):</p> |
size is explicitly defined (Note that this is system dependent):</P> |
979 |
<pre> |
<PRE> |
980 |
check file su with path /bin/su |
check file su with path /bin/su |
981 |
if size != 95564 then exec "/sbin/ifconfig eth0 down"</pre> |
if size != 95564 then exec "/sbin/ifconfig eth0 down"</PRE> |
982 |
<p> |
<P> |
983 |
</p> |
<H2><A NAME="space testing">SPACE TESTING</A></H2> |
984 |
<h2><a name="space_testing">SPACE TESTING</a></h2> |
<P>Monit can test devices/filesystems and check for space |
|
<p>Monit can test devices/filesystems and check for space |
|
985 |
usage. This test may only be used within a device service entry |
usage. This test may only be used within a device service entry |
986 |
in the monit control file.</p> |
in the monit control file.</P> |
987 |
<p>Monit will check a device's total space usage. If you only want |
<P>Monit will check a device's total space usage. If you only want |
988 |
to check available space for non-superuser, you must set the |
to check available space for non-superuser, you must set the |
989 |
watermark appropriately (i.e. total space minus reserved blocks |
watermark appropriately (i.e. total space minus reserved blocks |
990 |
for the superuser).</p> |
for the superuser).</P> |
991 |
<p>You can obtain (and set) the superuser's reserved blocks size, |
<P>You can obtain (and set) the superuser's reserved blocks size, |
992 |
for example by using the tune2fs utility on Linux. On Linux 5% of |
for example by using the tune2fs utility on Linux. On Linux 5% of |
993 |
available blocks are reserved for the superuser by default. To |
available blocks are reserved for the superuser by default. To |
994 |
list the reserved blocks for the superuser:</p> |
list the reserved blocks for the superuser:</P> |
995 |
<pre> |
<PRE> |
996 |
[root@berry monit]# tune2fs -l /dev/hda1| grep "Reserved block" |
[root@berry monit]# tune2fs -l /dev/hda1| grep "Reserved block" |
997 |
Reserved block count: 319994 |
Reserved block count: 319994 |
998 |
Reserved blocks uid: 0 (user root) |
Reserved blocks uid: 0 (user root) |
999 |
Reserved blocks gid: 0 (group root)</pre> |
Reserved blocks gid: 0 (group root)</PRE> |
1000 |
<p>On solaris 10% of the blocks are reserved. You can also use |
<P>On solaris 10% of the blocks are reserved. You can also use |
1001 |
tunefs on solaris to change values on a live filesystem.</p> |
tunefs on solaris to change values on a live filesystem.</P> |
1002 |
<p>The full syntax for the space statement is:</p> |
<P>The full syntax for the space statement is:</P> |
1003 |
<dl> |
<DL> |
1004 |
<dt><strong><a name="item_if_space_operator_value_unit_then_action">IF SPACE operator value unit THEN action</a></strong><br /> |
<DT><STRONG><A NAME="item_IF_SPACE_operator_value_unit_THEN_action">IF SPACE operator value unit THEN action</A></STRONG><BR> |
1005 |
</dt> |
<DD> |
1006 |
</dl> |
</DL> |
1007 |
<p><em>operator</em> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``gt'', |
<P><EM>operator</EM> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``gt'', |
1008 |
``lt'', ``eq'', ``ne'' in shell sh notation and ``greater'', ``less'', |
``lt'', ``eq'', ``ne'' in shell sh notation and ``greater'', ``less'', |
1009 |
``equal'', ``notequal'' in human readable form (if not specified, |
``equal'', ``notequal'' in human readable form (if not specified, |
1010 |
default is EQUAL).</p> |
default is EQUAL).</P> |
1011 |
<p><em>unit</em> is a choice of ``B'',``KB'',``MB'',``GB'', ``%'' or long |
<P><EM>unit</EM> is a choice of ``B'',``KB'',``MB'',``GB'', ``%'' or long |
1012 |
alternatives ``byte'', ``kilobyte'', ``megabyte'', ``gigabyte'', |
alternatives ``byte'', ``kilobyte'', ``megabyte'', ``gigabyte'', |
1013 |
``percent''.</p> |
``percent''.</P> |
1014 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
1015 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
1016 |
<p> |
<P> |
1017 |
</p> |
<H2><A NAME="inode testing">INODE TESTING</A></H2> |
1018 |
<h2><a name="inode_testing">INODE TESTING</a></h2> |
<P>If supported by the file-system, you can use monit to test for |
|
<p>If supported by the file-system, you can use monit to test for |
|
1019 |
inodes usage. This test may only be used within a device service |
inodes usage. This test may only be used within a device service |
1020 |
entry in the monit control file.</p> |
entry in the monit control file.</P> |
1021 |
<p>If the device becomes unavailable, monit will call the entry's |
<P>If the device becomes unavailable, monit will call the entry's |
1022 |
registered start method, if it is defined and if monit is running |
registered start method, if it is defined and if monit is running |
1023 |
in active mode. If monit runs in passive mode or the start |
in active mode. If monit runs in passive mode or the start |
1024 |
methods is not defined, monit will just send an error alert.</p> |
methods is not defined, monit will just send an error alert.</P> |
1025 |
<p>The syntax for the inode statement is:</p> |
<P>The syntax for the inode statement is:</P> |
1026 |
<dl> |
<DL> |
1027 |
<dt><strong><a name="item_inode">IF <code>INODE(S)</code> operator value [unit] THEN action</a></strong><br /> |
<DT><STRONG><A NAME="item_INODE">IF <CODE>INODE(S)</CODE> operator value [unit] THEN action</A></STRONG><BR> |
1028 |
</dt> |
<DD> |
1029 |
</dl> |
</DL> |
1030 |
<p><em>operator</em> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``gt'', |
<P><EM>operator</EM> is a choice of ``<'',``>'',``!='',``=='' in c notation, ``gt'', |
1031 |
``lt'', ``eq'', ``ne'' in shell sh notation and ``greater'', ``less'', |
``lt'', ``eq'', ``ne'' in shell sh notation and ``greater'', ``less'', |
1032 |
``equal'', ``notequal'' in human readable form (if not specified, |
``equal'', ``notequal'' in human readable form (if not specified, |
1033 |
default is EQUAL).</p> |
default is EQUAL).</P> |
1034 |
<p><em>unit</em> is optional. If not specified, the value is an absolute |
<P><EM>unit</EM> is optional. If not specified, the value is an absolute |
1035 |
count of inodes. You can use the ``%'' character or the longer |
count of inodes. You can use the ``%'' character or the longer |
1036 |
alternative ``percent'' as a unit.</p> |
alternative ``percent'' as a unit.</P> |
1037 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
1038 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
1039 |
<p> |
<P> |
1040 |
</p> |
<H2><A NAME="permission testing">PERMISSION TESTING</A></H2> |
1041 |
<h2><a name="permission_testing">PERMISSION TESTING</a></h2> |
<P>Monit can monitor the permissions for files, directories and |
|
<p>Monit can monitor the permissions for files, directories and |
|
1042 |
devices. This test may only be used within a file, directory or |
devices. This test may only be used within a file, directory or |
1043 |
device service entry in the monit control file.</p> |
device service entry in the monit control file.</P> |
1044 |
<p>The syntax for the permission statement is:</p> |
<P>The syntax for the permission statement is:</P> |
1045 |
<dl> |
<DL> |
1046 |
<dt><strong><a name="item_perm">IF FAILED <code>PERM(ISSION)</code> octalnumber THEN action</a></strong><br /> |
<DT><STRONG><A NAME="item_PERM">IF FAILED <CODE>PERM(ISSION)</CODE> octalnumber THEN action</A></STRONG><BR> |
1047 |
</dt> |
<DD> |
1048 |
</dl> |
</DL> |
1049 |
<p><em>octalnumber</em> defines permissions for a file, a directory or a |
<P><EM>octalnumber</EM> defines permissions for a file, a directory or a |
1050 |
device.</p> |
device.</P> |
1051 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
1052 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
1053 |
<p>The web interface will show a permission warning if the test |
<P>The web interface will show a permission warning if the test |
1054 |
failed.</p> |
failed.</P> |
1055 |
<p>We recommend that you use the UNMONITOR action in a permission |
<P>We recommend that you use the UNMONITOR action in a permission |
1056 |
statement. The rationale for this feature is security and that |
statement. The rationale for this feature is security and that |
1057 |
monit does not start a possible cracked program or |
monit does not start a possible cracked program or |
1058 |
script. Example:</p> |
script. Example:</P> |
1059 |
<pre> |
<PRE> |
1060 |
check file monit.bin with path "/usr/local/bin/monit" |
check file monit.bin with path "/usr/local/bin/monit" |
1061 |
if failed permission 0555 then unmonitor |
if failed permission 0555 then unmonitor |
1062 |
alert foo@bar</pre> |
alert foo@bar</PRE> |
1063 |
<p>If the test fails, monit will simply send an alert and stop |
<P>If the test fails, monit will simply send an alert and stop |
1064 |
monitoring the file and propagate an unmonitor action upward in |
monitoring the file and propagate an unmonitor action upward in |
1065 |
a depend tree.</p> |
a depend tree.</P> |
1066 |
<p> |
<P> |
1067 |
</p> |
<H2><A NAME="uid testing">UID TESTING</A></H2> |
1068 |
<h2><a name="uid_testing">UID TESTING</a></h2> |
<P>monit can monitor the owner user id (uid) for files, directories |
|
<p>monit can monitor the owner user id (uid) for files, directories |
|
1069 |
and devices. This test may only be used within a file, directory |
and devices. This test may only be used within a file, directory |
1070 |
or device service entry in the monit control file.</p> |
or device service entry in the monit control file.</P> |
1071 |
<p>The syntax for the uid statement is:</p> |
<P>The syntax for the uid statement is:</P> |
1072 |
<dl> |
<DL> |
1073 |
<dt><strong><a name="item_if_failed_uid_user_then_action">IF FAILED UID user THEN action</a></strong><br /> |
<DT><STRONG><A NAME="item_IF_FAILED_UID_user_THEN_action">IF FAILED UID user THEN action</A></STRONG><BR> |
1074 |
</dt> |
<DD> |
1075 |
</dl> |
</DL> |
1076 |
<p><em>user</em> defines a user id either in numeric or in string form.</p> |
<P><EM>user</EM> defines a user id either in numeric or in string form.</P> |
1077 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
1078 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
1079 |
<p>The web interface will show a uid warning if the test should |
<P>The web interface will show a uid warning if the test should |
1080 |
fail.</p> |
fail.</P> |
1081 |
<p>We recommend that you use the UNMONITOR action in a uid |
<P>We recommend that you use the UNMONITOR action in a uid |
1082 |
statement. The rationale for this feature is security and that |
statement. The rationale for this feature is security and that |
1083 |
monit does not start a possible cracked program or |
monit does not start a possible cracked program or |
1084 |
script. Example:</p> |
script. Example:</P> |
1085 |
<pre> |
<PRE> |
1086 |
check file passwd with path /etc/passwd |
check file passwd with path /etc/passwd |
1087 |
if failed uid root then unmonitor |
if failed uid root then unmonitor |
1088 |
alert root@localhost</pre> |
alert root@localhost</PRE> |
1089 |
<p>If the test fails, monit will simply send an alert and stop |
<P>If the test fails, monit will simply send an alert and stop |
1090 |
monitoring the file and propagate an unmonitor action upward in |
monitoring the file and propagate an unmonitor action upward in |
1091 |
a depend tree.</p> |
a depend tree.</P> |
1092 |
<p> |
<P> |
1093 |
</p> |
<H2><A NAME="gid testing">GID TESTING</A></H2> |
1094 |
<h2><a name="gid_testing">GID TESTING</a></h2> |
<P>monit can monitor the owner group id (gid) for files, directories |
|
<p>monit can monitor the owner group id (gid) for files, directories |
|
1095 |
and devices. This test may only be used within a file, directory |
and devices. This test may only be used within a file, directory |
1096 |
or device service entry in the monit control file.</p> |
or device service entry in the monit control file.</P> |
1097 |
<p>The syntax for the gid statement is:</p> |
<P>The syntax for the gid statement is:</P> |
1098 |
<dl> |
<DL> |
1099 |
<dt><strong><a name="item_if_failed_gid_user_then_action">IF FAILED GID user THEN action</a></strong><br /> |
<DT><STRONG><A NAME="item_IF_FAILED_GID_user_THEN_action">IF FAILED GID user THEN action</A></STRONG><BR> |
1100 |
</dt> |
<DD> |
1101 |
</dl> |
</DL> |
1102 |
<p><em>user</em> defines a group id either in numeric or in string form.</p> |
<P><EM>user</EM> defines a group id either in numeric or in string form.</P> |
1103 |
<p><em>action</em> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><EM>action</EM> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
1104 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
1105 |
<p>The web interface will show a gid warning if the test should |
<P>The web interface will show a gid warning if the test should |
1106 |
fail.</p> |
fail.</P> |
1107 |
<p>We recommend that you use the UNMONITOR action in a gid |
<P>We recommend that you use the UNMONITOR action in a gid |
1108 |
statement. The rationale for this feature is security and that |
statement. The rationale for this feature is security and that |
1109 |
monit does not start a possible cracked program or |
monit does not start a possible cracked program or |
1110 |
script. Example:</p> |
script. Example:</P> |
1111 |
<pre> |
<PRE> |
1112 |
check file shadow with path /etc/shadow |
check file shadow with path /etc/shadow |
1113 |
if failed gid root then unmonitor |
if failed gid root then unmonitor |
1114 |
alert root@localhost</pre> |
alert root@localhost</PRE> |
1115 |
<p>If the test fails, monit will simply send an alert and stop |
<P>If the test fails, monit will simply send an alert and stop |
1116 |
monitoring the file and propagate an unmonitor action upward in |
monitoring the file and propagate an unmonitor action upward in |
1117 |
a depend tree.</p> |
a depend tree.</P> |
1118 |
<p> |
<P> |
1119 |
</p> |
<H2><A NAME="connection testing">CONNECTION TESTING</A></H2> |
1120 |
<h2><a name="connection_testing">CONNECTION TESTING</a></h2> |
<P>Monit is able to perform connection testing via networked ports |
|
<p>Monit is able to perform connection testing via networked ports |
|
1121 |
or via Unix sockets. A connection test may only be used within a |
or via Unix sockets. A connection test may only be used within a |
1122 |
process or within a host service entry in the monit control file.</p> |
process or within a host service entry in the monit control file.</P> |
1123 |
<p>If a service listens on one or more sockets, monit can connect to |
<P>If a service listens on one or more sockets, monit can connect to |
1124 |
the port (using either tcp or udp) and verify that the service |
the port (using either tcp or udp) and verify that the service |
1125 |
will accept a connection and that it is possible to write and |
will accept a connection and that it is possible to write and |
1126 |
read from the socket. If a connection is not accepted or if there |
read from the socket. If a connection is not accepted or if there |
1127 |
is a problem with socket read/write, monit will assume that |
is a problem with socket read/write, monit will assume that |
1128 |
something is wrong and execute a specified action. If monit is |
something is wrong and execute a specified action. If monit is |
1129 |
compiled with openssl, then ssl based network services can also |
compiled with openssl, then ssl based network services can also |
1130 |
be tested.</p> |
be tested.</P> |
1131 |
<p>The full syntax for the statement used for connection testing is |
<P>The full syntax for the statement used for connection testing is |
1132 |
as follows (keywords are in capital and optional statements in |
as follows (keywords are in capital and optional statements in |
1133 |
[brackets]),</p> |
[brackets]),</P> |
1134 |
<dl> |
<DL> |
1135 |
<dt><strong><a name="item_if_failed_%5bhost%5d_port_%5btype%5d_%5bprotocol%5">IF FAILED [host] port [type] [protocol] [timeout] |
<DT><STRONG><A NAME="item_IF_FAILED_%5Bhost%5D_port_%5Btype%5D_%5Bprotocol%5">IF FAILED [host] port [type] [protocol] [timeout] |
1136 |
THEN action</a></strong><br /> |
THEN action</A></STRONG><BR> |
1137 |
</dt> |
<DD> |
1138 |
</dl> |
</DL> |
1139 |
<p>or for Unix sockets,</p> |
<P>or for Unix sockets,</P> |
1140 |
<dl> |
<DL> |
1141 |
<dt><strong><a name="item_if_failed_%5bunixsocket%5d_%5btype%5d_%5bprotocol%">IF FAILED [unixsocket] [type] [protocol] [timeout] |
<DT><STRONG><A NAME="item_IF_FAILED_%5Bunixsocket%5D_%5Btype%5D_%5Bprotocol%">IF FAILED [unixsocket] [type] [protocol] [timeout] |
1142 |
THEN action</a></strong><br /> |
THEN action</A></STRONG><BR> |
1143 |
</dt> |
<DD> |
1144 |
</dl> |
</DL> |
1145 |
<p><strong>host:HOST hostname</strong>. Optionally specify the host to connect |
<P><STRONG>host:HOST hostname</STRONG>. Optionally specify the host to connect |
1146 |
to. If the host is not given then localhost is assumed if this |
to. If the host is not given then localhost is assumed if this |
1147 |
test is used inside a process entry. If this test was used inside |
test is used inside a process entry. If this test was used inside |
1148 |
a remote host entry then the entry's remote host is assumed. |
a remote host entry then the entry's remote host is assumed. |
1149 |
Although <em>host</em> is intended for testing name based virtual host |
Although <EM>host</EM> is intended for testing name based virtual host |
1150 |
in a HTTP server running on local or remote host, it does allow |
in a HTTP server running on local or remote host, it does allow |
1151 |
the connection statement to be used to test a server running on |
the connection statement to be used to test a server running on |
1152 |
another machine. This may be useful; For instance if you use |
another machine. This may be useful; For instance if you use |
1153 |
Apache httpd as a front-end and an application-server as the |
Apache httpd as a front-end and an application-server as the |
1154 |
back-end running on another machine, this statement may be used |
back-end running on another machine, this statement may be used |
1155 |
to test that the back-end server is running and if not raise an |
to test that the back-end server is running and if not raise an |
1156 |
alert.</p> |
alert.</P> |
1157 |
<p><strong>port:PORT number</strong>. The port number to connect to</p> |
<P><STRONG>port:PORT number</STRONG>. The port number to connect to</P> |
1158 |
<p><strong>unixsocket:UNIXSOCKET PATH</strong>. Specifies the path to a Unix |
<P><STRONG>unixsocket:UNIXSOCKET PATH</STRONG>. Specifies the path to a Unix |
1159 |
socket. Servers based on Unix sockets, always runs on the local |
socket. Servers based on Unix sockets, always runs on the local |
1160 |
machine and does not use a port.</p> |
machine and does not use a port.</P> |
1161 |
<p><strong>type:TYPE {TCP|UDP|TCPSSL}</strong>. Optionally specify the socket type |
<P><STRONG>type:TYPE {TCP|UDP|TCPSSL}</STRONG>. Optionally specify the socket type |
1162 |
monit should use when trying to connect to the port. The |
monit should use when trying to connect to the port. The |
1163 |
different socket types are; TCP, UDP or TCPSSL, where TCP is a |
different socket types are; TCP, UDP or TCPSSL, where TCP is a |
1164 |
regular stream based socket, UDP is a datagram socket and TCPSSL |
regular stream based socket, UDP is a datagram socket and TCPSSL |
1166 |
connecting to a port. The default socket type is TCP. If TCPSSL |
connecting to a port. The default socket type is TCP. If TCPSSL |
1167 |
is used you may optionally specify the SSL/TLS protocol to be |
is used you may optionally specify the SSL/TLS protocol to be |
1168 |
used and the md5 sum of the server's certificate. The TCPSSL |
used and the md5 sum of the server's certificate. The TCPSSL |
1169 |
options are:</p> |
options are:</P> |
1170 |
<pre> |
<PRE> |
1171 |
TCPSSL [SSLAUTO|SSLV2|SSLV3|TLSV1] [CERTMD5 md5sum]</pre> |
TCPSSL [SSLAUTO|SSLV2|SSLV3|TLSV1] [CERTMD5 md5sum]</PRE> |
1172 |
<p><strong>proto(col):PROTO {protcols}</strong>. Optionally specify the protocol |
<P><STRONG>proto(col):PROTO {protcols}</STRONG>. Optionally specify the protocol |
1173 |
monit should speak when a connection is established. At the |
monit should speak when a connection is established. At the |
1174 |
moment monit knows how to speak <em>HTTP</em>, <em>SMTP</em>, <em>FTP</em>, <em>POP</em>, |
moment monit knows how to speak <EM>HTTP</EM>, <EM>SMTP</EM>, <EM>FTP</EM>, <EM>POP</EM>, |
1175 |
<em>IMAP</em>, <em>NNTP</em>, <em>SSH</em>, <em>DWP</em>, <em>LDAP2</em>, <em>LDAP3</em>, <em>RDATE</em> |
<EM>IMAP</EM>, <EM>NNTP</EM>, <EM>SSH</EM>, <EM>DWP</EM>, <EM>LDAP2</EM>, <EM>LDAP3</EM>, <EM>RDATE</EM> |
1176 |
and <em>RSYNC</em> and if you have compiled monit with ssl support, |
and <EM>RSYNC</EM> and if you have compiled monit with ssl support, |
1177 |
monit can also speak <em>HTTPS</em>, <em>FTPS</em>, <em>POPS</em> and <em>IMAPS</em>. If |
monit can also speak <EM>HTTPS</EM>, <EM>FTPS</EM>, <EM>POPS</EM> and <EM>IMAPS</EM>. If |
1178 |
the server's protocol is not found in this list, simply do not |
the server's protocol is not found in this list, simply do not |
1179 |
specify the protocol and monit will utilize a default test, |
specify the protocol and monit will utilize a default test, |
1180 |
including testing if it is possible to read and write to the |
including testing if it is possible to read and write to the |
1181 |
port. This default test is in most cases more than good enough to |
port. This default test is in most cases more than good enough to |
1182 |
deduce if the server behind the port is up or not. The protocol |
deduce if the server behind the port is up or not. The protocol |
1183 |
statement is:</p> |
statement is:</P> |
1184 |
<pre> |
<PRE> |
1185 |
[PROTO(COL) {name} [REQUEST {"/path"}]]</pre> |
[PROTO(COL) {name} [REQUEST {"/path"}]]</PRE> |
1186 |
<p>As you can see, you may specify a request after the protocol, at |
<P>As you can see, you may specify a request after the protocol, at |
1187 |
the moment only the HTTP protocol supports the request option. |
the moment only the HTTP protocol supports the request option. |
1188 |
See also below for an example.</p> |
See also below for an example.</P> |
1189 |
<p><strong>timeout:with TIMEOUT x SECONDS</strong>. Optionally specifies the |
<P><STRONG>timeout:with TIMEOUT x SECONDS</STRONG>. Optionally specifies the |
1190 |
connect and read timeout for the connection. If monit cannot |
connect and read timeout for the connection. If monit cannot |
1191 |
connect to the server within this time it will assume that the |
connect to the server within this time it will assume that the |
1192 |
connection failed and execute the specified action. The default |
connection failed and execute the specified action. The default |
1193 |
connect timeout is 5 seconds.</p> |
connect timeout is 5 seconds.</P> |
1194 |
<p><strong>action</strong> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
<P><STRONG>action</STRONG> is a choice of ``ALERT'', ``RESTART'', ``STOP'', ``EXEC'' or |
1195 |
``UNMONITOR''.</p> |
``UNMONITOR''.</P> |
1196 |
<p> |
<P> |
1197 |
</p> |
<H4><A NAME="examples">Examples</A></H4> |
1198 |
<h4><a name="examples">Examples</a></h4> |
<P>To check a port connection and receive an alert if monit cannot |
1199 |
<p>To check a port connection and receive an alert if monit cannot |
connect to the port, use the following statement:</P> |
1200 |
connect to the port, use the following statement:</p> |
<PRE> |
1201 |
<pre> |
if failed port 80 then alert</PRE> |
1202 |
if failed port 80 then alert</pre> |
<P>In this case the machine in question is assumed to be the default |
1203 |
<p>In this case the machine in question is assumed to be the default |
host. For a process entry it's <EM>localhost</EM> and for a remote host |
1204 |
host. For a process entry it's <em>localhost</em> and for a remote host |
entry it's the <EM>address</EM> of the remote host. Monit will conduct |
|
entry it's the <em>address</em> of the remote host. Monit will conduct |
|
1205 |
a tcp connection to the host at port 80 and tcp by default. If |
a tcp connection to the host at port 80 and tcp by default. If |
1206 |
you want to connect with udp, you can specify this after the |
you want to connect with udp, you can specify this after the |
1207 |
port-statement;</p> |
port-statement;</P> |
1208 |
<pre> |
<PRE> |
1209 |
if failed port 53 type udp then alert</pre> |
if failed port 53 type udp then alert</PRE> |
1210 |
<p>Monit will stop trying to connect to the port after 5 seconds and |
<P>Monit will stop trying to connect to the port after 5 seconds and |
1211 |
assume that the server behind the port is down. You may increase |
assume that the server behind the port is down. You may increase |
1212 |
or decrease the connect timeout by explicit add a connection |
or decrease the connect timeout by explicit add a connection |
1213 |
timeout. In the following example the timeout is increased to 15 |
timeout. In the following example the timeout is increased to 15 |
1214 |
seconds and if monit cannot connect to the server within 15 |
seconds and if monit cannot connect to the server within 15 |
1215 |
seconds the test will fail and an alert message is sent.</p> |
seconds the test will fail and an alert message is sent.</P> |
1216 |
<pre> |
<PRE> |
1217 |
if failed port 80 with timeout 15 seconds then alert</pre> |
if failed port 80 with timeout 15 seconds then alert</PRE> |
1218 |
<p>If a server is listening to a Unix socket the following statement |
<P>If a server is listening to a Unix socket the following statement |
1219 |
can be used:</p> |
can be used:</P> |
1220 |
<pre> |
<PRE> |
1221 |
if failed unixsocket /tmp/ssh-XXuIV3rG/agent.1486 then alert</pre> |
if failed unixsocket /tmp/ssh-XXuIV3rG/agent.1486 then alert</PRE> |
1222 |
<p>A Unix socket is used by some servers for (interprocess) |
<P>A Unix socket is used by some servers for (interprocess) |
1223 |
communication on localhost only. A Unix socket is specified by a |
communication on localhost only. A Unix socket is specified by a |
1224 |
path and in the example above the path, |
path and in the example above the path, |
1225 |
/tmp/ssh-XXuIV3rG/agent.1486, specifies a Unix socket.</p> |
/tmp/ssh-XXuIV3rG/agent.1486, specifies a Unix socket.</P> |
1226 |
<p>If your machine answers for several virtual hosts you can prefix |
<P>If your machine answers for several virtual hosts you can prefix |
1227 |
the port statement with a host-statement like so:</p> |
the port statement with a host-statement like so:</P> |
1228 |
<pre> |
<PRE> |
1229 |
if failed host www.sol.no port 80 then alert |
if failed host www.sol.no port 80 then alert |
1230 |
if failed host 80.69.226.133 port 443 then alert |
if failed host 80.69.226.133 port 443 then alert |
1231 |
if failed host kvasir.sol.no port 80 then alert</pre> |
if failed host kvasir.sol.no port 80 then alert</PRE> |
1232 |
<p>And as mentioned above, if you do not specify a host-statement, |
<P>And as mentioned above, if you do not specify a host-statement, |
1233 |
<em>localhost</em> or <em>address</em> is assumed.</p> |
<EM>localhost</EM> or <EM>address</EM> is assumed.</P> |
1234 |
<p>Monit also knows how to speak some of the more popular Internet |
<P>Monit also knows how to speak some of the more popular Internet |
1235 |
protocols. So, besides testing for connections, monit can also |
protocols. So, besides testing for connections, monit can also |
1236 |
speak with the server in question to verify that the server |
speak with the server in question to verify that the server |
1237 |
works. For example, the following is used to test a http server:</p> |
works. For example, the following is used to test a http server:</P> |
1238 |
<pre> |
<PRE> |
1239 |
if failed host www.tildeslash.com port 80 proto http |
if failed host www.tildeslash.com port 80 proto http |
1240 |
then restart</pre> |
then restart</PRE> |
1241 |
<p>Some protocols also support a request statement. This statement |
<P>Some protocols also support a request statement. This statement |
1242 |
can be used to ask the server for a special document entity.</p> |
can be used to ask the server for a special document entity.</P> |
1243 |
<p>Currently <strong>only</strong> the <em>HTTP</em> protocol module supports the |
<P>Currently <STRONG>only</STRONG> the <EM>HTTP</EM> protocol module supports the |
1244 |
request statement, such as:</p> |
request statement, such as:</P> |
1245 |
<pre> |
<PRE> |
1246 |
if failed host www.myhost.com port 80 protocol http |
if failed host www.myhost.com port 80 protocol http |
1247 |
and request "/data/show.php?a=b&c=d" |
and request "/data/show.php?a=b&c=d" |
1248 |
then restart</pre> |
then restart</PRE> |
1249 |
<p>The request must contain an URI string specifying a document from |
<P>The request must contain an URI string specifying a document from |
1250 |
the http server. The string will be url encoded by monit before |
the http server. The string will be url encoded by monit before |
1251 |
it sends the request to the http server, so it's okay to use url |
it sends the request to the http server, so it's okay to use url |
1252 |
unsafe characters in the request. If the request statement isn't |
unsafe characters in the request. If the request statement isn't |
1253 |
specified, the default web server page will be requested.</p> |
specified, the default web server page will be requested.</P> |
1254 |
<p>The <em>TCPSSL</em> statement can optionally test the md5 sum of the |
<P>The <EM>TCPSSL</EM> statement can optionally test the md5 sum of the |
1255 |
server's certificate. You must state the md5 certificate string |
server's certificate. You must state the md5 certificate string |
1256 |
you expect the server to deliver and upon a connect to the |
you expect the server to deliver and upon a connect to the |
1257 |
server, the server's actual md5 sum certificate string is |
server, the server's actual md5 sum certificate string is |
1258 |
tested. If they do not match, the connection test fails. If the |
tested. If they do not match, the connection test fails. If the |
1259 |
ssl version handshake does not work properly you can also force a |
ssl version handshake does not work properly you can also force a |
1260 |
specific ssl version, as we demonstrate in this example:</p> |
specific ssl version, as we demonstrate in this example:</P> |
1261 |
<pre> |
<PRE> |
1262 |
if failed host shop.sol.no port 443 |
if failed host shop.sol.no port 443 |
1263 |
type TCPSSL SSLV3 # Force monit to use ssl version 3 |
type TCPSSL SSLV3 # Force monit to use ssl version 3 |
1264 |
# We expect the server to return this md5 certificate sum |
# We expect the server to return this md5 certificate sum |
1265 |
CERTMD5 12-34-56-78-90-AB-CD-EF-12-34-56-78-90-AB-CD-EF |
CERTMD5 12-34-56-78-90-AB-CD-EF-12-34-56-78-90-AB-CD-EF |
1266 |
protocol http |
protocol http |
1267 |
then restart</pre> |
then restart</PRE> |
1268 |
<p>Here's an example where a connection test is used inside a |
<P>Here's an example where a connection test is used inside a |
1269 |
process entry:</p> |
process entry:</P> |
1270 |
<pre> |
<PRE> |
1271 |
check process apache with pidfile /var/run/apache.pid |
check process apache with pidfile /var/run/apache.pid |
1272 |
start program = "/etc/init.d/httpd start" |
start program = "/etc/init.d/httpd start" |
1273 |
stop program = "/etc/init.d/httpd stop" |
stop program = "/etc/init.d/httpd stop" |
1274 |
if failed host www.tildeslash.com port 80 then restart |
if failed host www.tildeslash.com port 80 then restart |
1275 |
alert foo@bar.baz</pre> |
alert foo@bar.baz</PRE> |
1276 |
<p>Here, a connection test is used in a remote host entry:</p> |
<P>Here, a connection test is used in a remote host entry:</P> |
1277 |
<pre> |
<PRE> |
1278 |
check host up2date with address ftp.redhat.com |
check host up2date with address ftp.redhat.com |
1279 |
if failed port 21 and protocol ftp then alert |
if failed port 21 and protocol ftp then alert |
1280 |
alert foo@bar.baz</pre> |
alert foo@bar.baz</PRE> |
1281 |
<p>Since we did not explicit specify a host in the above test, monit |
<P>Since we did not explicit specify a host in the above test, monit |
1282 |
will connect to port 21 at ftp.redhat.com. Aprops, the host |
will connect to port 21 at ftp.redhat.com. Aprops, the host |
1283 |
address can be specified as a dotted IP address string or as |
address can be specified as a dotted IP address string or as |
1284 |
hostname in the DNS. The following is exactly[*] the same test, |
hostname in the DNS. The following is exactly[*] the same test, |
1285 |
but using an ip address instead:</p> |
but using an ip address instead:</P> |
1286 |
<pre> |
<PRE> |
1287 |
check host up2date with address 66.187.232.30 |
check host up2date with address 66.187.232.30 |
1288 |
if failed port 21 and protocol ftp then alert |
if failed port 21 and protocol ftp then alert |
1289 |
alert foo@bar.baz</pre> |
alert foo@bar.baz</PRE> |
1290 |
<p>[*] Well, not quite, since we specify an ip-address directly we |
<P>[*] Well, not quite, since we specify an ip-address directly we |
1291 |
will bypass any DNS round-robin setup, but that's another story.</p> |
will bypass any DNS round-robin setup, but that's another story.</P> |
1292 |
<p>For more examples, see the example section below.</p> |
<P>For more examples, see the example section below.</P> |
1293 |
<p> |
<P> |
1294 |
</p> |
<HR> |
1295 |
<hr /> |
<H1><A NAME="monit httpd">MONIT HTTPD</A></H1> |
1296 |
<h1><a name="monit_httpd">MONIT HTTPD</a></h1> |
<P>If specified in the control file, monit will start a monit daemon |
|
<p>If specified in the control file, monit will start a monit daemon |
|
1297 |
with http support. From a Browser you can then start and stop |
with http support. From a Browser you can then start and stop |
1298 |
services, disable or enable service monitoring as well as view |
services, disable or enable service monitoring as well as view |
1299 |
the status of each service. Also, if monit logs to its own file, |
the status of each service. Also, if monit logs to its own file, |
1300 |
you can view the content of this logfile in a Browser.</p> |
you can view the content of this logfile in a Browser.</P> |
1301 |
<p>The control file statement for starting a monit daemon with http |
<P>The control file statement for starting a monit daemon with http |
1302 |
support is a global set-statement:</p> |
support is a global set-statement:</P> |
1303 |
<dl> |
<DL> |
1304 |
<dt><strong><a name="item_set_httpd_port_2812">set httpd port 2812</a></strong><br /> |
<DT><STRONG><A NAME="item_set_httpd_port_2812">set httpd port 2812</A></STRONG><BR> |
1305 |
</dt> |
<DD> |
1306 |
</dl> |
</DL> |
1307 |
<p>And you can use this URL, <em><a href="http://localhost:2812/">http://localhost:2812/</a></em>, to access |
<P>And you can use this URL, <EM><A HREF="http://localhost:2812/">http://localhost:2812/</A></EM>, to access |
1308 |
the daemon from a browser. The port number, in this case 2812, |
the daemon from a browser. The port number, in this case 2812, |
1309 |
can be any number that you are allowed to bind to.</p> |
can be any number that you are allowed to bind to.</P> |
1310 |
<p>If you have compiled monit with openssl, you can also start the |
<P>If you have compiled monit with openssl, you can also start the |
1311 |
httpd server with ssl support, using the following expression:</p> |
httpd server with ssl support, using the following expression:</P> |
1312 |
<pre> |
<PRE> |
1313 |
set httpd port 2812 |
set httpd port 2812 |
1314 |
ssl enable |
ssl enable |
1315 |
pemfile /etc/certs/monit.pem</pre> |
pemfile /etc/certs/monit.pem</PRE> |
1316 |
<p>And you can use this URL, <em><a href="https://localhost:2812/">https://localhost:2812/</a></em>, to access |
<P>And you can use this URL, <EM><A HREF="https://localhost:2812/">https://localhost:2812/</A></EM>, to access |
1317 |
the monit web server over an ssl encrypted connection.</p> |
the monit web server over an ssl encrypted connection.</P> |
1318 |
<p>The pemfile, in the example above, holds both the server's |
<P>The pemfile, in the example above, holds both the server's |
1319 |
private key and certificate. This file should be stored in a safe |
private key and certificate. This file should be stored in a safe |
1320 |
place on the filesystem and should have strict permissions, that |
place on the filesystem and should have strict permissions, that |
1321 |
is, no more than 0700.</p> |
is, no more than 0700.</P> |
1322 |
<p>In addition, if you want to check for client certificates you can |
<P>In addition, if you want to check for client certificates you can |
1323 |
use the CLIENTPEMFILE statement. In this case, a connecting |
use the CLIENTPEMFILE statement. In this case, a connecting |
1324 |
client has to provided a certificate known by monit in order to |
client has to provided a certificate known by monit in order to |
1325 |
connect. This file also needs to have all necessary CA |
connect. This file also needs to have all necessary CA |
1326 |
certificates. A configuration could look like:</p> |
certificates. A configuration could look like:</P> |
1327 |
<pre> |
<PRE> |
1328 |
set httpd port 2812 |
set httpd port 2812 |
1329 |
ssl enable |
ssl enable |
1330 |
pemfile /etc/certs/monit.pem |
pemfile /etc/certs/monit.pem |
1331 |
clientpemfile /etc/certs/monit-client.pem</pre> |
clientpemfile /etc/certs/monit-client.pem</PRE> |
1332 |
<p>By default self signed client certificates are not allowed. If |
<P>By default self signed client certificates are not allowed. If |
1333 |
you want to use a self signed certificate from a client it has to |
you want to use a self signed certificate from a client it has to |
1334 |
be allowed explicitly with the ALLOWSELFCERTIFICATION statement.</p> |
be allowed explicitly with the ALLOWSELFCERTIFICATION statement.</P> |
1335 |
<p>For more information on how to use monit with SSL and for more |
<P>For more information on how to use monit with SSL and for more |
1336 |
information about certificates and generating pem files, please |
information about certificates and generating pem files, please |
1337 |
consult the README.SSL file accompanying the software.</p> |
consult the README.SSL file accompanying the software.</P> |
1338 |
<p>If you only want the http server to accept connect requests to |
<P>If you only want the http server to accept connect requests to |
1339 |
one host addresses you can specify the bind address either as an |
one host addresses you can specify the bind address either as an |
1340 |
IP number string or as a hostname. In the following example we |
IP number string or as a hostname. In the following example we |
1341 |
bind the http server to the loopback device. In other words the |
bind the http server to the loopback device. In other words the |
1342 |
http server will only be reachable from localhost:</p> |
http server will only be reachable from localhost:</P> |
1343 |
<pre> |
<PRE> |
1344 |
set httpd port 2812 and use the address 127.0.0.1</pre> |
set httpd port 2812 and use the address 127.0.0.1</PRE> |
1345 |
<p>or</p> |
<P>or</P> |
1346 |
<pre> |
<PRE> |
1347 |
set httpd port 2812 and use the address localhost</pre> |
set httpd port 2812 and use the address localhost</PRE> |
1348 |
<p>If you do not use the ADDRESS statement the http server will |
<P>If you do not use the ADDRESS statement the http server will |
1349 |
accept connections on any/all local addresses.</p> |
accept connections on any/all local addresses.</P> |
1350 |
<p>If you remove the httpd statement from the config file, monit will |
<P>If you remove the httpd statement from the config file, monit will |
1351 |
stop the httpd server on its next cycle. Likewise if you change |
stop the httpd server on its next cycle. Likewise if you change |
1352 |
the port number, monit will restart the http server using the new |
the port number, monit will restart the http server using the new |
1353 |
specified port number.</p> |
specified port number.</P> |
1354 |
<p>The status page displayed by the monit web server is |
<P>The status page displayed by the monit web server is |
1355 |
automatically refreshed with the same poll time set for the monit |
automatically refreshed with the same poll time set for the monit |
1356 |
daemon.</p> |
daemon.</P> |
1357 |
<p><strong>Note:</strong></p> |
<P><STRONG>Note:</STRONG></P> |
1358 |
<p>We strongly recommend that you start monit with http support (and |
<P>We strongly recommend that you start monit with http support (and |
1359 |
bind the server to localhost, only, unless you are behind a |
bind the server to localhost, only, unless you are behind a |
1360 |
firewall). The built-in web-server is small and does not use |
firewall). The built-in web-server is small and does not use |
1361 |
much resources, and more <em>importantly</em>, monit can use the http |
much resources, and more <EM>importantly</EM>, monit can use the http |
1362 |
server for interprocess communication between a monit client and |
server for interprocess communication between a monit client and |
1363 |
a monit daemon.</p> |
a monit daemon.</P> |
1364 |
<p>For instance, you <em>must</em> start a monit daemon with http support |
<P>For instance, you <EM>must</EM> start a monit daemon with http support |
1365 |
if you want to be able to use the following console |
if you want to be able to use the following console |
1366 |
commands. (That is; most of the available console commands).</p> |
commands. (That is; most of the available console commands).</P> |
1367 |
<pre> |
<PRE> |
1368 |
'monit stop all' |
'monit stop all' |
1369 |
'monit start all' |
'monit start all' |
1370 |
'monit stop service' |
'monit stop service' |
1376 |
'monit -g groupname start all' |
'monit -g groupname start all' |
1377 |
'monit -g groupname restart all' |
'monit -g groupname restart all' |
1378 |
'monit -g groupname monitor all' |
'monit -g groupname monitor all' |
1379 |
'monit -g groupname unmonitor all'</pre> |
'monit -g groupname unmonitor all'</PRE> |
1380 |
<p>If a monit daemon is running in the background we will ask the |
<P>If a monit daemon is running in the background we will ask the |
1381 |
deamon (via the HTTP protocol) to execute the above commands. |
deamon (via the HTTP protocol) to execute the above commands. |
1382 |
That is, the daemon is requested to start and stop the services. |
That is, the daemon is requested to start and stop the services. |
1383 |
This ensures that a daemon will not restart a service that you |
This ensures that a daemon will not restart a service that you |
1384 |
requested to stop and that (any) timeout lock will be removed |
requested to stop and that (any) timeout lock will be removed |
1385 |
from a service when you start it.</p> |
from a service when you start it.</P> |
1386 |
<p> |
<P> |
1387 |
</p> |
<H2><A NAME="monit httpd authentication">Monit HTTPD Authentication</A></H2> |
1388 |
<h2><a name="monit_httpd_authentication">Monit HTTPD Authentication</a></h2> |
<P>monit supports two types of authentication schema's for connecting |
|
<p>monit supports two types of authentication schema's for connecting |
|
1389 |
to the httpd server, (three, if you count SSL client certificate |
to the httpd server, (three, if you count SSL client certificate |
1390 |
validation). Both schema's can be used together or by itself. You |
validation). Both schema's can be used together or by itself. You |
1391 |
<strong>must</strong> choose at least one.</p> |
<STRONG>must</STRONG> choose at least one.</P> |
1392 |
<p> |
<P> |
1393 |
</p> |
<H4><A NAME="host allow list">Host allow list</A></H4> |
1394 |
<h4><a name="host_allow_list">Host allow list</a></h4> |
<P>The http server maintains an access-control list of hosts allowed |
|
<p>The http server maintains an access-control list of hosts allowed |
|
1395 |
to connect to the server. You can add as many hosts as you want |
to connect to the server. You can add as many hosts as you want |
1396 |
to, but only hosts with a valid domain name or its IP address are |
to, but only hosts with a valid domain name or its IP address are |
1397 |
allowed. If you specify a hostname that does not resolve, monit |
allowed. If you specify a hostname that does not resolve, monit |
1398 |
will write an error message in the console and not start.</p> |
will write an error message in the console and not start.</P> |
1399 |
<p>The http server will query a nameserver to check any hosts |
<P>The http server will query a nameserver to check any hosts |
1400 |
connecting to the server. If a host (client) is trying to connect |
connecting to the server. If a host (client) is trying to connect |
1401 |
to the server, but cannot be found in the access list or cannot |
to the server, but cannot be found in the access list or cannot |
1402 |
be resolved, the server will shutdown the connection to the |
be resolved, the server will shutdown the connection to the |
1403 |
client promptly.</p> |
client promptly.</P> |
1404 |
<p>Control file example:</p> |
<P>Control file example:</P> |
1405 |
<pre> |
<PRE> |
1406 |
set httpd port 2812 |
set httpd port 2812 |
1407 |
allow localhost |
allow localhost |
1408 |
allow my.other.work.machine.com |
allow my.other.work.machine.com |
1409 |
allow 10.1.1.1</pre> |
allow 10.1.1.1</PRE> |
1410 |
<p> |
<P> |
1411 |
</p> |
<H4><A NAME="basic authentication">Basic Authentication</A></H4> |
1412 |
<h4><a name="basic_authentication">Basic Authentication</a></h4> |
<P>This authentication schema is HTTP specific and described in more |
1413 |
<p>This authentication schema is HTTP specific and described in more |
detail in RFC 2617.</P> |
1414 |
detail in RFC 2617.</p> |
<P>In short; a server challenge a client (e.g. a Browser) to send |
|
<p>In short; a server challenge a client (e.g. a Browser) to send |
|
1415 |
authentication information (username and password) and if |
authentication information (username and password) and if |
1416 |
accepted, the server will allow the client access to the |
accepted, the server will allow the client access to the |
1417 |
requested document.</p> |
requested document.</P> |
1418 |
<p>The biggest weakness with Basic Authentication is that the |
<P>The biggest weakness with Basic Authentication is that the |
1419 |
username and password is sent in clear-text (i.e. base64 encoded) |
username and password is sent in clear-text (i.e. base64 encoded) |
1420 |
over the network. It is therefor recommended that you do not use |
over the network. It is therefor recommended that you do not use |
1421 |
this authentication method unless you run the monit http server |
this authentication method unless you run the monit http server |
1422 |
with <em>ssl</em> support. With ssl support it is completely safe to |
with <EM>ssl</EM> support. With ssl support it is completely safe to |
1423 |
use Basic Authentication since <strong>all</strong> http data, including Basic |
use Basic Authentication since <STRONG>all</STRONG> http data, including Basic |
1424 |
Authentication headers will be encrypted.</p> |
Authentication headers will be encrypted.</P> |
1425 |
<p>monit will use Basic Authentication if an allow statement |
<P>monit will use Basic Authentication if an allow statement |
1426 |
contains a username and a password separated with a single ':' |
contains a username and a password separated with a single ':' |
1427 |
character, like so; <em>allow username:password</em>. The username and |
character, like so; <EM>allow username:password</EM>. The username and |
1428 |
password must be written in clear-text. Only one username and |
password must be written in clear-text. Only one username and |
1429 |
password pair is supported.</p> |
password pair is supported.</P> |
1430 |
<p>If you use this method together with a host list, then only |
<P>If you use this method together with a host list, then only |
1431 |
clients from the listed hosts will be allowed to connect to the |
clients from the listed hosts will be allowed to connect to the |
1432 |
monit http server and each client will be asked to provide a |
monit http server and each client will be asked to provide a |
1433 |
username and a password.</p> |
username and a password.</P> |
1434 |
<p>Example:</p> |
<P>Example:</P> |
1435 |
<pre> |
<PRE> |
1436 |
set httpd port 2812 |
set httpd port 2812 |
1437 |
allow localhost |
allow localhost |
1438 |
allow 10.1.1.1 |
allow 10.1.1.1 |
1439 |
allow hauk:monit</pre> |
allow hauk:monit</PRE> |
1440 |
<p>If you only want to use Basic Authentication, then just provide |
<P>If you only want to use Basic Authentication, then just provide |
1441 |
the one line with username and password, like:</p> |
the one line with username and password, like:</P> |
1442 |
<pre> |
<PRE> |
1443 |
set httpd port 2812 |
set httpd port 2812 |
1444 |
allow hauk:monit</pre> |
allow hauk:monit</PRE> |
1445 |
<p>If you use Basic Authentication it is a good idea to set the |
<P>If you use Basic Authentication it is a good idea to set the |
1446 |
access permission for the control file (~/.monitrc) to only |
access permission for the control file (~/.monitrc) to only |
1447 |
readable and writable for the user running monit, because the |
readable and writable for the user running monit, because the |
1448 |
password is written in clear-text. (Use this command, /bin/chmod |
password is written in clear-text. (Use this command, /bin/chmod |
1449 |
600 ~/.monitrc). In fact, since monit <strong>version 3.0</strong>, monit will |
600 ~/.monitrc). In fact, since monit <STRONG>version 3.0</STRONG>, monit will |
1450 |
complain and exit if the control file is readable by others.</p> |
complain and exit if the control file is readable by others.</P> |
1451 |
<p> |
<P> |
1452 |
</p> |
<HR> |
1453 |
<hr /> |
<H1><A NAME="dependency tree">DEPENDENCY TREE</A></H1> |
1454 |
<h1><a name="dependency_tree">DEPENDENCY TREE</a></h1> |
<P>If specified in the control file, monit can do dependency |
|
<p>If specified in the control file, monit can do dependency |
|
1455 |
checking before start, stop, monitoring or unmonitoring of |
checking before start, stop, monitoring or unmonitoring of |
1456 |
services. The dependency statement may be used within any service |
services. The dependency statement may be used within any service |
1457 |
entries in the monit control file.</p> |
entries in the monit control file.</P> |
1458 |
<p>The syntax for the depend statement is simply:</p> |
<P>The syntax for the depend statement is simply:</P> |
1459 |
<dl> |
<DL> |
1460 |
<dt><strong><a name="item_depends_on_service%5b%2c_service_%5b%2c%2e%2e%2e%5">DEPENDS on service[, service [,...]]</a></strong><br /> |
<DT><STRONG><A NAME="item_DEPENDS_on_service%5B%2C_service_%5B%2C%2E%2E%2E%5">DEPENDS on service[, service [,...]]</A></STRONG><BR> |
1461 |
</dt> |
<DD> |
1462 |
</dl> |
</DL> |
1463 |
<p>Where <strong>service</strong> is a service entry name, for instance <strong>apache</strong> |
<P>Where <STRONG>service</STRONG> is a service entry name, for instance <STRONG>apache</STRONG> |
1464 |
or <strong>datafs</strong>.</p> |
or <STRONG>datafs</STRONG>.</P> |
1465 |
<p>You may add more than one service name of any type or use more |
<P>You may add more than one service name of any type or use more |
1466 |
than one depend statement in an entry.</p> |
than one depend statement in an entry.</P> |
1467 |
<p>Services specified in a <em>depend</em> statement will be checked |
<P>Services specified in a <EM>depend</EM> statement will be checked |
1468 |
during stop/start/monitor/unmonitor operations. If a service is |
during stop/start/monitor/unmonitor operations. If a service is |
1469 |
stopped or unmonitored it will stop/unmonitor any services that |
stopped or unmonitored it will stop/unmonitor any services that |
1470 |
depends on itself. Likewise, if a service is started, it will |
depends on itself. Likewise, if a service is started, it will |
1472 |
started, start all depending services again. If the service is to |
started, start all depending services again. If the service is to |
1473 |
be monitored (enable monitoring), all services which this service |
be monitored (enable monitoring), all services which this service |
1474 |
depends on will be monitored before enabling monitoring of this |
depends on will be monitored before enabling monitoring of this |
1475 |
service.</p> |
service.</P> |
1476 |
<p>Here is an example where we set up an apache service entry to |
<P>Here is an example where we set up an apache service entry to |
1477 |
depend on the underlying apache binary. If the binary should |
depend on the underlying apache binary. If the binary should |
1478 |
change an alert is sent and apache is not monitored anymore. The |
change an alert is sent and apache is not monitored anymore. The |
1479 |
rationale is security and that monit should not execute a |
rationale is security and that monit should not execute a |
1480 |
possibly cracked apache binary.</p> |
possibly cracked apache binary.</P> |
1481 |
<pre> |
<PRE> |
1482 |
(1) check process apache |
(1) check process apache |
1483 |
(2) with pidfile "/usr/local/apache/logs/httpd.pid" |
(2) with pidfile "/usr/local/apache/logs/httpd.pid" |
1484 |
(3) ... |
(3) ... |
1486 |
(5) |
(5) |
1487 |
(6) check file httpd with path /usr/local/apache/bin/httpd |
(6) check file httpd with path /usr/local/apache/bin/httpd |
1488 |
(7) if failed checksum then unmonitor |
(7) if failed checksum then unmonitor |
1489 |
(8) alert foo@bar.baz</pre> |
(8) alert foo@bar.baz</PRE> |
1490 |
<p>The first entry is the process entry for apache shown before |
<P>The first entry is the process entry for apache shown before |
1491 |
(abbreviated for clarity). The fourth line sets up a dependency |
(abbreviated for clarity). The fourth line sets up a dependency |
1492 |
between this entry and the service entry named httpd in line 6. A |
between this entry and the service entry named httpd in line 6. A |
1493 |
depend tree works as follows, if an action is conducted in a |
depend tree works as follows, if an action is conducted in a |
1499 |
will also execute the unmonitor action. In short, if the checksum |
will also execute the unmonitor action. In short, if the checksum |
1500 |
test for the httpd binary file should fail, both the check file |
test for the httpd binary file should fail, both the check file |
1501 |
httpd entry and the check process apache entry is set in |
httpd entry and the check process apache entry is set in |
1502 |
un-monitoring mode.</p> |
un-monitoring mode.</P> |
1503 |
<p>A dependency tree is a general construct and can be used between |
<P>A dependency tree is a general construct and can be used between |
1504 |
all types of service entries and span many levels and propagate |
all types of service entries and span many levels and propagate |
1505 |
any supported action (except the exec action which will not |
any supported action (except the exec action which will not |
1506 |
propagate upward in a dependency tree for obvious reasons). Here |
propagate upward in a dependency tree for obvious reasons). Here |
1507 |
is another example, based on a different perspective, but with a |
is another example, based on a different perspective, but with a |
1508 |
depend tree as the baseline:</p> |
depend tree as the baseline:</P> |
1509 |
<p>Consider the following common server setup:</p> |
<P>Consider the following common server setup:</P> |
1510 |
<pre> |
<PRE> |
1511 |
WEB-SERVER -> APPLICATION-SERVER -> DATABASE -> FILESYSTEM |
WEB-SERVER -> APPLICATION-SERVER -> DATABASE -> FILESYSTEM |
1512 |
(a) (b) (c) (d)</pre> |
(a) (b) (c) (d)</PRE> |
1513 |
<p>You can set dependencies so that the web-server depends on the |
<P>You can set dependencies so that the web-server depends on the |
1514 |
application server to run before the web-server starts and the |
application server to run before the web-server starts and the |
1515 |
application server depends on the database server and the |
application server depends on the database server and the |
1516 |
database depends on the file-system to be mounted before it |
database depends on the file-system to be mounted before it |
1517 |
starts. See also the example section below for examples using |
starts. See also the example section below for examples using |
1518 |
the depend statement.</p> |
the depend statement.</P> |
1519 |
<p>Here we describe how monit will function with the above |
<P>Here we describe how monit will function with the above |
1520 |
dependencies:</p> |
dependencies:</P> |
1521 |
<dl> |
<DL> |
1522 |
<dt><strong><a name="item_if_no_servers_are_running">If no servers are running</a></strong><br /> |
<DT><STRONG><A NAME="item_If_no_servers_are_running">If no servers are running</A></STRONG><BR> |
1523 |
</dt> |
<DD> |
1524 |
<dd> |
monit will start the servers in the following order: <EM>d</EM>, <EM>c</EM>, |
1525 |
monit will start the servers in the following order: <em>d</em>, <em>c</em>, |
<EM>b</EM>, <EM>a</EM> |
1526 |
<em>b</em>, <em>a</em> |
<P></P> |
1527 |
</dd> |
<DT><STRONG><A NAME="item_If_all_servers_are_running">If all servers are running</A></STRONG><BR> |
1528 |
<p></p> |
<DD> |
1529 |
<dt><strong><a name="item_if_all_servers_are_running">If all servers are running</a></strong><br /> |
When you run 'monit stop all' this is the stop order: <EM>a</EM>, <EM>b</EM>, |
1530 |
</dt> |
<EM>c</EM>, <EM>d</EM>. If you run 'monit stop d' then <EM>a</EM>, <EM>b</EM> and <EM>c</EM> |
1531 |
<dd> |
are also stopped because they depend on <EM>d</EM> and finally <EM>d</EM> is |
|
When you run 'monit stop all' this is the stop order: <em>a</em>, <em>b</em>, |
|
|
<em>c</em>, <em>d</em>. If you run 'monit stop d' then <em>a</em>, <em>b</em> and <em>c</em> |
|
|
are also stopped because they depend on <em>d</em> and finally <em>d</em> is |
|
1532 |
stopped. |
stopped. |
1533 |
</dd> |
<P></P> |
1534 |
<p></p> |
<DT><STRONG><A NAME="item_If_a_does_not_run">If <EM>a</EM> does not run</A></STRONG><BR> |
1535 |
<dt><strong><a name="item_if_a_does_not_run">If <em>a</em> does not run</a></strong><br /> |
<DD> |
1536 |
</dt> |
When monit runs it will start <EM>a</EM> |
1537 |
<dd> |
<P></P> |
1538 |
When monit runs it will start <em>a</em> |
<DT><STRONG><A NAME="item_If_b_does_not_run">If <EM>b</EM> does not run</A></STRONG><BR> |
1539 |
</dd> |
<DD> |
1540 |
<p></p> |
When monit runs it will first stop <EM>a</EM> then start <EM>b</EM> and |
1541 |
<dt><strong><a name="item_if_b_does_not_run">If <em>b</em> does not run</a></strong><br /> |
finally start <EM>a</EM> again. |
1542 |
</dt> |
<P></P> |
1543 |
<dd> |
<DT><STRONG><A NAME="item_If_c_does_not_run">If <EM>c</EM> does not run</A></STRONG><BR> |
1544 |
When monit runs it will first stop <em>a</em> then start <em>b</em> and |
<DD> |
1545 |
finally start <em>a</em> again. |
When monit runs it will first stop <EM>a</EM> and <EM>b</EM> then start <EM>c</EM> |
1546 |
</dd> |
and finally start <EM>b</EM> then <EM>a</EM>. |
1547 |
<p></p> |
<P></P> |
1548 |
<dt><strong><a name="item_if_c_does_not_run">If <em>c</em> does not run</a></strong><br /> |
<DT><STRONG><A NAME="item_If_d_does_not_run">If <EM>d</EM> does not run</A></STRONG><BR> |
1549 |
</dt> |
<DD> |
1550 |
<dd> |
When monit runs it will first stop <EM>a</EM>, <EM>b</EM> and <EM>c</EM> then start |
1551 |
When monit runs it will first stop <em>a</em> and <em>b</em> then start <em>c</em> |
<EM>d</EM> and finally start <EM>c</EM>, <EM>b</EM> then <EM>a</EM>. |
1552 |
and finally start <em>b</em> then <em>a</em>. |
<P></P> |
1553 |
</dd> |
<DT><STRONG><A NAME="item_If_the_control_file_contains_a_depend_loop%2E">If the control file contains a depend loop.</A></STRONG><BR> |
1554 |
<p></p> |
<DD> |
|
<dt><strong><a name="item_if_d_does_not_run">If <em>d</em> does not run</a></strong><br /> |
|
|
</dt> |
|
|
<dd> |
|
|
When monit runs it will first stop <em>a</em>, <em>b</em> and <em>c</em> then start |
|
|
<em>d</em> and finally start <em>c</em>, <em>b</em> then <em>a</em>. |
|
|
</dd> |
|
|
<p></p> |
|
|
<dt><strong><a name="item_if_the_control_file_contains_a_depend_loop%2e">If the control file contains a depend loop.</a></strong><br /> |
|
|
</dt> |
|
|
<dd> |
|
1555 |
A depend loop is for example; a->b and b->a or a->b->c->a. |
A depend loop is for example; a->b and b->a or a->b->c->a. |
1556 |
</dd> |
<P>When monit starts it will check for such loops and complain and |
|
<dd> |
|
|
<p>When monit starts it will check for such loops and complain and |
|
1557 |
exit if a loop was found. It will also exit with a complaint if a |
exit if a loop was found. It will also exit with a complaint if a |
1558 |
depend statement was used that does not point to a service in the |
depend statement was used that does not point to a service in the |
1559 |
control file.</p> |
control file.</P> |
1560 |
</dd> |
<P></P></DL> |
1561 |
<p></p></dl> |
<P> |
1562 |
<p> |
<HR> |
1563 |
</p> |
<H1><A NAME="the run control file">THE RUN CONTROL FILE</A></H1> |
1564 |
<hr /> |
<P>The preferred way to set up monit is to write a <EM>.monitrc</EM> file |
|
<h1><a name="the_run_control_file">THE RUN CONTROL FILE</a></h1> |
|
|
<p>The preferred way to set up monit is to write a <em>.monitrc</em> file |
|
1565 |
in your home directory. When there is a conflict between the |
in your home directory. When there is a conflict between the |
1566 |
command-line arguments and the arguments in this file, the |
command-line arguments and the arguments in this file, the |
1567 |
command-line arguments take precedence. To protect the security |
command-line arguments take precedence. To protect the security |
1568 |
of your control file and passwords the control file must have |
of your control file and passwords the control file must have |
1569 |
permissions <em>no more than 0700</em> (u=xrw,g=,o=); monit will |
permissions <EM>no more than 0700</EM> (u=xrw,g=,o=); monit will |
1570 |
complain and exit otherwise.</p> |
complain and exit otherwise.</P> |
1571 |
<p> |
<P> |
1572 |
</p> |
<H2><A NAME="run control syntax">Run Control Syntax</A></H2> |
1573 |
<h2><a name="run_control_syntax">Run Control Syntax</a></h2> |
<P>Comments begin with a '#' and extend through the end of the line. |
|
<p>Comments begin with a '#' and extend through the end of the line. |
|
1574 |
Otherwise the file consists of a series of service entries or |
Otherwise the file consists of a series of service entries or |
1575 |
global option statements in a free-format, token-oriented syntax.</p> |
global option statements in a free-format, token-oriented syntax.</P> |
1576 |
<p>There are three kinds of tokens: grammar keywords, numbers (i.e. |
<P>There are three kinds of tokens: grammar keywords, numbers (i.e. |
1577 |
decimal digit sequences) and strings. Strings can be either |
decimal digit sequences) and strings. Strings can be either |
1578 |
quoted or unquoted. A quoted string is bounded by double quotes |
quoted or unquoted. A quoted string is bounded by double quotes |
1579 |
and may contain whitespace (and quoted digits are treated as a |
and may contain whitespace (and quoted digits are treated as a |
1580 |
string). An unquoted string is any whitespace-delimited token, |
string). An unquoted string is any whitespace-delimited token, |
1581 |
containing characters and/or numbers.</p> |
containing characters and/or numbers.</P> |
1582 |
<p>On a semantic level, the control file consists of two types of |
<P>On a semantic level, the control file consists of two types of |
1583 |
entries:</p> |
entries:</P> |
1584 |
<ol> |
<OL> |
1585 |
<li><strong>Global set-statements</strong><br /> |
<LI><STRONG>Global set-statements</STRONG><BR> |
1586 |
</li> |
|
1587 |
A global set-statement starts with the keyword <em>set</em> and the |
A global set-statement starts with the keyword <EM>set</EM> and the |
1588 |
item to configure. |
item to configure. |
1589 |
<p></p> |
<P></P> |
1590 |
<li><strong>One or more service entry statements.</strong><br /> |
<LI><STRONG>One or more service entry statements.</STRONG><BR> |
1591 |
</li> |
|
1592 |
Each service entry consists of the keywords `check', followed by |
Each service entry consists of the keywords `check', followed by |
1593 |
the service type. Each entry requires a <unique> descriptive |
the service type. Each entry requires a <unique> descriptive |
1594 |
name. This name is used by monit to refer to the service |
name. This name is used by monit to refer to the service |
1595 |
internally and in all interactions with the user. |
internally and in all interactions with the user. |
1596 |
<p></p></ol> |
<P></P></OL> |
1597 |
<p>Currently, five types of check statements are supported:</p> |
<P>Currently, five types of check statements are supported:</P> |
1598 |
<ol> |
<OL> |
1599 |
<li><strong><a name="item_check_process_%3cunique_name%3e_pidfile_%3cpath%3e">CHECK PROCESS <unique name> PIDFILE <path></a></strong><br /> |
<LI><STRONG><A NAME="item_CHECK_PROCESS_%3Cunique_name%3E_PIDFILE_%3Cpath%3E">CHECK PROCESS <unique name> PIDFILE <path></A></STRONG><BR> |
1600 |
</li> |
|
1601 |
<path> is the absolute path to the program's pidfile. If the |
<path> is the absolute path to the program's pidfile. If the |
1602 |
pidfile does not exist or does not contain the pid number of a |
pidfile does not exist or does not contain the pid number of a |
1603 |
running process, monit will call the entry's start method if |
running process, monit will call the entry's start method if |
1604 |
defined, If monit runs in passive mode or the start methods is |
defined, If monit runs in passive mode or the start methods is |
1605 |
not defined, monit will just send alerts on errors. |
not defined, monit will just send alerts on errors. |
1606 |
<p></p> |
<P></P> |
1607 |
<li><strong><a name="item_check_file_%3cunique_name%3e_path_%3cpath%3e">CHECK FILE <unique name> PATH <path></a></strong><br /> |
<LI><STRONG><A NAME="item_CHECK_FILE_%3Cunique_name%3E_PATH_%3Cpath%3E">CHECK FILE <unique name> PATH <path></A></STRONG><BR> |
1608 |
</li> |
|
1609 |
<path> is the absolute path to the file. If the file does not |
<path> is the absolute path to the file. If the file does not |
1610 |
exist or disappeared, monit will call the entry's start method if |
exist or disappeared, monit will call the entry's start method if |
1611 |
defined, if <path> does not point to a regular file type (for |
defined, if <path> does not point to a regular file type (for |
1612 |
instance a directory), monit will disable monitoring of this |
instance a directory), monit will disable monitoring of this |
1613 |
entry. If monit runs in passive mode or the start methods is not |
entry. If monit runs in passive mode or the start methods is not |
1614 |
defined, monit will just send alerts on errors. |
defined, monit will just send alerts on errors. |
1615 |
<p></p> |
<P></P> |
1616 |
<li><strong><a name="item_check_device_%3cunique_name%3e_path_%3cpath%3e">CHECK DEVICE <unique name> PATH <path></a></strong><br /> |
<LI><STRONG><A NAME="item_CHECK_DEVICE_%3Cunique_name%3E_PATH_%3Cpath%3E">CHECK DEVICE <unique name> PATH <path></A></STRONG><BR> |
1617 |
</li> |
|
1618 |
<path> is the path to the device block special file, mount point, |
<path> is the path to the device block special file, mount point, |
1619 |
file or a directory which is part of a filesystem. It is |
file or a directory which is part of a filesystem. It is |
1620 |
recommended to use a block special file directly (for example |
recommended to use a block special file directly (for example |
1622 |
use a mount point (for example /data), be careful, because if the |
use a mount point (for example /data), be careful, because if the |
1623 |
device is unmounted the test will still be true becasue the mount |
device is unmounted the test will still be true becasue the mount |
1624 |
point exist. |
point exist. |
1625 |
<p>If the device becomes unavailable, monit will call the entry's |
<P>If the device becomes unavailable, monit will call the entry's |
1626 |
start method if defined. if <path> does not point to a device, |
start method if defined. if <path> does not point to a device, |
1627 |
monit will disable monitoring of this entry. If monit runs in |
monit will disable monitoring of this entry. If monit runs in |
1628 |
passive mode or the start methods is not defined, monit will just |
passive mode or the start methods is not defined, monit will just |
1629 |
send alerts on errors.</p> |
send alerts on errors.</P> |
1630 |
<p></p> |
<P></P> |
1631 |
<li><strong><a name="item_check_directory_%3cunique_name%3e_path_%3cpath%3e">CHECK DIRECTORY <unique name> PATH <path></a></strong><br /> |
<LI><STRONG><A NAME="item_CHECK_DIRECTORY_%3Cunique_name%3E_PATH_%3Cpath%3E">CHECK DIRECTORY <unique name> PATH <path></A></STRONG><BR> |
1632 |
</li> |
|
1633 |
<path> is the absolute path to the directory. If the directory |
<path> is the absolute path to the directory. If the directory |
1634 |
does not exist or disappeared, monit will call the entry's start |
does not exist or disappeared, monit will call the entry's start |
1635 |
method if defined, if <path> does not point to a directory, monit |
method if defined, if <path> does not point to a directory, monit |
1636 |
will disable monitoring of this entry. If monit runs in passive |
will disable monitoring of this entry. If monit runs in passive |
1637 |
mode or the start methods is not defined, monit will just send |
mode or the start methods is not defined, monit will just send |
1638 |
alerts on errors. |
alerts on errors. |
1639 |
<p></p> |
<P></P> |
1640 |
<li><strong><a name="item_check_host_%3cunique_name%3e_address_%3chost_addre">CHECK HOST <unique name> ADDRESS <host address></a></strong><br /> |
<LI><STRONG><A NAME="item_CHECK_HOST_%3Cunique_name%3E_ADDRESS_%3Chost_addre">CHECK HOST <unique name> ADDRESS <host address></A></STRONG><BR> |
1641 |
</li> |
|
1642 |
The host address can be specified as a hostname string or as an |
The host address can be specified as a hostname string or as an |
1643 |
ip-address string on a dotted decimal format. Such as, |
ip-address string on a dotted decimal format. Such as, |
1644 |
tildeslash.com or ``64.87.72.95''. |
tildeslash.com or ``64.87.72.95''. |
1645 |
<p></p></ol> |
<P></P></OL> |
1646 |
<p>You can use noise keywords like 'if', `and', `with(in)', `has', |
<P>You can use noise keywords like 'if', `and', `with(in)', `has', |
1647 |
`using', 'use', 'on(ly)', `usage' and `program(s)' anywhere in an |
`using', 'use', 'on(ly)', `usage' and `program(s)' anywhere in an |
1648 |
entry to make it resemble English. They're ignored, but can make |
entry to make it resemble English. They're ignored, but can make |
1649 |
entries much easier to read at a glance. The punctuation |
entries much easier to read at a glance. The punctuation |
1650 |
characters ';' ',' and '=' are also ignored. Keywords are case |
characters ';' ',' and '=' are also ignored. Keywords are case |
1651 |
insensitive.</p> |
insensitive.</P> |
1652 |
<pre> |
<PRE> |
1653 |
Here are the legal global keywords:</pre> |
Here are the legal global keywords:</PRE> |
1654 |
<pre> |
<PRE> |
1655 |
Keyword Function |
Keyword Function |
1656 |
---------------------------------------------------------------- |
---------------------------------------------------------------- |
1657 |
set daemon Set a background poll interval in seconds. |
set daemon Set a background poll interval in seconds. |
1694 |
a username and password allowed to connect |
a username and password allowed to connect |
1695 |
to the server. More than one allow statement |
to the server. More than one allow statement |
1696 |
are allowed. This statement is also an |
are allowed. This statement is also an |
1697 |
optional part of the set httpd statement.</pre> |
optional part of the set httpd statement.</PRE> |
1698 |
<pre> |
<PRE> |
1699 |
Here are the legal service entry keywords:</pre> |
Here are the legal service entry keywords:</PRE> |
1700 |
<pre> |
<PRE> |
1701 |
Keyword Function |
Keyword Function |
1702 |
---------------------------------------------------------------- |
---------------------------------------------------------------- |
1703 |
check Starts an entry and must be followed by the type |
check Starts an entry and must be followed by the type |
1850 |
number, unit {B|KB|MB|GB|byte|kilobyte| |
number, unit {B|KB|MB|GB|byte|kilobyte| |
1851 |
megabyte|gigabyte} and an action. |
megabyte|gigabyte} and an action. |
1852 |
depends (on) Must be followed by the name of a service this |
depends (on) Must be followed by the name of a service this |
1853 |
service depends on.</pre> |
service depends on.</PRE> |
1854 |
<p>Here's the complete list of reserved <strong>keywords</strong> used by monit:</p> |
<P>Here's the complete list of reserved <STRONG>keywords</STRONG> used by monit:</P> |
1855 |
<p><em>if</em>, <em>then</em>, <em>else</em>, <em>set</em>, <em>daemon</em>, <em>logfile</em>, |
<P><EM>if</EM>, <EM>then</EM>, <EM>else</EM>, <EM>set</EM>, <EM>daemon</EM>, <EM>logfile</EM>, |
1856 |
<em>syslog</em>, <em>address</em>, <em>httpd</em>, <em>ssl</em>, <em>enable</em>, <em>disable</em>, |
<EM>syslog</EM>, <EM>address</EM>, <EM>httpd</EM>, <EM>ssl</EM>, <EM>enable</EM>, <EM>disable</EM>, |
1857 |
<em>pemfile</em>, <em>allow</em>, <em>check</em>, <em>init</em>, <em>pidfile</em>, |
<EM>pemfile</EM>, <EM>allow</EM>, <EM>check</EM>, <EM>init</EM>, <EM>pidfile</EM>, |
1858 |
<em>statefile</em>, <em>group</em>, <em>start</em>, <em>stop</em>, <em>uid</em>, <em>gid</em>, |
<EM>statefile</EM>, <EM>group</EM>, <EM>start</EM>, <EM>stop</EM>, <EM>uid</EM>, <EM>gid</EM>, |
1859 |
<em>connection</em>, <em>port(number)</em>, <em>unix(socket)</em>, <em>type</em>, |
<EM>connection</EM>, <EM>port(number)</EM>, <EM>unix(socket)</EM>, <EM>type</EM>, |
1860 |
<em>proto(col)</em>, <em>tcp</em>, <em>tcpssl</em>, <em>udp</em>, <em>alert</em>, |
<EM>proto(col)</EM>, <EM>tcp</EM>, <EM>tcpssl</EM>, <EM>udp</EM>, <EM>alert</EM>, |
1861 |
<em>mail-format</em>, <em>restart</em>, <em>timeout</em>, <em>checksum</em>, <em>resource</em>, |
<EM>mail-format</EM>, <EM>restart</EM>, <EM>timeout</EM>, <EM>checksum</EM>, <EM>resource</EM>, |
1862 |
<em>expect</em>, <em>mailserver</em>, <em>every</em>, <em>mode</em>, <em>active</em>, |
<EM>expect</EM>, <EM>mailserver</EM>, <EM>every</EM>, <EM>mode</EM>, <EM>active</EM>, |
1863 |
<em>passive</em>, <em>manual</em>, <em>depends</em>, <em>host</em>, <em>default</em>, <em>http</em>, |
<EM>passive</EM>, <EM>manual</EM>, <EM>depends</EM>, <EM>host</EM>, <EM>default</EM>, <EM>http</EM>, |
1864 |
<em>ftp</em>, <em>smtp</em>, <em>pop</em>, <em>nntp</em>, <em>imap</em>, <em>ssh</em>, <em>dwp</em>, |
<EM>ftp</EM>, <EM>smtp</EM>, <EM>pop</EM>, <EM>nntp</EM>, <EM>imap</EM>, <EM>ssh</EM>, <EM>dwp</EM>, |
1865 |
<em>ldap2</em>, <em>ldap3</em>, <em>request</em>, <em>cpu</em>, <em>mem</em>, <em>totalmem</em>, |
<EM>ldap2</EM>, <EM>ldap3</EM>, <EM>request</EM>, <EM>cpu</EM>, <EM>mem</EM>, <EM>totalmem</EM>, |
1866 |
<em>children</em>, <em>loadavg</em>, <em>timestamp</em>, <em>changed</em>, <em>second(s)</em>, |
<EM>children</EM>, <EM>loadavg</EM>, <EM>timestamp</EM>, <EM>changed</EM>, <EM>second(s)</EM>, |
1867 |
<em>minute(s)</em>, <em>hour(s)</em>, <em>day(s)</em>, <em>space</em>, <em>inode</em>, |
<EM>minute(s)</EM>, <EM>hour(s)</EM>, <EM>day(s)</EM>, <EM>space</EM>, <EM>inode</EM>, |
1868 |
<em>perm(ission)</em>, <em>process</em>, <em>file</em>, <em>directory</em>, <em>device</em>, |
<EM>perm(ission)</EM>, <EM>process</EM>, <EM>file</EM>, <EM>directory</EM>, <EM>device</EM>, |
1869 |
<em>size</em>, <em>unmonitor</em>, <em>rdate</em>, <em>rsync</em> and <em>failed</em></p> |
<EM>size</EM>, <EM>unmonitor</EM>, <EM>rdate</EM>, <EM>rsync</EM> and <EM>failed</EM></P> |
1870 |
<p>And here is a complete list of <strong>noise keywords</strong> ignored by |
<P>And here is a complete list of <STRONG>noise keywords</STRONG> ignored by |
1871 |
monit:</p> |
monit:</P> |
1872 |
<p><em>is</em>, <em>as</em>, <em>are</em>, <em>on(ly)</em>, <em>with(in)</em>, <em>and</em>, <em>has</em>, |
<P><EM>is</EM>, <EM>as</EM>, <EM>are</EM>, <EM>on(ly)</EM>, <EM>with(in)</EM>, <EM>and</EM>, <EM>has</EM>, |
1873 |
<em>using</em>, <em>use</em>, <em>the</em>, <em>sum</em>, <em>program(s)</em>, <em>than</em>, <em>for</em>, |
<EM>using</EM>, <EM>use</EM>, <EM>the</EM>, <EM>sum</EM>, <EM>program(s)</EM>, <EM>than</EM>, <EM>for</EM>, |
1874 |
<em>usage</em>, <em>was</em>.</p> |
<EM>usage</EM>, <EM>was</EM>.</P> |
1875 |
<p><strong>Note:</strong> If the <em>start</em> or <em>stop</em> programs are shell scripts, |
<P><STRONG>Note:</STRONG> If the <EM>start</EM> or <EM>stop</EM> programs are shell scripts, |
1876 |
then the script must begin with <code>#!</code> and the remainder of the |
then the script must begin with <CODE>#!</CODE> and the remainder of the |
1877 |
first line must specify an interpreter for the |
first line must specify an interpreter for the |
1878 |
program. E.g. <code>#!/bin/sh</code></p> |
program. E.g. <CODE>#!/bin/sh</CODE></P> |
1879 |
<p>It's possible to write scripts directly into the <em>start</em> and |
<P>It's possible to write scripts directly into the <EM>start</EM> and |
1880 |
<em>stop</em> entries by using a string of shell-commands. Like so:</p> |
<EM>stop</EM> entries by using a string of shell-commands. Like so:</P> |
1881 |
<pre> |
<PRE> |
1882 |
start="/bin/bash -c 'echo $$ > pidfile; exec program'" |
start="/bin/bash -c 'echo $$ > pidfile; exec program'" |
1883 |
stop="/bin/bash -c 'kill -s SIGTERM `cat pidfile`'"</pre> |
stop="/bin/bash -c 'kill -s SIGTERM `cat pidfile`'"</PRE> |
1884 |
<p> |
<P> |
1885 |
</p> |
<H2><A NAME="configuration examples">CONFIGURATION EXAMPLES</A></H2> |
1886 |
<h2><a name="configuration_examples">CONFIGURATION EXAMPLES</a></h2> |
<P>The simplest form is just the check statement. In this example we |
1887 |
<p>The simplest form is just the check statement. In this example we |
check to see if the server is running and log a message if not:</P> |
1888 |
check to see if the server is running and log a message if not:</p> |
<PRE> |
1889 |
<pre> |
check process resin with pidfile /usr/local/resin/srun.pid</PRE> |
1890 |
check process resin with pidfile /usr/local/resin/srun.pid</pre> |
<P>To have monit start the server if it's not running, add a start |
1891 |
<p>To have monit start the server if it's not running, add a start |
statement:</P> |
1892 |
statement:</p> |
<PRE> |
|
<pre> |
|
1893 |
check process resin with pidfile /usr/local/resin/srun.pid |
check process resin with pidfile /usr/local/resin/srun.pid |
1894 |
start program = "/usr/local/resin/bin/srun.sh start"</pre> |
start program = "/usr/local/resin/bin/srun.sh start"</PRE> |
1895 |
<p>Here's a more advanced example for monitoring an apache |
<P>Here's a more advanced example for monitoring an apache |
1896 |
web-server listening on the default portnumber for HTTP and |
web-server listening on the default portnumber for HTTP and |
1897 |
HTTPS. In this example monit will restart apache if it's not |
HTTPS. In this example monit will restart apache if it's not |
1898 |
accepting connections at the portnumbers. The method monit use |
accepting connections at the portnumbers. The method monit use |
1900 |
for the process to stop and then execute the start-program. (If |
for the process to stop and then execute the start-program. (If |
1901 |
monit was unable to stop or start the service a failed alert |
monit was unable to stop or start the service a failed alert |
1902 |
message will be sent if you have requested alert messages to be |
message will be sent if you have requested alert messages to be |
1903 |
sent).</p> |
sent).</P> |
1904 |
<pre> |
<PRE> |
1905 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
1906 |
start program = "/etc/init.d/httpd start" |
start program = "/etc/init.d/httpd start" |
1907 |
stop program = "/etc/init.d/httpd stop" |
stop program = "/etc/init.d/httpd stop" |
1908 |
if failed port 80 then restart |
if failed port 80 then restart |
1909 |
if failed port 443 with timeout 15 seconds then restart</pre> |
if failed port 443 with timeout 15 seconds then restart</PRE> |
1910 |
<p>This example demonstrate how you can run a program as a specified |
<P>This example demonstrate how you can run a program as a specified |
1911 |
user (uid) and with a specified group (gid). Many daemon programs |
user (uid) and with a specified group (gid). Many daemon programs |
1912 |
will do the uid and gid switch by themself, but for those |
will do the uid and gid switch by themself, but for those |
1913 |
programs that does not (e.g. java programs), monit's ability to |
programs that does not (e.g. java programs), monit's ability to |
1914 |
start a program as a certain user can be very useful. In this |
start a program as a certain user can be very useful. In this |
1915 |
example we start the Tomcat Java Servlet Engine as the standard |
example we start the Tomcat Java Servlet Engine as the standard |
1916 |
<em>nobody</em> user and group. Please note that monit will only switch |
<EM>nobody</EM> user and group. Please note that monit will only switch |
1917 |
uid and gid for a program if the super-user is running monit, |
uid and gid for a program if the super-user is running monit, |
1918 |
otherwise monit will simply ignore the request to change uid and |
otherwise monit will simply ignore the request to change uid and |
1919 |
gid.</p> |
gid.</P> |
1920 |
<pre> |
<PRE> |
1921 |
check process tomcat with pidfile /var/run/tomcat.pid |
check process tomcat with pidfile /var/run/tomcat.pid |
1922 |
start program = "/etc/init.d/tomcat start" |
start program = "/etc/init.d/tomcat start" |
1923 |
as uid nobody and gid nobody |
as uid nobody and gid nobody |
1924 |
stop program = "/etc/init.d/tomcat stop" |
stop program = "/etc/init.d/tomcat stop" |
1925 |
# You can also use id numbers instead and write: |
# You can also use id numbers instead and write: |
1926 |
as uid 99 and with gid 99 |
as uid 99 and with gid 99 |
1927 |
if failed port 8080 then alert</pre> |
if failed port 8080 then alert</PRE> |
1928 |
<p>In this example we use udp for connection testing to check if the |
<P>In this example we use udp for connection testing to check if the |
1929 |
name-server is running and also use timeout and alert:</p> |
name-server is running and also use timeout and alert:</P> |
1930 |
<pre> |
<PRE> |
1931 |
check process named with pidfile /var/run/named.pid |
check process named with pidfile /var/run/named.pid |
1932 |
start program = "/etc/init.d/named start" |
start program = "/etc/init.d/named start" |
1933 |
stop program = "/etc/init.d/named stop" |
stop program = "/etc/init.d/named stop" |
1934 |
if failed port 53 use type udp then restart |
if failed port 53 use type udp then restart |
1935 |
if 3 restarts within 5 cycles then timeout |
if 3 restarts within 5 cycles then timeout |
1936 |
alert bofh@norid.no</pre> |
alert bofh@norid.no</PRE> |
1937 |
<p>The following example illustrate how to check if the service |
<P>The following example illustrate how to check if the service |
1938 |
'sophie' is answering connections on its Unix domain socket:</p> |
'sophie' is answering connections on its Unix domain socket:</P> |
1939 |
<pre> |
<PRE> |
1940 |
check process sophie with pidfile /var/run/sophie.pid |
check process sophie with pidfile /var/run/sophie.pid |
1941 |
start program = "/etc/init.d/sophie start" |
start program = "/etc/init.d/sophie start" |
1942 |
stop program = "/etc/init.d/sophie stop" |
stop program = "/etc/init.d/sophie stop" |
1943 |
if failed unix /var/run/sophie then restart</pre> |
if failed unix /var/run/sophie then restart</PRE> |
1944 |
<p>In this example we check an apache web-server running on |
<P>In this example we check an apache web-server running on |
1945 |
localhost that answers for several IP-based virtual hosts or |
localhost that answers for several IP-based virtual hosts or |
1946 |
vhosts, hence the host statement before port:</p> |
vhosts, hence the host statement before port:</P> |
1947 |
<pre> |
<PRE> |
1948 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
1949 |
start "/etc/init.d/httpd start" |
start "/etc/init.d/httpd start" |
1950 |
stop "/etc/init.d/httpd stop" |
stop "/etc/init.d/httpd stop" |
1951 |
if failed host www.sol.no port 80 then alert |
if failed host www.sol.no port 80 then alert |
1952 |
if failed host shop.sol.no port 443 then alert |
if failed host shop.sol.no port 443 then alert |
1953 |
if failed host chat.sol.no port 80 then alert |
if failed host chat.sol.no port 80 then alert |
1954 |
if failed host www.tildeslash.com port 80 then alert</pre> |
if failed host www.tildeslash.com port 80 then alert</PRE> |
1955 |
<p>In the following example we ask monit to compute and verify the |
<P>In the following example we ask monit to compute and verify the |
1956 |
checksum for the underlying apache binary used by the start and |
checksum for the underlying apache binary used by the start and |
1957 |
stop programs. If the the checksum test should fail, monitoring |
stop programs. If the the checksum test should fail, monitoring |
1958 |
will be disabled to prevent possibly starting a compromised |
will be disabled to prevent possibly starting a compromised |
1959 |
binary:</p> |
binary:</P> |
1960 |
<pre> |
<PRE> |
1961 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
1962 |
start program = "/etc/init.d/httpd start" |
start program = "/etc/init.d/httpd start" |
1963 |
stop program = "/etc/init.d/httpd stop" |
stop program = "/etc/init.d/httpd stop" |
1964 |
if failed host www.tildeslash.com port 80 then restart |
if failed host www.tildeslash.com port 80 then restart |
1965 |
depends on apache_bin</pre> |
depends on apache_bin</PRE> |
1966 |
<pre> |
<PRE> |
1967 |
check file apache_bin with path /usr/local/apache/bin/httpd |
check file apache_bin with path /usr/local/apache/bin/httpd |
1968 |
if failed checksum then unmonitor |
if failed checksum then unmonitor |
1969 |
alert foo@bar.baz</pre> |
alert foo@bar.baz</PRE> |
1970 |
<p>Some servers are slow starters, like for example Java based |
<P>Some servers are slow starters, like for example Java based |
1971 |
Application Servers. So if we want to keep the poll-cycle low |
Application Servers. So if we want to keep the poll-cycle low |
1972 |
(i.e. < 60 seconds) but allow some services to take its time to |
(i.e. < 60 seconds) but allow some services to take its time to |
1973 |
start, the <strong>every</strong> statement is handy:</p> |
start, the <STRONG>every</STRONG> statement is handy:</P> |
1974 |
<pre> |
<PRE> |
1975 |
check process dynamo with pidfile /etc/dynamo.pid |
check process dynamo with pidfile /etc/dynamo.pid |
1976 |
start program = "/etc/init.d/dynamo start" |
start program = "/etc/init.d/dynamo start" |
1977 |
stop program = "/etc/init.d/dynamo stop" |
stop program = "/etc/init.d/dynamo stop" |
1978 |
if failed port 8840 then alert |
if failed port 8840 then alert |
1979 |
every 2 cycles</pre> |
every 2 cycles</PRE> |
1980 |
<p>Here is an example where we group together two database entries |
<P>Here is an example where we group together two database entries |
1981 |
so you can manage them together, e.g.; 'monit -g database start |
so you can manage them together, e.g.; 'monit -g database start |
1982 |
all'. The mode statement is also illustrated in the first entry |
all'. The mode statement is also illustrated in the first entry |
1983 |
and have the effect that monit will not try to (re)start this |
and have the effect that monit will not try to (re)start this |
1984 |
service if it is not running:</p> |
service if it is not running:</P> |
1985 |
<pre> |
<PRE> |
1986 |
check process sybase with pidfile /var/run/sybase.pid |
check process sybase with pidfile /var/run/sybase.pid |
1987 |
start = "/etc/init.d/sybase start" |
start = "/etc/init.d/sybase start" |
1988 |
stop = "/etc/init.d/sybase stop" |
stop = "/etc/init.d/sybase stop" |
1989 |
mode passive |
mode passive |
1990 |
group database</pre> |
group database</PRE> |
1991 |
<pre> |
<PRE> |
1992 |
check process oracle with pidfile /var/run/oracle.pid |
check process oracle with pidfile /var/run/oracle.pid |
1993 |
start program = "/etc/init.d/oracle start" |
start program = "/etc/init.d/oracle start" |
1994 |
stop program = "/etc/init.d/oracle stop" |
stop program = "/etc/init.d/oracle stop" |
1995 |
mode active # Not necessary really, since it's the default |
mode active # Not necessary really, since it's the default |
1996 |
if failed port 9001 then restart |
if failed port 9001 then restart |
1997 |
alert bofh@foo.bar |
alert bofh@foo.bar |
1998 |
group database</pre> |
group database</PRE> |
1999 |
<p>Here is an example to show the usage of the resource checks. It |
<P>Here is an example to show the usage of the resource checks. It |
2000 |
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 |
2001 |
child processes raises beyond 60% for over two cycles. Apache is |
child processes raises beyond 60% for over two cycles. Apache is |
2002 |
restarted if the CPU usage is over 80% for five cycles or the |
restarted if the CPU usage is over 80% for five cycles or the |
2003 |
memory usage over 100Mb for five cycles or if the machines load |
memory usage over 100Mb for five cycles or if the machines load |
2004 |
average is more than 10 for 8 cycles:</p> |
average is more than 10 for 8 cycles:</P> |
2005 |
<pre> |
<PRE> |
2006 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
2007 |
start program = "/etc/init.d/httpd start" |
start program = "/etc/init.d/httpd start" |
2008 |
stop program = "/etc/init.d/httpd stop" |
stop program = "/etc/init.d/httpd stop" |
2009 |
if cpu > 60% for 2 cycles then alert |
if cpu > 60% for 2 cycles then alert |
2010 |
if cpu > 80% for 5 cycles then restart |
if cpu > 80% for 5 cycles then restart |
2011 |
if mem > 100 MB for 5 cycles then stop |
if mem > 100 MB for 5 cycles then stop |
2012 |
if loadavg(5min) greater than 10.0 for 8 cycles then stop</pre> |
if loadavg(5min) greater than 10.0 for 8 cycles then stop</PRE> |
2013 |
<p>This examples demonstrate the timestamp statement with exec and |
<P>This examples demonstrate the timestamp statement with exec and |
2014 |
how you may restart apache if it's configuration file was |
how you may restart apache if it's configuration file was |
2015 |
changed.</p> |
changed.</P> |
2016 |
<pre> |
<PRE> |
2017 |
check file httpd.conf with path /usr/local/apache/conf/httpd.conf |
check file httpd.conf with path /usr/local/apache/conf/httpd.conf |
2018 |
if timestamp was changed |
if timestamp was changed |
2019 |
then exec "/etc/init.d/httpd graceful"</pre> |
then exec "/etc/init.d/httpd graceful"</PRE> |
2020 |
<p>In this example we demonstrate usage of the extended alert |
<P>In this example we demonstrate usage of the extended alert |
2021 |
statement and a file check dependency:</p> |
statement and a file check dependency:</P> |
2022 |
<pre> |
<PRE> |
2023 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
2024 |
start = "/etc/init.d/httpd start" |
start = "/etc/init.d/httpd start" |
2025 |
stop = "/etc/init.d/httpd stop" |
stop = "/etc/init.d/httpd stop" |
2034 |
} |
} |
2035 |
if 3 restarts within 5 cycles then timeout |
if 3 restarts within 5 cycles then timeout |
2036 |
depend httpd_bin |
depend httpd_bin |
2037 |
group apache</pre> |
group apache</PRE> |
2038 |
<pre> |
<PRE> |
2039 |
check file httpd_bin with path /usr/local/apache/bin/httpd |
check file httpd_bin with path /usr/local/apache/bin/httpd |
2040 |
if failed checksum |
if failed checksum |
2041 |
and expect 8f7f419955cefa0b33a2ba316cba3659 |
and expect 8f7f419955cefa0b33a2ba316cba3659 |
2047 |
alert security@bar on {checksum, timestamp, |
alert security@bar on {checksum, timestamp, |
2048 |
permission, uid, gid, unmonitor} |
permission, uid, gid, unmonitor} |
2049 |
with mail-format {subject: Alaaarrm! on $HOST} |
with mail-format {subject: Alaaarrm! on $HOST} |
2050 |
group apache</pre> |
group apache</PRE> |
2051 |
<p>In this example, we demonstrate usage of the depend statement. In |
<P>In this example, we demonstrate usage of the depend statement. In |
2052 |
this case, we want to start oracle and apache. However, we've set |
this case, we want to start oracle and apache. However, we've set |
2053 |
up apache to use oracle as a backend, and if oracle is restarted, |
up apache to use oracle as a backend, and if oracle is restarted, |
2054 |
apache must be restarted as well.</p> |
apache must be restarted as well.</P> |
2055 |
<pre> |
<PRE> |
2056 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
2057 |
start = "/etc/init.d/httpd start" |
start = "/etc/init.d/httpd start" |
2058 |
stop = "/etc/init.d/httpd stop" |
stop = "/etc/init.d/httpd stop" |
2059 |
depends on oracle</pre> |
depends on oracle</PRE> |
2060 |
<pre> |
<PRE> |
2061 |
check process oracle with pidfile /var/run/oracle.pid |
check process oracle with pidfile /var/run/oracle.pid |
2062 |
start = "/etc/init.d/oracle start" |
start = "/etc/init.d/oracle start" |
2063 |
stop = "/etc/init.d/oracle stop" |
stop = "/etc/init.d/oracle stop" |
2064 |
if failed port 9001 then restart</pre> |
if failed port 9001 then restart</PRE> |
2065 |
<p>Next, we have 2 services, oracle-import and oracle-export that |
<P>Next, we have 2 services, oracle-import and oracle-export that |
2066 |
need to be restarted if oracle is restarted, but are independent |
need to be restarted if oracle is restarted, but are independent |
2067 |
of each other.</p> |
of each other.</P> |
2068 |
<pre> |
<PRE> |
2069 |
check process oracle with pidfile /var/run/oracle.pid |
check process oracle with pidfile /var/run/oracle.pid |
2070 |
start = "/etc/init.d/oracle start" |
start = "/etc/init.d/oracle start" |
2071 |
stop = "/etc/init.d/oracle stop" |
stop = "/etc/init.d/oracle stop" |
2072 |
if failed port 9001 then restart</pre> |
if failed port 9001 then restart</PRE> |
2073 |
<pre> |
<PRE> |
2074 |
check process oracle-import |
check process oracle-import |
2075 |
with pidfile /var/run/oracle-import.pid |
with pidfile /var/run/oracle-import.pid |
2076 |
start = "/etc/init.d/oracle-import start" |
start = "/etc/init.d/oracle-import start" |
2077 |
stop = "/etc/init.d/oracle-import stop" |
stop = "/etc/init.d/oracle-import stop" |
2078 |
depends on oracle</pre> |
depends on oracle</PRE> |
2079 |
<pre> |
<PRE> |
2080 |
check process oracle-export |
check process oracle-export |
2081 |
with pidfile /var/run/oracle-export.pid |
with pidfile /var/run/oracle-export.pid |
2082 |
start = "/etc/init.d/oracle-export start" |
start = "/etc/init.d/oracle-export start" |
2083 |
stop = "/etc/init.d/oracle-export stop" |
stop = "/etc/init.d/oracle-export stop" |
2084 |
depends on oracle</pre> |
depends on oracle</PRE> |
2085 |
<p>Finally an example with all statements:</p> |
<P>Finally an example with all statements:</P> |
2086 |
<pre> |
<PRE> |
2087 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
2088 |
start program = "/etc/init.d/httpd start" |
start program = "/etc/init.d/httpd start" |
2089 |
stop program = "/etc/init.d/httpd stop" |
stop program = "/etc/init.d/httpd stop" |
2106 |
depends on httpd.conf |
depends on httpd.conf |
2107 |
depends on httpd_bin |
depends on httpd_bin |
2108 |
depends on datafs |
depends on datafs |
2109 |
group server</pre> |
group server</PRE> |
2110 |
<pre> |
<PRE> |
2111 |
check file httpd.pid with path /usr/local/apache/logs/httpd.pid |
check file httpd.pid with path /usr/local/apache/logs/httpd.pid |
2112 |
group server |
group server |
2113 |
if timestamp > 7 days then restart |
if timestamp > 7 days then restart |
2114 |
every 2 cycles |
every 2 cycles |
2115 |
alert bofh@bar with mail-format {from: monit@foo.bar.no} |
alert bofh@bar with mail-format {from: monit@foo.bar.no} |
2116 |
depends on datafs</pre> |
depends on datafs</PRE> |
2117 |
<pre> |
<PRE> |
2118 |
check file httpd.conf with path /usr/local/apache/conf/httpd.conf |
check file httpd.conf with path /usr/local/apache/conf/httpd.conf |
2119 |
group server |
group server |
2120 |
if timestamp was changed |
if timestamp was changed |
2121 |
then exec "/usr/local/apache/bin/apachectl graceful" |
then exec "/usr/local/apache/bin/apachectl graceful" |
2122 |
every 2 cycles |
every 2 cycles |
2123 |
alert bofh@bar with mail-format {from: monit@foo.bar.no} |
alert bofh@bar with mail-format {from: monit@foo.bar.no} |
2124 |
depends on datafs</pre> |
depends on datafs</PRE> |
2125 |
<pre> |
<PRE> |
2126 |
check file httpd_bin with path /usr/local/apache/bin/httpd |
check file httpd_bin with path /usr/local/apache/bin/httpd |
2127 |
group server |
group server |
2128 |
if failed checksum and expect the sum |
if failed checksum and expect the sum |
2135 |
every 2 cycles |
every 2 cycles |
2136 |
alert bofh@bar with mail-format {from: monit@foo.bar.no} |
alert bofh@bar with mail-format {from: monit@foo.bar.no} |
2137 |
alert foo@bar on { checksum, size, timestamp, uid, gid } |
alert foo@bar on { checksum, size, timestamp, uid, gid } |
2138 |
depends on datafs</pre> |
depends on datafs</PRE> |
2139 |
<pre> |
<PRE> |
2140 |
check device datafs with path /dev/sdb1 |
check device datafs with path /dev/sdb1 |
2141 |
group server |
group server |
2142 |
start program = "/bin/mount /data" |
start program = "/bin/mount /data" |
2148 |
if space usage > 94 % then stop |
if space usage > 94 % then stop |
2149 |
if inode usage > 80 % then alert |
if inode usage > 80 % then alert |
2150 |
if inode usage > 94 % then stop |
if inode usage > 94 % then stop |
2151 |
alert root@localhost</pre> |
alert root@localhost</PRE> |
2152 |
<pre> |
<PRE> |
2153 |
check host ftp.redhat.com with address ftp.redhat.com |
check host ftp.redhat.com with address ftp.redhat.com |
2154 |
if failed port 21 protocol ftp |
if failed port 21 protocol ftp |
2155 |
then exec "/usr/X11R6/bin/xmessage -display |
then exec "/usr/X11R6/bin/xmessage -display |
2156 |
:0 ftp connection failed" |
:0 ftp connection failed" |
2157 |
alert hauk@tildeslash.com</pre> |
alert hauk@tildeslash.com</PRE> |
2158 |
<p>Note; only the <strong>check type</strong>, <strong>pidfile/path/address</strong> statements |
<P>Note; only the <STRONG>check type</STRONG>, <STRONG>pidfile/path/address</STRONG> statements |
2159 |
are mandatory, the other statements are optional and the order of |
are mandatory, the other statements are optional and the order of |
2160 |
the optional statements is not important.</p> |
the optional statements is not important.</P> |
2161 |
<p> |
<P> |
2162 |
</p> |
<HR> |
2163 |
<hr /> |
<H1><A NAME="monit with heartbeat">MONIT WITH HEARTBEAT</A></H1> |
2164 |
<h1><a name="monit_with_heartbeat">MONIT WITH HEARTBEAT</a></h1> |
<P>You can download <EM>heartbeat</EM> from |
2165 |
<p>You can download <em>heartbeat</em> from |
<A HREF="http://www.linux-ha.org/download/.">http://www.linux-ha.org/download/.</A> It might be useful to have a |
|
<a href="http://www.linux-ha.org/download/.">http://www.linux-ha.org/download/.</a> It might be useful to have a |
|
2166 |
look at The Heartbeat Getting Started Guide at: |
look at The Heartbeat Getting Started Guide at: |
2167 |
<a href="http://www.linux-ha.org/GettingStarted.html">http://www.linux-ha.org/GettingStarted.html</a></p> |
<A HREF="http://www.linux-ha.org/GettingStarted.html">http://www.linux-ha.org/GettingStarted.html</A></P> |
2168 |
<p><strong>Starting up a Node</strong></p> |
<P><STRONG>Starting up a Node</STRONG></P> |
2169 |
<p>This is the normal start sequence for a cluster-node. With this |
<P>This is the normal start sequence for a cluster-node. With this |
2170 |
sequence, there should be no error-case, which is not handled |
sequence, there should be no error-case, which is not handled |
2171 |
either by heartbeat or by monit. For example, if monit dies, |
either by heartbeat or by monit. For example, if monit dies, |
2172 |
initd restarts it. If heatbeat dies, monit restarts it. If the |
initd restarts it. If heatbeat dies, monit restarts it. If the |
2173 |
node dies, the heartbeat instance on the other node detects it |
node dies, the heartbeat instance on the other node detects it |
2174 |
and restart the services there.</p> |
and restart the services there.</P> |
2175 |
<ol> |
<OL> |
2176 |
<li><strong><a name="item_initd_starts_monit_with_group_local">initd starts monit with group local</a></strong><br /> |
<LI><STRONG><A NAME="item_initd_starts_monit_with_group_local">initd starts monit with group local</A></STRONG><BR> |
2177 |
</li> |
|
2178 |
<li><strong><a name="item_monit_starts_heartbeat_in_local_group">monit starts heartbeat in local group</a></strong><br /> |
<LI><STRONG><A NAME="item_monit_starts_heartbeat_in_local_group">monit starts heartbeat in local group</A></STRONG><BR> |
2179 |
</li> |
|
2180 |
<li><strong><a name="item_heartbeat_requests_monit_to_start_the_node_group">heartbeat requests monit to start the node group</a></strong><br /> |
<LI><STRONG><A NAME="item_heartbeat_requests_monit_to_start_the_node_group">heartbeat requests monit to start the node group</A></STRONG><BR> |
2181 |
</li> |
|
2182 |
<li><strong><a name="item_monit_starts_the_node_group">monit starts the node group</a></strong><br /> |
<LI><STRONG><A NAME="item_monit_starts_the_node_group">monit starts the node group</A></STRONG><BR> |
2183 |
</li> |
|
2184 |
</ol> |
</OL> |
2185 |
<p><strong>Monit: <em>/etc/monitrc</em></strong></p> |
<P><STRONG>Monit: <EM>/etc/monitrc</EM></STRONG></P> |
2186 |
<p>This example describes a cluster with 2 nodes. Services running |
<P>This example describes a cluster with 2 nodes. Services running |
2187 |
on Node 1 are in the group <em>node1</em> and Node 2 services are in |
on Node 1 are in the group <EM>node1</EM> and Node 2 services are in |
2188 |
the <em>node2</em> group.</p> |
the <EM>node2</EM> group.</P> |
2189 |
<p>The local group entries are mode <em>active</em>, the node group |
<P>The local group entries are mode <EM>active</EM>, the node group |
2190 |
entries are mode <em>manual</em> and controlled by heartbeat.</p> |
entries are mode <EM>manual</EM> and controlled by heartbeat.</P> |
2191 |
<pre> |
<PRE> |
2192 |
# |
# |
2193 |
# local services on both hosts |
# local services on both hosts |
2194 |
#</pre> |
#</PRE> |
2195 |
<pre> |
<PRE> |
2196 |
check process heartbeat with pidfile /var/run/heartbeat.pid |
check process heartbeat with pidfile /var/run/heartbeat.pid |
2197 |
start program = "/etc/init.d/heartbeat start" |
start program = "/etc/init.d/heartbeat start" |
2198 |
stop program = "/etc/init.d/heartbeat start" |
stop program = "/etc/init.d/heartbeat start" |
2199 |
mode active |
mode active |
2200 |
alert foo@bar |
alert foo@bar |
2201 |
group local</pre> |
group local</PRE> |
2202 |
<pre> |
<PRE> |
2203 |
check process postfix with pidfile /var/spool/postfix/pid/master.pid |
check process postfix with pidfile /var/spool/postfix/pid/master.pid |
2204 |
start program = "/etc/init.d/postfix start" |
start program = "/etc/init.d/postfix start" |
2205 |
stop program = "/etc/init.d/postfix stop" |
stop program = "/etc/init.d/postfix stop" |
2206 |
mode active |
mode active |
2207 |
alert foo@bar |
alert foo@bar |
2208 |
group local</pre> |
group local</PRE> |
2209 |
<pre> |
<PRE> |
2210 |
# |
# |
2211 |
# node1 services |
# node1 services |
2212 |
#</pre> |
#</PRE> |
2213 |
<pre> |
<PRE> |
2214 |
check process apache with pidfile /var/apache/logs/httpd.pid |
check process apache with pidfile /var/apache/logs/httpd.pid |
2215 |
start program = "/etc/init.d/apache start" |
start program = "/etc/init.d/apache start" |
2216 |
stop program = "/etc/init.d/apache stop" |
stop program = "/etc/init.d/apache stop" |
2217 |
depends named |
depends named |
2218 |
alert foo@bar |
alert foo@bar |
2219 |
mode manual |
mode manual |
2220 |
group node1</pre> |
group node1</PRE> |
2221 |
<pre> |
<PRE> |
2222 |
check process named with pidfile /var/tmp/named.pid |
check process named with pidfile /var/tmp/named.pid |
2223 |
start program = "/etc/init.d/named start" |
start program = "/etc/init.d/named start" |
2224 |
stop program = "/etc/init.d/named stop" |
stop program = "/etc/init.d/named stop" |
2225 |
alert foo@bar |
alert foo@bar |
2226 |
mode manual |
mode manual |
2227 |
group node1</pre> |
group node1</PRE> |
2228 |
<pre> |
<PRE> |
2229 |
# |
# |
2230 |
# node2 services |
# node2 services |
2231 |
#</pre> |
#</PRE> |
2232 |
<pre> |
<PRE> |
2233 |
check process named-slave with pidfile /var/tmp/named-slave.pid |
check process named-slave with pidfile /var/tmp/named-slave.pid |
2234 |
start program = "/etc/init.d/named-slave start" |
start program = "/etc/init.d/named-slave start" |
2235 |
stop program = "/etc/init.d/named-slave stop" |
stop program = "/etc/init.d/named-slave stop" |
2236 |
mode manual |
mode manual |
2237 |
alert foo@bar |
alert foo@bar |
2238 |
group node2</pre> |
group node2</PRE> |
2239 |
<pre> |
<PRE> |
2240 |
check process squid with pidfile /var/squid/logs/squid.pid |
check process squid with pidfile /var/squid/logs/squid.pid |
2241 |
start program = "/etc/init.d/squid start" |
start program = "/etc/init.d/squid start" |
2242 |
stop program = "/etc/init.d/squid stop" |
stop program = "/etc/init.d/squid stop" |
2243 |
depends named-slave |
depends named-slave |
2244 |
alert foo@bar |
alert foo@bar |
2245 |
mode manual |
mode manual |
2246 |
group node2</pre> |
group node2</PRE> |
2247 |
<p><strong>initd: <em>/etc/inittab</em></strong></p> |
<P><STRONG>initd: <EM>/etc/inittab</EM></STRONG></P> |
2248 |
<p>Monit is started on both nodes with initd. You will need to add |
<P>Monit is started on both nodes with initd. You will need to add |
2249 |
an entry in <em>/etc/inittab</em> to start monit with the same local |
an entry in <EM>/etc/inittab</EM> to start monit with the same local |
2250 |
group heartbeat is member of.</p> |
group heartbeat is member of.</P> |
2251 |
<pre> |
<PRE> |
2252 |
#/etc/inittab |
#/etc/inittab |
2253 |
mo:2345:respawn:/usr/local/bin/monit -d 10 -c /etc/monitrc -g local</pre> |
mo:2345:respawn:/usr/local/bin/monit -d 10 -c /etc/monitrc -g local</PRE> |
2254 |
<p><strong>heartbeat: <em>/etc/ha.d/haresources</em></strong></p> |
<P><STRONG>heartbeat: <EM>/etc/ha.d/haresources</EM></STRONG></P> |
2255 |
<p>When heartbeat starts, heartbeat looks up the node entry and |
<P>When heartbeat starts, heartbeat looks up the node entry and |
2256 |
start the script <em>/etc/init.d/monit-node1</em> or |
start the script <EM>/etc/init.d/monit-node1</EM> or |
2257 |
<em>/etc/init.d/monit-node2</em>. The script calls monit to start the |
<EM>/etc/init.d/monit-node2</EM>. The script calls monit to start the |
2258 |
specific group per node.</p> |
specific group per node.</P> |
2259 |
<pre> |
<PRE> |
2260 |
# /etc/ha.d/haresources |
# /etc/ha.d/haresources |
2261 |
node1 IPaddr::172.16.100.1 monit-node1 |
node1 IPaddr::172.16.100.1 monit-node1 |
2262 |
node2 IPaddr::172.16.100.2 monit-node2</pre> |
node2 IPaddr::172.16.100.2 monit-node2</PRE> |
2263 |
<p><strong><em>/etc/init.d/monit-node1</em></strong></p> |
<P><STRONG><EM>/etc/init.d/monit-node1</EM></STRONG></P> |
2264 |
<pre> |
<PRE> |
2265 |
#!/bin/bash |
#!/bin/bash |
2266 |
# |
# |
2267 |
# sample script for starting/stopping all services on node1 |
# sample script for starting/stopping all services on node1 |
2272 |
echo -n $"Starting $prog:" |
echo -n $"Starting $prog:" |
2273 |
$prog start all |
$prog start all |
2274 |
echo |
echo |
2275 |
}</pre> |
}</PRE> |
2276 |
<pre> |
<PRE> |
2277 |
stop() |
stop() |
2278 |
{ |
{ |
2279 |
echo -n $"Stopping $prog:" |
echo -n $"Stopping $prog:" |
2280 |
$prog stop all |
$prog stop all |
2281 |
echo |
echo |
2282 |
} |
} |
2283 |
|
</PRE> |
2284 |
|
<PRE> |
2285 |
|
|
2286 |
case "$1" in |
case "$1" in |
2287 |
start) |
start) |
2288 |
start;; |
start;; |
2292 |
echo $"Usage: $0 {start|stop}" |
echo $"Usage: $0 {start|stop}" |
2293 |
RETVAL=1 |
RETVAL=1 |
2294 |
esac |
esac |
2295 |
exit $RETVAL</pre> |
exit $RETVAL</PRE> |
2296 |
<p> |
<P> |
2297 |
</p> |
<HR> |
2298 |
<hr /> |
<H1><A NAME="files">FILES</A></H1> |
2299 |
<h1><a name="files">FILES</a></h1> |
<P><EM>~/.monitrc</EM> |
2300 |
<p><em>~/.monitrc</em> |
Default run control file</P> |
2301 |
Default run control file</p> |
<P><EM>/etc/monitrc</EM> |
|
<p><em>/etc/monitrc</em> |
|
2302 |
If the control file is not found in the default location and |
If the control file is not found in the default location and |
2303 |
/etc contains a <em>monitrc</em> file, this file will be used |
/etc contains a <EM>monitrc</EM> file, this file will be used |
2304 |
instead.</p> |
instead.</P> |
2305 |
<p><em>./monitrc</em> |
<P><EM>./monitrc</EM> |
2306 |
If the control file is not found in either of the previous two |
If the control file is not found in either of the previous two |
2307 |
locations, and the current working directory contains a |
locations, and the current working directory contains a |
2308 |
<em>monitrc</em> file, this file is used instead.</p> |
<EM>monitrc</EM> file, this file is used instead.</P> |
2309 |
<p><em>~/.monitrc.pid</em> |
<P><EM>~/.monitrc.pid</EM> |
2310 |
Lock file to help prevent concurrent runs (non-root |
Lock file to help prevent concurrent runs (non-root |
2311 |
mode).</p> |
mode).</P> |
2312 |
<p><em>/var/run/monit.pid</em> |
<P><EM>/var/run/monit.pid</EM> |
2313 |
Lock file to help prevent concurrent runs (root mode, |
Lock file to help prevent concurrent runs (root mode, |
2314 |
Linux systems).</p> |
Linux systems).</P> |
2315 |
<p><em>/etc/monit.pid</em> |
<P><EM>/etc/monit.pid</EM> |
2316 |
Lock file to help prevent concurrent runs (root mode, |
Lock file to help prevent concurrent runs (root mode, |
2317 |
systems without /var/run).</p> |
systems without /var/run).</P> |
2318 |
<p><em>~/.monit.state</em> |
<P><EM>~/.monit.state</EM> |
2319 |
monit save its state to this file and utilize |
monit save its state to this file and utilize |
2320 |
information found in this file to recover from |
information found in this file to recover from |
2321 |
a crash. This is a binary file and it's content is |
a crash. This is a binary file and it's content is |
2322 |
only of interest to monit. You may set the location |
only of interest to monit. You may set the location |
2323 |
of this file in the monit control file or by using |
of this file in the monit control file or by using |
2324 |
the -s switch when monit is started.</p> |
the -s switch when monit is started.</P> |
2325 |
<p> |
<P> |
2326 |
</p> |
<HR> |
2327 |
<hr /> |
<H1><A NAME="environment">ENVIRONMENT</A></H1> |
2328 |
<h1><a name="environment">ENVIRONMENT</a></h1> |
<P>No environment variables are used by monit. However, when monit |
|
<p>No environment variables are used by monit. However, when monit |
|
2329 |
execute a script or a program monit will set several environment |
execute a script or a program monit will set several environment |
2330 |
variables which can be utilized by the executable. The following |
variables which can be utilized by the executable. The following |
2331 |
and <em>only</em> the following environment variables are available:</p> |
and <EM>only</EM> the following environment variables are available:</P> |
2332 |
<dl> |
<DL> |
2333 |
<dt><strong><a name="item_monit_event">MONIT_EVENT</a></strong><br /> |
<DT><STRONG><A NAME="item_MONIT_EVENT">MONIT_EVENT</A></STRONG><BR> |
2334 |
</dt> |
<DD> |
|
<dd> |
|
2335 |
The event that occured on the service |
The event that occured on the service |
2336 |
</dd> |
<P></P> |
2337 |
<p></p> |
<DT><STRONG><A NAME="item_MONIT_SERVICE">MONIT_SERVICE</A></STRONG><BR> |
2338 |
<dt><strong><a name="item_monit_service">MONIT_SERVICE</a></strong><br /> |
<DD> |
|
</dt> |
|
|
<dd> |
|
2339 |
The name of the service (from monitrc) on which the event occured. |
The name of the service (from monitrc) on which the event occured. |
2340 |
</dd> |
<P></P> |
2341 |
<p></p> |
<DT><STRONG><A NAME="item_MONIT_DATE">MONIT_DATE</A></STRONG><BR> |
2342 |
<dt><strong><a name="item_monit_date">MONIT_DATE</a></strong><br /> |
<DD> |
|
</dt> |
|
|
<dd> |
|
2343 |
The time and date (rfc 822 style) the event occured |
The time and date (rfc 822 style) the event occured |
2344 |
</dd> |
<P></P> |
2345 |
<p></p> |
<DT><STRONG><A NAME="item_MONIT_HOST">MONIT_HOST</A></STRONG><BR> |
2346 |
<dt><strong><a name="item_monit_host">MONIT_HOST</a></strong><br /> |
<DD> |
|
</dt> |
|
|
<dd> |
|
2347 |
The host the event occured on |
The host the event occured on |
2348 |
</dd> |
<P></P></DL> |
2349 |
<p></p></dl> |
<P>The following environment variables are only available for |
2350 |
<p>The following environment variables are only available for |
process service entries:</P> |
2351 |
process service entries:</p> |
<DL> |
2352 |
<dl> |
<DT><STRONG><A NAME="item_MONIT_PROCESS_PID">MONIT_PROCESS_PID</A></STRONG><BR> |
2353 |
<dt><strong><a name="item_monit_process_pid">MONIT_PROCESS_PID</a></strong><br /> |
<DD> |
|
</dt> |
|
|
<dd> |
|
2354 |
The process pid. This may be 0 if the process was (re)started, |
The process pid. This may be 0 if the process was (re)started, |
2355 |
</dd> |
<P></P> |
2356 |
<p></p> |
<DT><STRONG><A NAME="item_MONIT_PROCESS_MEMORY">MONIT_PROCESS_MEMORY</A></STRONG><BR> |
2357 |
<dt><strong><a name="item_monit_process_memory">MONIT_PROCESS_MEMORY</a></strong><br /> |
<DD> |
|
</dt> |
|
|
<dd> |
|
2358 |
Process memory. This may be 0 if the process was (re)started, |
Process memory. This may be 0 if the process was (re)started, |
2359 |
</dd> |
<P></P> |
2360 |
<p></p> |
<DT><STRONG><A NAME="item_MONIT_PROCESS_CHILDREN">MONIT_PROCESS_CHILDREN</A></STRONG><BR> |
2361 |
<dt><strong><a name="item_monit_process_children">MONIT_PROCESS_CHILDREN</a></strong><br /> |
<DD> |
|
</dt> |
|
|
<dd> |
|
2362 |
Process children. This may be 0 if the process was (re)started, |
Process children. This may be 0 if the process was (re)started, |
2363 |
</dd> |
<P></P> |
2364 |
<p></p> |
<DT><STRONG><A NAME="item_MONIT_PROCESS_CPU_PERCENT">MONIT_PROCESS_CPU_PERCENT</A></STRONG><BR> |
2365 |
<dt><strong><a name="item_monit_process_cpu_percent">MONIT_PROCESS_CPU_PERCENT</a></strong><br /> |
<DD> |
|
</dt> |
|
|
<dd> |
|
2366 |
Process cpu%. This may be 0 if the process was (re)started, |
Process cpu%. This may be 0 if the process was (re)started, |
2367 |
</dd> |
<P></P></DL> |
2368 |
<p></p></dl> |
<P>In addition the following spartan PATH environment variable is |
2369 |
<p>In addition the following spartan PATH environment variable is |
available:</P> |
2370 |
available:</p> |
<DL> |
2371 |
<dl> |
<DT><STRONG><A NAME="item_PATH%3D%2Fbin%3A%2Fusr%2Fbin%3A%2Fsbin%3A%2Fusr%2F">PATH=/bin:/usr/bin:/sbin:/usr/sbin</A></STRONG><BR> |
2372 |
<dt><strong><a name="item_path%3d%2fbin%3a%2fusr%2fbin%3a%2fsbin%3a%2fusr%2f">PATH=/bin:/usr/bin:/sbin:/usr/sbin</a></strong><br /> |
<DD> |
2373 |
</dt> |
</DL> |
2374 |
</dl> |
<P>Scripts or programs that depends on other environment variables |
|
<p>Scripts or programs that depends on other environment variables |
|
2375 |
or on a more verbose PATH must provide means to set these |
or on a more verbose PATH must provide means to set these |
2376 |
variables by them self.</p> |
variables by them self.</P> |
2377 |
<p> |
<P> |
2378 |
</p> |
<HR> |
2379 |
<hr /> |
<H1><A NAME="signals">SIGNALS</A></H1> |
2380 |
<h1><a name="signals">SIGNALS</a></h1> |
<P>If a monit daemon is running, SIGUSR1 wakes it up from its sleep |
|
<p>If a monit daemon is running, SIGUSR1 wakes it up from its sleep |
|
2381 |
phase and forces a poll of all services. SIGTERM and SIGINT will |
phase and forces a poll of all services. SIGTERM and SIGINT will |
2382 |
gracefully terminate a monit daemon. The SIGTERM signal is sent |
gracefully terminate a monit daemon. The SIGTERM signal is sent |
2383 |
to a monit daemon if monit is started with the <em>quit</em> action |
to a monit daemon if monit is started with the <EM>quit</EM> action |
2384 |
argument.</p> |
argument.</P> |
2385 |
<p>Sending a SIGHUP signal to a running monit daemon will force |
<P>Sending a SIGHUP signal to a running monit daemon will force |
2386 |
the daemon to reinitialize itself, specifically it will reread |
the daemon to reinitialize itself, specifically it will reread |
2387 |
configuration, close and reopen log files.</p> |
configuration, close and reopen log files.</P> |
2388 |
<p>Running monit in foreground while a background monit daemon is |
<P>Running monit in foreground while a background monit daemon is |
2389 |
running will wake up the daemon.</p> |
running will wake up the daemon.</P> |
2390 |
<p> |
<P> |
2391 |
</p> |
<HR> |
2392 |
<hr /> |
<H1><A NAME="notes">NOTES</A></H1> |
2393 |
<h1><a name="notes">NOTES</a></h1> |
<P>This is a very silent program. Use the -v switch if you want to |
|
<p>This is a very silent program. Use the -v switch if you want to |
|
2394 |
see what monit is doing, and tail -f the logfile. Optionally for |
see what monit is doing, and tail -f the logfile. Optionally for |
2395 |
testing purposes; you can start monit with the -Iv switch. Monit |
testing purposes; you can start monit with the -Iv switch. Monit |
2396 |
will then print debug information to the console, to stop monit |
will then print debug information to the console, to stop monit |
2397 |
in this mode, simply press CTRL^C (i.e. SIGINT) in the same |
in this mode, simply press CTRL^C (i.e. SIGINT) in the same |
2398 |
console.</p> |
console.</P> |
2399 |
<p>The syntax (and parser) of the control file is inspired by Eric |
<P>The syntax (and parser) of the control file is inspired by Eric |
2400 |
S. Raymond et al. excellent fetchmail program. Some portions of |
S. Raymond et al. excellent fetchmail program. Some portions of |
2401 |
this man page does also receive inspiration from the same |
this man page does also receive inspiration from the same |
2402 |
authors.</p> |
authors.</P> |
2403 |
<p> |
<P> |
2404 |
</p> |
<HR> |
2405 |
<hr /> |
<H1><A NAME="authors">AUTHORS</A></H1> |
2406 |
<h1><a name="authors">AUTHORS</a></h1> |
<P>Jan-Henrik Haukeland <<A HREF="mailto:hauk@tildeslash.com">hauk@tildeslash.com</A>>, |
2407 |
<p>Jan-Henrik Haukeland <<a href="mailto:hauk@tildeslash.com">hauk@tildeslash.com</a>>, |
Martin Pala <<A HREF="mailto:martin.pala@iol.cz">martin.pala@iol.cz</A>>, |
2408 |
Martin Pala <<a href="mailto:martin.pala@iol.cz">martin.pala@iol.cz</a>>, |
Christian Hopp <<A HREF="mailto:chopp@iei.tu-clausthal.de">chopp@iei.tu-clausthal.de</A>>, |
2409 |
Christian Hopp <<a href="mailto:chopp@iei.tu-clausthal.de">chopp@iei.tu-clausthal.de</a>>, |
Rory Toma <<A HREF="mailto:rory@digeo.com">rory@digeo.com</A>></P> |
2410 |
Rory Toma <<a href="mailto:rory@digeo.com">rory@digeo.com</a>></p> |
<P>See also <A HREF="http://www.tildeslash.com/monit/who.html">http://www.tildeslash.com/monit/who.html</A></P> |
2411 |
<p>See also <a href="http://www.tildeslash.com/monit/who.html">http://www.tildeslash.com/monit/who.html</a></p> |
<P> |
2412 |
<p> |
<HR> |
2413 |
</p> |
<H1><A NAME="copyright">COPYRIGHT</A></H1> |
2414 |
<hr /> |
<P>Copyright (C) 2000-2003 by Contributors to the monit codebase. All |
|
<h1><a name="copyright">COPYRIGHT</a></h1> |
|
|
<p>Copyright (C) 2000-2003 by Contributors to the monit codebase. All |
|
2415 |
Rights Reserved. This product is distributed in the hope that it |
Rights Reserved. This product is distributed in the hope that it |
2416 |
will be useful, but WITHOUT any warranty; without even the |
will be useful, but WITHOUT any warranty; without even the |
2417 |
implied warranty of MERCHANTABILITY or FITNESS for a particular |
implied warranty of MERCHANTABILITY or FITNESS for a particular |
2418 |
purpose.</p> |
purpose.</P> |
2419 |
<p> |
<P> |
2420 |
</p> |
<HR> |
2421 |
<hr /> |
<H1><A NAME="see also">SEE ALSO</A></H1> |
2422 |
<h1><a name="see_also">SEE ALSO</a></h1> |
<P>GNU text utilities; md5sum(1); <CODE>openssl(1)</CODE></P> |
|
<p>GNU text utilities; md5sum(1); <code>openssl(1)</code></p> |
|
2423 |
|
|
2424 |
</body> |
</BODY> |
2425 |
|
|
2426 |
</html> |
</HTML> |