check_http => No route to host

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
Ismo

check_http => No route to host

Post by Ismo »

Hi all,

On nagios, I have several services which are critical and with message ‘No route to host’.
(Services are checked with check_http).
However, I can access to the http page (that I check) so the critical error is wrong (services working fine).
In addition, when I manually check the service from the nagios machine => test is OK:

./check_http -H <hostename> -p <port> -u '<uri>'
The results is : HTTP OK HTTP/1.1 200 OK - 18329 bytes in 8.534 seconds |time=8.533538s;;;0.000000 size=18329B;;;0

I also can ping the service.
In my conf, I defined (fields between <> are well informed):

Code: Select all

define service{
	use	 geonetwork-productaccess-alive
	host_name 	<hostname>
	service_description	 <service description>
	contacts 	nagios-admin
	check_command 	check_http!-p <port> -u ‘<uri>’
	action_url	 <hostname><uri>
}
Note : I also defined the host of theses services and all is ok (manually and on nagios)

Code: Select all

 
	define host{
	use 	generic-geonetwork-host
	host_name 	<hostname>
	parents 	localinternetgateway (well define)
	address		 <IP address>
	check_command 	check_http_with_port!<port>
	contact 	nagios-admin
	action_url	 http:// <hostname>:<port>
}
Commands :

Code: Select all

define command {
	command_name check_http_with_port
	command_line $USER1$/check_http -I $HOSTADDRESS$ -p $ARG1$ -f follow
}
Complement:
Other services (on another hosts) are checked in the same way and everything works fine.
On another machine, all is ok. Nagios versions are different between these two machines.
Nagios 3.0.6 => No route to host problem
Nagios 3.4.4=> All is OK
Maybe problem comes from here?

Does anyone knows why when I test manually, it works fine while on nagios i have the "no route to host" message?

Thanks in advance for your helps
Corentin
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_http => No route to host

Post by sreinhardt »

Your service command is defined as:
check_http -I $HOSTADDRESS$ -p -p <port> -u ‘<uri>’ -f follow

Your test command is run as:
check_http -H <hostename> -p <port> -u '<uri>'

So you are running into a couple issues. Firstly -p -p [port] needs to be a single -p [port], either define in service or command but not both. Second, -I is not the same as -H, you will need to use a -H $HOSTADDRESS$ and can also use -I later, but it must have -H.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Ismo

Re: check_http => No route to host

Post by Ismo »

Hello,

Thanks for your help.

I thinks that my post was not clear.

For my service I use the Nagios default "check_http" command :
"check_http_with_port" is only for check my host.

So , I think that for my service, I have : check_http -I <hostename> $Arg1$
with $Arg1$ = -p <port> -u ‘<uri>’

In addition, I have services using the same process (same control with port, same schema definition, using the same command) and it works well in nagios.
I will try to define a specific command (using -H and not -I) for my services which are not working and see if it works.
Just for see if there is a configuration error or if it's something else.

I'll let you know

Thanks
Corentin
Ismo

Re: check_http => No route to host

Post by Ismo »

Ok, I just made a specific command for the critical service and it works fine.
The problem is well a configuration problem as you said.
Thanks, I will try to fix it
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_http => No route to host

Post by sreinhardt »

You're welcome, let us know if you have other questions\issues!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked