How to Monitor Virtual Web Hosts with Nagios
erics, Posted October 30th, 2009 at 10:59:48am
The Nagios configuration files are located (for me) in /opt/local/etc/nagios/objects.
First, create a new command in commands.cfg file:
[code]
# ‘check_http_url’ command definition
define command{
command_name check_http_url
command_line $USER1$/check_http -I $HOSTADDRESS$ -u $ARG1$ -s $ARG2$
}
[/code]
-u URL to test
-s String to expect in the content
Then, add a new service to the services.cfg file:
[code]
define service{
use generic-service
host_name vps3
service_description Wow Towel
contact_groups admin
check_command check_http_url!http://www.wowtowel.com/cgi-bin/index.cgi!"TML Gold"
}
[/code]
Categories: 
Leave Your Comment
All fields marked with "*" are required.