The host is neither an IP or a hostname, but a URL!
Code: Select all
define host{
host_name URL1
hostgroups 000-URL1
address MyURL.dev.com
max_check_attempts 5
check_period 24x7
contact_groups admins
notification_period 24x7
}
define command{
command_name check_http_url
command_line $USER1$/check_http -H $HOSTADDRESS$ -u $ARG1$
}
define service{
use generic-service
service_description
check_command check_http_url!/my/url/path/ -r "" --expect=200
host_name URL1
}
Code: Select all
/usr/local/nagios/libexec/check_http -H MyURL -u /my/url/path/ --expect=200 --eregi="" -v
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Cache-Control: private
Pragma: no-cache
Content-Type: text/html
X-AspNet-Version: 4.0.30319
Set-Cookie: session=processform=0; path=/
Set-Cookie: aps03=lng=1&tzi=1; expires=Wed, 05-Aug-2026 12:57:21 GMT; path=/
Date: Fri, 05 Aug 2016 12:57:21 GMT
Content-Length: 0
NS-LB-VSERVER: lb=010-xxxxxxxxxxxxxxxxxx
NS-ORIGIN-SERVER: 99.99.99.99
**** CONTENT ****
Status line output matched "200" -
HTTP OK: Status line output matched "200" - 374 bytes in 0.010 second response time |time=0.010167s;;;0.000000 size=374B;;;0
I'll have to go back to the owner of the webpage and see if he can help, but it's fair to say that I've learned a HUGE amount over the course of this post, so thank you all!
I think you can close this thread now.
Regards
Pete