check_http socket timeout

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.
ctwhyexit123
Posts: 9
Joined: Wed Oct 11, 2017 12:26 pm

check_http socket timeout

Post 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?
kyang

Re: check_http socket timeout

Post 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.
ctwhyexit123
Posts: 9
Joined: Wed Oct 11, 2017 12:26 pm

Re: check_http socket timeout

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_http socket timeout

Post 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.
Former Nagios employee
kyang

Re: check_http socket timeout

Post 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
ctwhyexit123
Posts: 9
Joined: Wed Oct 11, 2017 12:26 pm

Re: check_http socket timeout

Post 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
}
kyang

Re: check_http socket timeout

Post 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?
ctwhyexit123
Posts: 9
Joined: Wed Oct 11, 2017 12:26 pm

Re: check_http socket timeout

Post 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
kyang

Re: check_http socket timeout

Post by kyang »

Can you post your check_http command located in the

Code: Select all

/usr/local/nagios/etc/objects/commands.cfg
ctwhyexit123
Posts: 9
Joined: Wed Oct 11, 2017 12:26 pm

Re: check_http socket timeout

Post 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$
}
Locked