check_http socket timeout
-
- Posts: 9
- Joined: Wed Oct 11, 2017 12:26 pm
check_http socket timeout
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?
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
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.
You can PM if you don't feel comfortable sending it.
-
- Posts: 9
- Joined: Wed Oct 11, 2017 12:26 pm
Re: check_http socket timeout
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
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
Re: check_http socket timeout
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.
Nothing looks wrong with yours, is it just showing as a critical state?
Run this command and tell us what version your plugin is?
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
}
Run this command and tell us what version your plugin is?
Code: Select all
/usr/local/nagios/libexec/check_http -V
-
- Posts: 9
- Joined: Wed Oct 11, 2017 12:26 pm
Re: check_http socket timeout
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
}
[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
When you restart Nagios after editing this service.
Does it work for you in the UI? Or is it still showing socket timeout?
Code: Select all
service nagios restart
-
- Posts: 9
- Joined: Wed Oct 11, 2017 12:26 pm
Re: check_http socket timeout
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
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
Can you post your check_http command located in the
Code: Select all
/usr/local/nagios/etc/objects/commands.cfg
-
- Posts: 9
- Joined: Wed Oct 11, 2017 12:26 pm
Re: check_http socket timeout
This is how it looks,
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}