Incorrect report

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.
chitrangada
Posts: 32
Joined: Sat Aug 10, 2013 8:20 am

Re: Incorrect report

Post 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
chitrangada
Posts: 32
Joined: Sat Aug 10, 2013 8:20 am

Re: Incorrect report

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

Re: Incorrect report

Post 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.
chitrangada
Posts: 32
Joined: Sat Aug 10, 2013 8:20 am

Re: Incorrect report

Post 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.. ! :-)
Last edited by chitrangada on Wed Jan 22, 2014 12:11 am, edited 1 time in total.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Incorrect report

Post by slansing »

Awesome! Do you want us to leave this thread open, or close it? It sounds like you found the solution.
chitrangada
Posts: 32
Joined: Sat Aug 10, 2013 8:20 am

Re: Incorrect report

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

Re: Incorrect report

Post 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?
chitrangada
Posts: 32
Joined: Sat Aug 10, 2013 8:20 am

Re: Incorrect report

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

Re: Incorrect report

Post 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.
chitrangada
Posts: 32
Joined: Sat Aug 10, 2013 8:20 am

Re: Incorrect report

Post 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.
Locked