Page 1 of 3

service http Critical

Posted: Mon Feb 02, 2015 10:58 am
by ziedmahjoub
hi ,
i want to monitor the service http in a windows machine so i just added this service in the windows.cfg :

define service {
use generic-service
host_name user
service_description http
check_command check_http
}

thanks a lot for your answers

Re: service http Critical

Posted: Mon Feb 02, 2015 11:10 am
by tmcdonald
What is the actual issue you are having?

Re: service http Critical

Posted: Mon Feb 02, 2015 11:19 am
by ziedmahjoub
Status Information :

CRITICAL - Socket timeout after 10 seconds

Re: service http Critical

Posted: Mon Feb 02, 2015 11:24 am
by tmcdonald
Do you actually have "host_name user" for that service? If so, can you post the host config for the "user" host?

Re: service http Critical

Posted: Mon Feb 02, 2015 11:25 am
by slansing
Can you show us the command definition that you are using there?

Re: service http Critical

Posted: Tue Feb 03, 2015 2:45 am
by ziedmahjoub
tmcdonald wrote:Do you actually have "host_name user" for that service? If so, can you post the host config for the "user" host?
Yes i have , this is the host config :

Code: Select all

define host{
            use                   windows-server
            host_name        user
            alias                 My Windows Server
            address             a.b.c.d
            }

Re: service http Critical

Posted: Tue Feb 03, 2015 2:48 am
by ziedmahjoub
slansing wrote:Can you show us the command definition that you are using there?

Code: Select all

#'check_http' command definition
define command {
   command_name    check_http
   command_line       $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
                  }
I have tried to replace -I with -H but it didn't work

Re: service http Critical

Posted: Tue Feb 03, 2015 1:22 pm
by tgriep
Can you run the check from a command prompt without any errors?
Try running this and post the results back.

Code: Select all

/usr/local/nagios/libexec/check_http -H <IP or Host name>

Re: service http Critical

Posted: Wed Feb 04, 2015 3:04 am
by ziedmahjoub

Code: Select all

sudo /usr/local/nagios/libexec/check_http -H 192.168.0.24
CRITICAL - Socket timeout after 10 seconds
after i disabled the firewall of the machine, i get this message:

Code: Select all

connect to address 192.168.0.24 and port 80:Connection refused
HTTP CRITICAL - Unable to open TCP socket

Re: service http Critical

Posted: Wed Feb 04, 2015 10:47 am
by abrist
It looks like port 80 is not open. What is the output of nmap?

Code: Select all

nmap -p 80 192.168.0.24