Host monitoring

Marc Powell marc at ena.com
Tue Nov 13 00:13:50 CET 2007



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Jerad Riggin
> Sent: Monday, November 12, 2007 4:52 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Host monitoring
> 
> So what would be the best way to monitor in this situation?
> 
> I have Host A, hosting two websites.
> 
> Currently I have both websites configured as separate hosts, so in
> nagios it shows up as ServerA - site.com, and another host ServerA -
> siteb.com
> 
> This doesn't seem efficient since I am pinging both sites, but it's
> the same host.  Ideally I would want to just ping the host, and check
> strings on each site under that host.  Any recommendations?

Unless I'm missing something obvious, this seems pretty straightforward.
host{} definition for the web server machine, service{} definitions for
each vhost using check_http to check them. You can craft a command{}
definition to pass the variable parameters like vhost name, uri and
search string like so --

define command {
    command_name                   check_http_url
    command_line                   $USER1$/check_http -I $HOSTADDRESS$
-H $ARG1$ -u $ARG2$ -wt 20 -ct 30 -to 35 -s $ARG3$
    }

To check to vhosts --

define service {
    use                            generic-service
    host_name                      my_webserver
    service_description            HTTP VHOST site1
    check_command
check_http_url!www.site1.com!/mypage!/html
    }

define service {
    use                            generic-service
    host_name                      my_webserver
    service_description            HTTP VHOST site2
    check_command
check_http_url!www.site2.com!/someotherpage!/html
    }

--
Marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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