1230 |
=back |
=back |
1231 |
|
|
1232 |
B<host:HOST hostname>. Optionally specify the host to connect |
B<host:HOST hostname>. Optionally specify the host to connect |
1233 |
to. If the host is not given, localhost is assumed. Although |
to. If the host is not given, localhost is assumed in the case |
1234 |
I<host> is intended for testing name based virtual host in a HTTP |
that the test is used in process monitoring service, in the case |
1235 |
server running on localhost, it does allow the connection |
that it is used in remote host monitoring service, specified |
1236 |
|
address or hostname is assumed. Although I<host> is intended |
1237 |
|
for testing name based virtual host in a HTTP server running |
1238 |
|
on local or remote host, it does allow the connection |
1239 |
statement to be used to test a server running on another |
statement to be used to test a server running on another |
1240 |
machine. This may be useful; For instance if you use Apache httpd |
machine. This may be useful; For instance if you use Apache httpd |
1241 |
as a front-end and an application-server as the back-end running |
as a front-end and an application-server as the back-end running |
1297 |
if failed port 80 then alert |
if failed port 80 then alert |
1298 |
|
|
1299 |
In this case the machine in question is assumed to be |
In this case the machine in question is assumed to be |
1300 |
I<localhost> and monit will conduct a tcp connection to localhost |
I<localhost> or I<address> of specified remote host and monit |
1301 |
at port 80. Monit will use tcp by default, if you want to connect |
will conduct a tcp connection to that host at port 80. Monit |
1302 |
with udp, you can specify this after the port-statement; |
will use tcp by default, if you want to connect with udp, you |
1303 |
|
can specify this after the port-statement; |
1304 |
|
|
1305 |
if failed port 53 type udp then alert |
if failed port 53 type udp then alert |
1306 |
|
|
1331 |
if failed host kvasir.sol.no port 80 then alert |
if failed host kvasir.sol.no port 80 then alert |
1332 |
|
|
1333 |
And as mentioned above, if you do not specify a host-statement, |
And as mentioned above, if you do not specify a host-statement, |
1334 |
I<localhost> is assumed. |
I<localhost> or I<address> is assumed. |
1335 |
|
|
1336 |
Monit also knows how to speak some of the more popular Internet |
Monit also knows how to speak some of the more popular Internet |
1337 |
protocols. So, besides testing for connections, monit can also |
protocols. So, besides testing for connections, monit can also |
1372 |
protocol http |
protocol http |
1373 |
then restart |
then restart |
1374 |
|
|
1375 |
|
Example of connection test used in local process monitoring |
1376 |
|
service: |
1377 |
|
|
1378 |
When a connection test is used in a check host entry, the host |
check process apache with path /var/run/apache.pid |
1379 |
name can B<not> be used in the if-test since the host name is |
if failed host www.tildeslash.com port 80 then alert |
1380 |
bound to the entry itself. |
alert foo@bar.baz |
1381 |
|
|
1382 |
E.g. this is legal: |
Example of connection test used in remote host monitoring |
1383 |
|
service: |
1384 |
check HOST ftp.redhat.com |
|
1385 |
if failed port 21 then exec |
check host web with address 64.87.72.95 |
1386 |
"/usr/X11R6/bin/xmessage -display :0 RedHat is down as usual!" |
if failed host www.tildeslash.com port 80 then alert |
1387 |
|
alert foo@bar.baz |
1388 |
this is not, and will lead to a parse error: |
|
1389 |
|
As mentioned above, if you don't specify the host option, |
1390 |
check host ftp.redhat.com |
specified address will be used. The address itself can be |
1391 |
if failed HOST ftp.suse.com port 21 then ... |
specified either as numeric address or as hostname, so |
1392 |
|
this is legal equivalent: |
1393 |
|
|
1394 |
|
check host web with address www.tildeslash.com |
1395 |
|
if failed port 80 then alert |
1396 |
|
alert foo@bar.baz |
1397 |
|
|
1398 |
For more examples, see the example section below. |
For more examples, see the example section below. |
1399 |
|
|
1813 |
mode or the start methods is not defined, monit will just send |
mode or the start methods is not defined, monit will just send |
1814 |
alerts on errors. |
alerts on errors. |
1815 |
|
|
1816 |
=item 5. CHECK HOST <unique host address> |
=item 5. CHECK HOST <unique name> ADDRESS <host address> |
1817 |
|
|
1818 |
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 |
1819 |
ip-address string on a dotted decimal format. Such as, |
ip-address string on a dotted decimal format. Such as, |
1820 |
tildeslash.com or "64.87.72.95" |
tildeslash.com or "64.87.72.95". |
1821 |
|
|
1822 |
=back |
=back |
1823 |
|
|
2111 |
otherwise monit will simply ignore the request to change uid and |
otherwise monit will simply ignore the request to change uid and |
2112 |
gid. |
gid. |
2113 |
|
|
2114 |
check tomcat with pidfile /var/run/tomcat.pid |
check process tomcat with pidfile /var/run/tomcat.pid |
2115 |
start program = "/etc/init.d/tomcat start" |
start program = "/etc/init.d/tomcat start" |
2116 |
as uid nobody and gid nobody |
as uid nobody and gid nobody |
2117 |
stop program = "/etc/init.d/tomcat stop" |
stop program = "/etc/init.d/tomcat stop" |
2356 |
if inode usage > 94 % then stop |
if inode usage > 94 % then stop |
2357 |
alert root@localhost |
alert root@localhost |
2358 |
|
|
2359 |
check host ftp.redhat.com |
check host up2date with address ftp.redhat.com |
2360 |
if failed port 21 protocol ftp |
if failed port 21 protocol ftp |
2361 |
then exec "/usr/X11R6/bin/xmessage -display |
then exec "/usr/X11R6/bin/xmessage -display |
2362 |
:0 ftp connection failed" |
:0 ftp connection failed" |