For When You Can't Have The Real Thing
[ start | index | login ]
start > nagios > check url

check url

Created by dave. Last edited by dave, 11 years and 243 days ago. Viewed 6,019 times. #2
[diff] [history] [edit] [rdf]
labels
attachments
(20 August 2012)

Problem

I want to monitor a particular URL through nagios, not just http: server availability.

Solution

commands.cfg:

# 'check_http_url' command definition
define command{
        command_name    check_http_url
        command_line    $USER1$/check_http -I $HOSTADDRESS$ -u $ARG1$
}

macros.m4:

define(`DOHTTPURL',`define service{
    use                 generic-service
    host_name           $1
    service_description $2
    check_command       check_http_url!$2
    normal_check_interval 20
    retry_check_interval  5
} ')dnl

Sample .m4 entry:

DOHTTPURL(`webserver',`>>http://xdroop.com/__gcc.html')

In our case, the __gcc.html is a page created by a script so that nagios has a specific target to hit. On one of my hosting systems, if the system is misconfigured, you get the default page, which isn't detectable if you just pull index.html. So by looking for a specific, unique file, you can catch server misconfigurations as well.

(Based on >>this)

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt