4 |
<LINK REV="made" HREF="mailto:bhcompile@bugs.devel.redhat.com"> |
<LINK REV="made" HREF="mailto:bhcompile@bugs.devel.redhat.com"> |
5 |
</HEAD> |
</HEAD> |
6 |
|
|
7 |
<BODY> |
<BODY bgcolor="#FFFFFF"> |
8 |
|
|
9 |
<A NAME="__index__"></A> |
<A NAME="__index__"></A> |
10 |
<!-- INDEX BEGIN --> |
<!-- INDEX BEGIN --> |
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 |
|
<LI><A HREF="#setting a mail server for alert messages">Setting a mail server for alert messages</A></LI> |
36 |
</UL> |
</UL> |
37 |
|
|
38 |
<LI><A HREF="#service timeout">SERVICE TIMEOUT</A></LI> |
<LI><A HREF="#service timeout">SERVICE TIMEOUT</A></LI> |
590 |
<PRE> |
<PRE> |
591 |
set mail-format { from: monit@foo.bar.no }</PRE> |
set mail-format { from: monit@foo.bar.no }</PRE> |
592 |
<P> |
<P> |
593 |
|
<H2><A NAME="setting a mail server for alert messages">Setting a mail server for alert messages</A></H2> |
594 |
|
<P>The mail server monit should use to send alert messages is |
595 |
|
defined with a global set statement (keywords are in capital and |
596 |
|
optional statements in [brackets]):</P> |
597 |
|
<PRE> |
598 |
|
SET MAILSERVER {host name|ip-address}+ [with TIMEOUT X SECONDS]</PRE> |
599 |
|
<P>As you can see, it is possible to set several SMTP servers and if |
600 |
|
monit cannot connect to the first server in the list it will try |
601 |
|
the second server and so on. Monit has a default 5 seconds |
602 |
|
connection timeout and if the SMTP server is slow, monit could |
603 |
|
timeout when connecting or reading from the server. You can use |
604 |
|
the optional timeout statement to explicit set the timeout to a |
605 |
|
higher value if needed. Here is an example for setting several |
606 |
|
mail servers:</P> |
607 |
|
<PRE> |
608 |
|
set mailserver mail.tildeslash.com, mail.foo.bar, localhost |
609 |
|
with timeout 15 seconds</PRE> |
610 |
|
<P>Here monit will first try to connect to the server |
611 |
|
``mail.tildeslash.com'', if this server is down monit will try |
612 |
|
``mail.foo.bar'' and finally ``localhost''. We do also set an |
613 |
|
explicit connect and read timeout; If monit cannot connect to the |
614 |
|
first SMTP server in the list within 15 seconds it will try the |
615 |
|
next server and so on. The <EM>set mailserver ..</EM> statement is |
616 |
|
optional and if not defined monit defaults to use localhost as |
617 |
|
the SMTP server.</P> |
618 |
|
<P> |
619 |
<HR> |
<HR> |
620 |
<H1><A NAME="service timeout">SERVICE TIMEOUT</A></H1> |
<H1><A NAME="service timeout">SERVICE TIMEOUT</A></H1> |
621 |
<P><STRONG>monit</STRONG> provides a service timeout mechanism for situations |
<P><STRONG>monit</STRONG> provides a service timeout mechanism for situations |
1258 |
server will often use chunked transfer encoding instead when |
server will often use chunked transfer encoding instead when |
1259 |
serving dynamic content (e.g. a document created by a CGI-script |
serving dynamic content (e.g. a document created by a CGI-script |
1260 |
or a Servlet), but to test the checksum for dynamic content is |
or a Servlet), but to test the checksum for dynamic content is |
1261 |
not very useful. There are no limitation on document size, but |
not very useful. There are no limitation on the document size, |
1262 |
keep in mind that monit will use time to download the document |
but keep in mind that monit will use time to download the |
1263 |
over the network so it's probably smart not to ask monit to |
document over the network so it's probably smart not to ask monit |
1264 |
compute a checksum for documents larger than 1Mb or so.</P> |
to compute a checksum for documents larger than 1Mb or so, |
1265 |
|
depending on you network connection of course.</P> |
1266 |
<P>As mentioned above, if the server protocol is not supported by |
<P>As mentioned above, if the server protocol is not supported by |
1267 |
monit you can write your own protocol test using send/expect |
monit you can write your own protocol test using send/expect |
1268 |
strings. Here we show a protocol test using send/expect for an |
strings. Here we show a protocol test using send/expect for an |
1450 |
<P>monit will use Basic Authentication if an allow statement |
<P>monit will use Basic Authentication if an allow statement |
1451 |
contains a username and a password separated with a single ':' |
contains a username and a password separated with a single ':' |
1452 |
character, like so; <EM>allow username:password</EM>. The username and |
character, like so; <EM>allow username:password</EM>. The username and |
1453 |
password must be written in clear-text. Only one username and |
password must be written in clear-text.</P> |
1454 |
password pair is supported.</P> |
<P>Alternatively you can use files in ``htpasswd'' format (one |
1455 |
|
user:passwd entry per line), like so: |
1456 |
|
<EM>allow [cleartext|crypt|md5] /path [users]</EM>. By default |
1457 |
|
cleartext passwords are read. In case the passwords are digested |
1458 |
|
it is necessary to specify the cryptographic method. In order |
1459 |
|
to select the users their names can be added to the allow |
1460 |
|
statement. Otherwise all users are added.</P> |
1461 |
|
<P>Example: |
1462 |
|
set httpd port 2812 |
1463 |
|
allow hauk:monit |
1464 |
|
allow md5 /etc/httpd/htpasswd peter paul mary</P> |
1465 |
<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 |
1466 |
clients from the listed hosts will be allowed to connect to the |
clients from the listed hosts will be allowed to connect to the |
1467 |
monit http server and each client will be asked to provide a |
monit http server and each client will be asked to provide a |
1485 |
complain and exit if the control file is readable by others.</P> |
complain and exit if the control file is readable by others.</P> |
1486 |
<P>Clients trying to connect to the server but supply the wrong |
<P>Clients trying to connect to the server but supply the wrong |
1487 |
username and/or password are logged with their ip-address.</P> |
username and/or password are logged with their ip-address.</P> |
1488 |
|
<P>If the monit command line interface is being used at least one |
1489 |
|
cleartext password is necessary. Otherwise, the command line |
1490 |
|
interface would not connect to the http server.</P> |
1491 |
<P> |
<P> |
1492 |
<HR> |
<HR> |
1493 |
<H1><A NAME="dependencies">DEPENDENCIES</A></H1> |
<H1><A NAME="dependencies">DEPENDENCIES</A></H1> |
2413 |
<P><EM>~/.monitrc</EM> |
<P><EM>~/.monitrc</EM> |
2414 |
Default run control file</P> |
Default run control file</P> |
2415 |
<P><EM>/etc/monitrc</EM> |
<P><EM>/etc/monitrc</EM> |
2416 |
If the control file is not found in the default location and |
If the control file is not found in the default |
2417 |
/etc contains a <EM>monitrc</EM> file, this file will be used |
location and /etc contains a <EM>monitrc</EM> file, this |
2418 |
instead.</P> |
file will be used instead.</P> |
2419 |
<P><EM>./monitrc</EM> |
<P><EM>./monitrc</EM> |
2420 |
If the control file is not found in either of the previous two |
If the control file is not found in either of the |
2421 |
locations, and the current working directory contains a |
previous two locations, and the current working |
2422 |
<EM>monitrc</EM> file, this file is used instead.</P> |
directory contains a <EM>monitrc</EM> file, this file is |
2423 |
|
used instead.</P> |
2424 |
<P><EM>~/.monitrc.pid</EM> |
<P><EM>~/.monitrc.pid</EM> |
2425 |
Lock file to help prevent concurrent runs (non-root |
Lock file to help prevent concurrent runs (non-root |
2426 |
mode).</P> |
mode).</P> |