Hi Martin,
Here below is the configuration for 4 sites we monitor using Monit:
*check host aHost with address aIPAddress
if failed url http://username:passw...@aipaddress/advancedSearch.jsp for
5 cycles then alert
check host bHost with address bIPAddress
if failed url http://bIPAddress/advancedSearch.jsp for 5 cycles then
alert
check host cHost with address cIPAddress
if failed url http://cIPAddress/advancedSearch.jsp for 5 cycles then
alert
check host dHost with address dIPAddress
if failed url http://username:passw...@dipaddress/advancedsearch.jsp for
5 cycles then alert*
I run monit using -vI and I got the following errors for aHost and dHost:
*monit HTTP server started
Monit started
Monit instance changed notification is sent to an email address
Monit instance changed notification is sent to an email address
'aHost' succeeded connecting to INET[aIPAddress:80] via TCP
HTTP error: Server returned status 401
'aHost' failed protocol test [HTTP] at INET[aIPAddress:80] via TCP
'bHost' succeeded connecting to INET[bIPAddress:80] via TCP
'bHost' succeeded testing protocol [HTTP] at INET[bIPAddress:80] via TCP
'cHost' succeeded connecting to INET[cIPAddress:80] via TCP
'cHost' succeeded testing protocol [HTTP] at INET[cIPAddress:80] via TCP
'dHost' succeeded connecting to INET[dIPAddress:80] via TCP
HTTP error: Server returned status 404
'dHost' succeeded testing protocol [HTTP] at INET[dIPAddress:80] via TCP
*
There were no issues with bHost and cHost that do not require
Http-basic-auth.
When pasting the URL from the montric file for aHost and dHost in a browser
I get correctly to the site. So the username and password for aHost and
dHost are correct.
I do not understand why I get HTTP error: Server returned status 404 when
the credentials are correct.
Do you have any suggestions?
Regards,
Max
On Mon, Sep 6, 2010 at 10:04 AM, Martin Pala <[email protected]> wrote:
> Hi,
>
> the configuration looks OK. If you test the exact URL used by monit in
> browser, do you get to the site? The problem could be related to the use of
> IP address in the testing URL vs. http configuration which may drop you to
> the default host - if you use IP address it will also appear in the Host
> header in http request ... that combined with name based virtual servers in
> http configuration which may redirect the testing request to different site.
>
> 1.) run monit in verbose mode (using -vI options) and send output
> 2.) attach network trace if the communication between monit and tested http
> server with the testing problem
>
> Regards,
> Martin
>
>
> On Sep 5, 2010, at 10:23 PM, M M wrote:
>
> Hi,
>
> We have few sites on a Unix server that we monitor using monit. All sites
> are monitored correctly except for 2 that require http-basic-auth.
>
> I have passed the credentials in the URL like below as suggested by the
> monit 4.8.1 documentation:
>
> check host aHost with address anIPAddress if failed url
> http://username:passw...@anipaddress/advancedSearch.jsp for 5 cycles then
> alert
>
> However, when checking the connection status on monit for the aHost the
> status is:
>
> Connection Failed.
>
> What am I doing wrong?
>
> How can I manage to pass the credentials and get a successful connection?
>
> PS this is monit 4.8.1
> --
>
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general
>
>
>
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general
>
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general