I have a strange problem.
When I define a host (like below), all works fine. In nagios, I have this message for this host:
HTTP OK: HTTP/1.1 301 Moved Permanently - 539 bytes in 0.003 second response time
Definition of the host:
Code: Select all
define host{
use generic-geo-host
host_name <Name_of_the_host>
parents localinternetgateway
address <IP address of the host>
contacts nagios-admin
action_url <address of the host ;eg http//host>
}
Code: Select all
define host{
name generic-geo-host ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
notification_period 24x7 ; Send host notifications at any time
check_period 24x7 ; By default, hosts are checked round the clock
max_check_attempts 5 ; Modify to 5 !!Check each host 10 times (max)
check_command check_http ; Default command to check hosts
notification_interval 1440 ; Resend notification every 24 hours
notification_options d,u,r ; Only send notifications for specific host states
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
Code: Select all
define host{
use generic-geo-host
host_name <Name_of_the_host>
parents localinternetgateway
address <IP address of the host>
contacts nagios-admin
check_command check_http-custom!'<address of the host>'
action_url <address of the host ;eg http//host>
}
with
Code: Select all
define command {
command_name check_http_custom
command_line $USER1$/check_http -H $HOSTADDRESS$ -u $ARG1$
}
HTTP WARNING: HTTP/1.1 400 Bad Request - 464 bytes in 0.004 second response time |time=0.003714s;;;0.000000 size=464B;;;0
If I type this command directly, I have the same error message:
Code: Select all
./check_http -H <address of the host> -u ‘<address of the host >’
This difference generates temporally critical timeout (CRITICAL - Socket timeout after 10 seconds) for the concerned host and also for some services associate at this host.
These timeout errors are not present with the first configuration.
I would like to know:
What is the exact command that execute during the first (without define check_command) configuration?
What are the differences between the two configurations about the check_http?
Another question: I know that our host server doesn’t accept HEAD request. May it cause errors?
Thanks in advance for your answers
Corentin