best way to check one web server w/many vhosts

Jag agrajag at dragaera.net
Thu Mar 4 15:59:28 CET 2004


On Wed, 2004-03-03 at 19:18, Daniel Finn wrote:
> I'm trying to do something like this and wondering how to do it:
> 
> define service{
>         use                             generic-service
>         host_name                       vhost1.com,vhost2.com,vhost3.com,vhost4.com,vhost5.com,vhost6.com,vhost7.com,vhost8.com,vhost9.com,vhost10.com
>         service_description             Vhost-HTTP
>         is_volatile                     0
>         check_period                    24x7
>         max_check_attempts              3
>         normal_check_interval           3
>         retry_check_interval            1
>         contact_groups                  linux-admins
>         notification_interval           120
>         notification_period             24x7
>         notification_options            w,u,c,r
>         check_command                   check_http!192.168.0.1
>         }
> 
> so multiple vhosts on one IP, I would like to check the IP to ensure it's
> answering for each vhost.  Unfortunately when I tried to do it like this
> nagios complained that :

If you do 'check_http -h' you'll see that it has an option for
specifying the IP address of the host, AND the vhost name to use when
checking.  So, you could setup a check command like so:

define command{
	command_name	check_vhost
	command_line	$USER1$/check_http -H $ARG1$ -I $HOSTADDRESS$
	}

Then you do a different service for each vhost.  You put the host_name
as the host_name you put in your host definition.  It'll then use the IP
from that host definition for $HOSTADDRESS$.  Then you set your
check_command to  check_vhost!vhost1.com


Hope that helps.



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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