2216 |
if failed host chat.sol.no port 80 then alert |
if failed host chat.sol.no port 80 then alert |
2217 |
if failed host www.tildeslash.com port 80 then alert |
if failed host www.tildeslash.com port 80 then alert |
2218 |
|
|
2219 |
To make sure that monit is communicating with a http server a |
To make sure that monit is communicating with a http server a |
2220 |
protocol can be added, too: |
protocol test can be added: |
2221 |
|
|
2222 |
check process apache with pidfile /var/run/httpd.pid |
check process apache with pidfile /var/run/httpd.pid |
2223 |
start "/etc/init.d/httpd start" |
start "/etc/init.d/httpd start" |
2224 |
stop "/etc/init.d/httpd stop" |
stop "/etc/init.d/httpd stop" |
2225 |
if failed host www.sol.no port 80 |
if failed host www.sol.no port 80 |
2226 |
protocol HTTP |
protocol HTTP |
2227 |
then alert |
then alert |
2228 |
|
|
2229 |
This example shows a different way to check a webserver using |
This example shows a different way to check a webserver using |
2230 |
the send/expect mechanism: |
the send/expect mechanism: |
2234 |
stop "/etc/init.d/httpd stop" |
stop "/etc/init.d/httpd stop" |
2235 |
if failed host www.sol.no port 80 |
if failed host www.sol.no port 80 |
2236 |
send "GET / HTTP/1.0\r\nHost: www.sol.no\r\n\r\n" |
send "GET / HTTP/1.0\r\nHost: www.sol.no\r\n\r\n" |
2237 |
expect "HTTP/[0-9\.]{3} 200\r\n" |
expect "HTTP/[0-9\.]{3} 200 .*\r\n" |
2238 |
then alert |
then alert |
2239 |
|
|
2240 |
In the following example we ask monit to compute and verify the |
In the following example we ask monit to compute and verify the |