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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
happy
Posts: 20
Joined: Wed Nov 28, 2012 4:37 pm

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

Post 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!
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

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

Post 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
        }
happy
Posts: 20
Joined: Wed Nov 28, 2012 4:37 pm

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

Post 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!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

Thanks Jsmurphy! And glad to hear this fixed your issue, thank's for the feedback.
Locked