Page 2 of 3

Re: Incorrect report

Posted: Sat Dec 28, 2013 3:48 am
by chitrangada
Hi,

I again tried command this way:
# /usr/lib/nagios/plugins/check_http -H fredriknas.se -I 188.95.227.20 -t 30 -p 80
..... and it resulted:
HTTP OK: HTTP/1.1 200 OK - 70733 bytes in 0.625 second response time |time=0.624653s;;;0.000000 size=70733B;;;0

Is it right way to use both the options -H and -I since in the document we are asked to use either of them?

One more thing, i am getting host(cartoonnetwork.com) DOWN but service(check_http) on it is UP. I checked the host using nmap,socket is open. Could you please tell me about the host check options which can be helpful OR if any option which i missed to set?

Thanks in advance

Re: Incorrect report

Posted: Sat Dec 28, 2013 6:24 am
by chitrangada
For your questions:

1. Is the host 188.95.227.20 a windows or linux box?
A: Its a linux host.

2. Is there a router/firewall between your nagios server and the 188.95.227.20 host?
A. Yes, routers and firewalls are there

3. Is a web server actually running on the remote host 188.95.227.20?
A. Yes, web server is running since the site is UP

Re: Incorrect report

Posted: Mon Dec 30, 2013 10:25 am
by slansing
It is possible that you are not able to reach "188.95.227.20" directly through your firewalls/routers. Have you tried with just -H and not -l? -H is the address that would be used by nagios to dynamically fill out your host address in your service configurations, it would be pulled down by your host.

Re: Incorrect report

Posted: Thu Jan 16, 2014 4:31 am
by chitrangada
Hi,

Thanks for your continuous responses on the problem and apologies for delay from my side.

Well, it was occurring due to the firewalls as you have highlighted this thing so we had fixed it. Regarding the host DOWN and service UP issue, it is due to the internal redirections so we are working for it.

So we are now in a good condition to understand the issues and trying to handle it. It was really nice to have your support at every point.

Thanks again.. ! :-)

Re: Incorrect report

Posted: Thu Jan 16, 2014 11:11 am
by slansing
Awesome! Do you want us to leave this thread open, or close it? It sounds like you found the solution.

Re: Incorrect report

Posted: Fri Jan 17, 2014 1:45 am
by chitrangada
Yes, kind of.

By the way in my configuration, i noticed that by default Nagios checks status of a host using 'check_host_alive' command and this command just pings the domain i.e it uses check_ping command. The definition of check_host_alive command is "$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5".
But there are some domains which do not produce the result which is expected. Infact there are domains which says the host is UP when we use check_http but are DOWN when check_ping is used. I'm not getting how nagios perform checking through check_http, in my prediction it might be following the redirect URL(s) and producing result.

Its just the conceptual thing which is a bit unclear to me. So i would be thankful if you explain me briefly working of these commands. Also please let me know if i can use any other command which would give correct status for a domain instead of check_ping in check_host_alive.

Thanks alot for hearing me.

Re: Incorrect report

Posted: Fri Jan 17, 2014 2:35 pm
by slansing
Yes, I believe check_http follows redirects by default. Have you tried using the check_dns plugin provided with the nagios plugins package?

Re: Incorrect report

Posted: Mon Jan 20, 2014 8:52 am
by chitrangada
No, check_http does not follow by defaul. In order to follow redirects we need to pass an option '-f' with value 'follow' then it follows and give 'HTTP OK 200 ...' status record. I tried check_dns but i am not sure with its usage. Could you please explain me that? By the way, i am using check_http to monitor hosts in place of check_ping and it is giving me expected result. Just to confirm that if we want to check a host is UP or DOWN then we can use any of the command i.e. check_ping OR check_http, right?

Re: Incorrect report

Posted: Mon Jan 20, 2014 10:51 am
by slansing
Well, it does by default, default being all the options baked into the plugin without you having to add more. The check_dns usage output is here:

http://www.nagios-plugins.org/doc/man/check_dns.html

Or you can run -h against it... once again. You need to pass the DNS server address, and an expected address I'd also recommend you set a timeout, and a warning and critical range.

Re: Incorrect report

Posted: Tue Jan 21, 2014 6:00 am
by chitrangada
Yes, i think i can use check_dns but will not provide expected IP address because whenever the list of IP addresses obtained for a host by this plugin it throws critical error. I am not getting why it is saying 'critical'; in my opinion it should compare expected IP address in the obtained IP address list. But i would really like to know the reason behind current functionality, it may be for a big reason.