check_http failed

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.
tmeto
Posts: 26
Joined: Tue Aug 20, 2013 4:59 am

check_http failed

Post by tmeto »

hi all!

I'm having a problem trying to monitor a website and not sure if I'm doing the best.

Previously used the check_ping web to see if that was available, but now the web has changed and is of the type: # www.web.com/directorio1/directorio2/.

To see if it is available I'm using: / check_http-H web.com -u "/directory1/directory2/" -w 1000 -c 3000

But even when I test the script from "/usr/local/nagios/libexec" using: ./Check_http web.com .... works, when I look at my site in nagios "host groups / sumary" appears me down and I get this message: (No output on stdout) stderr: execvp (/usr/local/nagios/libexec/check_http-H!...) failed. errno is 2: No such file or directory


This is the most effective way to control the web?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_http failed

Post by tmcdonald »

Can you post the exact command you run from the command line?
Former Nagios employee
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_http failed

Post by slansing »

Please copy your service definition and show us how you have it defined.

Default location for RHEL/CentOS:

Code: Select all

/usr/local/nagios/etc/services/<name>.cfg
tmeto
Posts: 26
Joined: Tue Aug 20, 2013 4:59 am

Re: check_http failed

Post by tmeto »

hi again, yesterday I was making changes and you get to check the web to work, but the host is still listed me as down.

Image


define command{
command_name check_http
command_line $USER1$/check_http!-H $HOSTADDRESS$ -u $ARG1$ -w $ARG2$ -c $ARG3$
}
define service{
use generic-service
host_name web.com
service_description check web login
check_command check_http!-H web.com -u "/aaaa/bbbb/" -c 3000 -w 1500
}
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_http failed

Post by slansing »

Okay... so it is your host failing.. not your check_http service (it appears, at least at this time).. Can you post your host definition?
tmeto
Posts: 26
Joined: Tue Aug 20, 2013 4:59 am

Re: check_http failed

Post by tmeto »

It is very simple but ...

define host{
use generic-switch
host_name web.com
address web.com
check_command check_http
hostgroups webgroup
}
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_http failed

Post by slansing »

What are the critical host status details messages that are being output? It looks like you have not correctly set up your http check, generally, on hosts, you would set up a simple ping check to see if they are up or down. Since you already have check_http service, it would be recommended that you do this. If you still want to have two check_http checks doubling up(one on the host, and one on the service) you need to define your check_http check command on the host as you have it set up on the service. Right now you are just saying, run check_http, with nothing being passed to it.
tmeto
Posts: 26
Joined: Tue Aug 20, 2013 4:59 am

Re: check_http failed

Post by tmeto »

Image

but that file(check_http) is in that folder ... and with the correct permissions.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_http failed

Post by slansing »

Can you show us your command definition for check_http? It should be in commands.cfg.
tmeto
Posts: 26
Joined: Tue Aug 20, 2013 4:59 am

Re: check_http failed

Post by tmeto »

# 'check_http' command definition
define command{
command_name check_http
# command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
command_line $USER1$/check_http -H $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$
}

and i try with other..


define command{
command_name check_http2
command_line $USER1$/check_http!-H $HOSTADDRESS$ -u $ARG1$ -w $ARG2$ -c $ARG3$
}


but it remains still
Locked