How to Monitor Virtual Web Hosts with Nagios
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]
Leave Your Comment
All fields marked with "*" are required.