check_http

Marc Powell marc at ena.com
Mon Dec 15 16:34:49 CET 2003



> -----Original Message-----
> From: Anshul Gupta [mailto:tech at anshulgupta.com]
> Sent: Monday, December 15, 2003 12:38 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] check_http
> 
> Hi All,
> 
> I am new nagios user. I want to check the status the virtual hosts but
> couldn't do it.
> 
> Suppose there is one virtual host,
> abc.xyz.com - 1.2.3.4
> 
> Now to check it, I use the default arguments in check_http in the
> checkcommands.cfg.
> 
> But if I add shouldfail.xyz.com - 1.2.3.4, it still gives OK as it
> establishes the connection to 1.2.3.4 at port 80 and doesn't check for
> any association between the HOSTADDRESS and HOSTNAME.
> 
> I modified the check_http arguments -H $HOMENAME$. It will fail but if
> I add www.hotmail.com - 1.2.3.4 it will still say it's OK. Is there
any
> way to check both HOSTADDRESS and HOSTNAME.
> 
> Also can I check the DocumentRoot of virtual host? The uri thing is
not
> working for me. Does check_http actually sends the vhost name and try
> to check it's document root?

Yes, with a properly constructed check_http command line --


# 'check_http' command definition
define command{
        command_name    check_http
        command_line    $USER1$/check_http  -H $ARG1$ -I $HOSTADDRESS$
-s \/html
        }

This works with a service definition like

# Service definition
define service{
        use                             generic-service         ; Name
of service template to use

        host_name                       <my_host>
        service_description             HTTP
        retry_check_interval            3
        contact_groups                  nateng-oncall-servers
        check_command
check_http!<www.mydomain_to_check.com>
        }

The -H specifies the HTTP1.1 vhost HOST: to send and the -I specifies
the IP or hostname to connect to. It will exit with CRITICAL if '/html'
isn't found.

--
Marc



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list