Page 1 of 1

Error: Service check command 'check_http -H ...'

Posted: Wed Dec 19, 2012 2:03 pm
by happy
Hi

I am trying to monitor website performance through Nagios by doing the following:

in windows.cfg file I have the host already defined (the same host is checking for disk space, etc)
In the same file I have added a service to monitor a website

Code: Select all

define service{
        use                    generic-service
        host_name              myhostname
        service_description    HTTP
        check_command          check_http -H myurl
        }
I have this defined in the command.cfg

Code: Select all

# 'check_http' command definition
define command{
        command_name    check_http
        command_line    $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
        }
When I run verification I get this error:
Error: Service check command 'check_http -H myurl' specified in service 'HTTP' for host 'myhostname' not defined anywhere!

Additional Info: I am able to run this command check_http -H myurl from the terminal session and get a response.

I feel that I might have missed defining definition some place and wonder if anyone knows about the missing puzzle ....

Thanks!

Re: Error: Service check command 'check_http -H ...'

Posted: Wed Dec 19, 2012 8:20 pm
by jsmurphy
I think you accidentally the exclamation ;) .

Code: Select all

define service{
        use                    generic-service
        host_name              myhostname
        service_description    HTTP
        check_command          check_http!-H myurl
        }

Re: Error: Service check command 'check_http -H ...'

Posted: Thu Dec 20, 2012 11:39 am
by happy
Great job! I had simply copy pasted it from an online post and missed adding an exclamation :)

Many Thanks for taking time to respond!

Re: Error: Service check command 'check_http -H ...'

Posted: Thu Dec 20, 2012 11:46 am
by slansing
Thanks Jsmurphy! And glad to hear this fixed your issue, thank's for the feedback.