views:

274

answers:

2

Hi all,

I have a web server which is protected behind http-basic-auth. I've read through the monit docs and it doesn't seem like there's a clear way to pass credentials in order to test that the test page on the server is being returned correctly.

Any thoughts?

Thanks!

(Please don't confuse this with monit's own httpd for showing monit status in a web page)

PS this is monit 4.8.1 -- that which comes with Ubuntu Hardy 8.04

+1  A: 

It seems to be possible to include the credentials in the URL, have you tried this?:

(from http://mmonit.com/monit/documentation/monit.html#connection_testing )

[...] Where URL-spec is an URL on the standard form as specified in RFC 2396:

<protocol>://<authority><path>?<query>

Here is an example of an URL where all components are used:

http://user:[email protected]:8080/document/?querystring#ref

If a username and password is included in the URL Monit will attempt to login at the server using Basic Authentication.

Anders Lindahl
Nice one yes that makes sense. I got stuck because the URL isn't specified by default but monit docs do say you can do this:"You can test a HTTP server using the compact URL syntax. This test also allow you to use POSIX regular expressions to test the content returned by the HTTP server."http://mmonit.com/monit/documentation/monit.htmlfingers crossed while I see whether this works on monit 4.8.1!
Julian
A: 

Try this if you just want to check that your web server is listening on port 80 (and you don't care what page or data it returns):

"if failed port 80 type TCP then restart".

Dave Murray