Page 1 of 3

check_http socket timeout

Posted: Wed Oct 11, 2017 3:17 pm
by ctwhyexit123
We are seeing a very odd problem on our Nagios environment.

We have check_http setup to monitor 7 sites on 7 different servers and it works fine giving an OK status.
We have two more setup to do the same on two different servers and it doesn't work.

This is our line on the Nagios Server,

define service{
use generic-service
host_name host-app-01
service_description Web Site
check_command check_http! -H website.com
contact_groups ADMINS
}

The below works,
/usr/local/nagios/libexec/check_http -H website.com

Somehow Nagios doesn't want to give an OK status for the site. Where do you think we should check next?

Re: check_http socket timeout

Posted: Wed Oct 11, 2017 4:25 pm
by kyang
Do you mind sending me the website you are checking? I'd like to test it from my Nagios Core.

You can PM if you don't feel comfortable sending it.

Re: check_http socket timeout

Posted: Wed Oct 11, 2017 5:31 pm
by ctwhyexit123
Thank you for your response. I don't think I can PM (as per Nagios site policy) as I just joined. Can you PM me your e-mail.

Re: check_http socket timeout

Posted: Thu Oct 12, 2017 9:05 am
by tmcdonald
You need to have two posts approved before you can PM people, so you should be good now. Please post back once you have sent it to @kyang.

Re: check_http socket timeout

Posted: Mon Oct 16, 2017 9:07 am
by kyang
Thanks for sending me the website through PM.

I tested your website on my Core 4, and it works just fine! Did you resolve this already?

My service is defined like this.

Code: Select all

define service{
        use                             local-service         ; Name of service template to use
        host_name                       localhost
        service_description             HTTP
        check_command                   check_http!-H <yourwebsite>
        notifications_enabled           0
        }
Nothing looks wrong with yours, is it just showing as a critical state?

Run this command and tell us what version your plugin is?

Code: Select all

/usr/local/nagios/libexec/check_http -V

Re: check_http socket timeout

Posted: Tue Oct 17, 2017 7:30 am
by ctwhyexit123
Thank you for your response. This is my check_http version
[root@hostname nagios]# /usr/local/nagios/libexec/check_http -V
check_http v2.2.0.git (nagios-plugins 2.2.0)

I have something similar but changed from generic-service to local-service as you had put

define service{
use local-service
host_name this-host
service_description Web Site
check_command check_http! -H domain.com
contact_groups ADMINS
}

Re: check_http socket timeout

Posted: Tue Oct 17, 2017 9:18 am
by kyang
When you restart Nagios after editing this service.

Code: Select all

service nagios restart
Does it work for you in the UI? Or is it still showing socket timeout?

Re: check_http socket timeout

Posted: Tue Oct 17, 2017 11:10 am
by ctwhyexit123
I did a nagios restart.

This works on the CLI manually. Not on the dashboard.

[root@hostname libexec]# ./check_http -H domain,com
HTTP OK: HTTP/1.1 301 Moved Permanently - 378 bytes in 0.232 second response time |time=0.231502s;;;0.000000 size=378B;;;0

The -f follow also works and gives me a 200 OK on the command line but not on the dashboard

Re: check_http socket timeout

Posted: Tue Oct 17, 2017 11:33 am
by kyang
Can you post your check_http command located in the

Code: Select all

/usr/local/nagios/etc/objects/commands.cfg

Re: check_http socket timeout

Posted: Tue Oct 17, 2017 1:34 pm
by ctwhyexit123
This is how it looks,

# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}