check_http socket timeout

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_http socket timeout

Postby ctwhyexit123 » Wed Oct 11, 2017 3:17 pm

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

Re: check_http socket timeout

Postby kyang » Wed Oct 11, 2017 4:25 pm

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kyang
 
Posts: 364
Joined: Tue Jul 25, 2017 3:35 pm

Re: check_http socket timeout

Postby ctwhyexit123 » Wed Oct 11, 2017 5:31 pm

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

Re: check_http socket timeout

Postby tmcdonald » Thu Oct 12, 2017 9:05 am

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Support Lead / Operations Engineer
 
Posts: 8699
Joined: Mon Sep 23, 2013 8:40 am

Re: check_http socket timeout

Postby kyang » Mon Oct 16, 2017 9:07 am

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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kyang
 
Posts: 364
Joined: Tue Jul 25, 2017 3:35 pm

Re: check_http socket timeout

Postby ctwhyexit123 » Tue Oct 17, 2017 7:30 am

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

Re: check_http socket timeout

Postby kyang » Tue Oct 17, 2017 9:18 am

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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kyang
 
Posts: 364
Joined: Tue Jul 25, 2017 3:35 pm

Re: check_http socket timeout

Postby ctwhyexit123 » Tue Oct 17, 2017 11:10 am

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

Re: check_http socket timeout

Postby kyang » Tue Oct 17, 2017 11:33 am

Can you post your check_http command located in the
Code: Select all
/usr/local/nagios/etc/objects/commands.cfg
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
kyang
 
Posts: 364
Joined: Tue Jul 25, 2017 3:35 pm

Re: check_http socket timeout

Postby ctwhyexit123 » Tue Oct 17, 2017 1:34 pm

This is how it looks,

# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
ctwhyexit123
 
Posts: 7
Joined: Wed Oct 11, 2017 12:26 pm

Next

Return to Nagios Core

Who is online

Users browsing this forum: bengadsden and 17 guests