check_http
Posted: Thu Jun 30, 2016 10:54 am
Hi All
We are using Nagios Core 4.0.8
And we are using Check_by method instead of NRPE.
We are trying to monitor json in our web server.
when we run below command it gives specific output.
curl https://api.dev.google.com/versions.json --proxy proxyserver.com:8080 -o /dev/null;echo $?
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1107 100 1107 0 0 3097 0 --:--:-- --:--:-- --:--:-- 3395
0
And when we try to run From nagios it gives error. Like socket timed out and Name or service not known
HTTP CRITICAL - Unable to open TCP socket.
And command.cfg
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
define command{
command_name check_http_content_hh
command_line $USER1$/check_http -H $HOSTADDRESS$ -w 5 -c 10 --ssl -u $ARG1$ -s $ARG2$
}
# 'check_http_content_proxy' command definition
define command{
command_name check_http_content_proxy
command_line $USER1$/check_http -I $ARG1$ -P $ARG2$ -H $HOSTADDRESS$ -w 5 -c 10 --ssl -u $ARG3$ -s $ARG4$
}
and have defined service as
define service{
use generic-service
host_name above-property-stg
service_description https
check_command check_http! -H api.dev.google.com -u /versions.json -S -w 10 -c 20
}
This command gives socket timed out after 10 seconds error.
define service{
use generic-service
host_name above-property-stg
service_description https
check_command check_http_content_proxy! -I proxyserver.com -p 8080 -H api.dev.google.com -u /versions.json -S -w 10 -c 20
}
And this command gives Name or service not known
HTTP CRITICAL - Unable to open TCP socket.
So how can i monitor if there is any issue with command line, please let me know.
Thank you Everyone.
We are using Nagios Core 4.0.8
And we are using Check_by method instead of NRPE.
We are trying to monitor json in our web server.
when we run below command it gives specific output.
curl https://api.dev.google.com/versions.json --proxy proxyserver.com:8080 -o /dev/null;echo $?
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1107 100 1107 0 0 3097 0 --:--:-- --:--:-- --:--:-- 3395
0
And when we try to run From nagios it gives error. Like socket timed out and Name or service not known
HTTP CRITICAL - Unable to open TCP socket.
And command.cfg
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
define command{
command_name check_http_content_hh
command_line $USER1$/check_http -H $HOSTADDRESS$ -w 5 -c 10 --ssl -u $ARG1$ -s $ARG2$
}
# 'check_http_content_proxy' command definition
define command{
command_name check_http_content_proxy
command_line $USER1$/check_http -I $ARG1$ -P $ARG2$ -H $HOSTADDRESS$ -w 5 -c 10 --ssl -u $ARG3$ -s $ARG4$
}
and have defined service as
define service{
use generic-service
host_name above-property-stg
service_description https
check_command check_http! -H api.dev.google.com -u /versions.json -S -w 10 -c 20
}
This command gives socket timed out after 10 seconds error.
define service{
use generic-service
host_name above-property-stg
service_description https
check_command check_http_content_proxy! -I proxyserver.com -p 8080 -H api.dev.google.com -u /versions.json -S -w 10 -c 20
}
And this command gives Name or service not known
HTTP CRITICAL - Unable to open TCP socket.
So how can i monitor if there is any issue with command line, please let me know.
Thank you Everyone.