command line check returns OK, GUI returns Warning
Posted: Mon Jul 18, 2016 3:54 am
I am using Nagios Core 3.5.1 on Ubuntu 14.04.2 LTS.
I have created a http check for a site and tested on the command line which returns me OK status. I am expecting a http 400 and body to be 'Malformed'
I then put that into the actual nagios configuration and it returns me a warning. Below is my command config and service config.
these the actual status information for the check that I get on the UI is
Status Information: HTTP WARNING: HTTP/1.1 400 Bad Request - 399 bytes in 0.074 second response time
This does not make sense since i have put the -e 400 switch saying I am expecting the 400 Bad Request.
any suggestions?
thanks
I have created a http check for a site and tested on the command line which returns me OK status. I am expecting a http 400 and body to be 'Malformed'
Code: Select all
# /usr/lib/nagios/plugins/check_http --ssl -H example.co.uk -u /rpc/json.php -s 'Malformed' -e 400
HTTP OK: Status line output matched "400" - 399 bytes in 0.050 second response time |time=0.049943s;;;0.000000 size=399B;;;0Code: Select all
define command{
command_name check_custom_https_path
command_line /usr/lib/nagios/plugins/check_http --ssl -H '$ARG1$' -u '$ARG2$'
}
define service {
use generic-service,graphed-service
host_name localhost
service_description Check example.co.uk
check_command check_custom_https_path!example.co.uk!/rpc/json.php!-s 'Malformed'!-e 400!-w 1!-c 2
contact_groups admins
}Status Information: HTTP WARNING: HTTP/1.1 400 Bad Request - 399 bytes in 0.074 second response time
This does not make sense since i have put the -e 400 switch saying I am expecting the 400 Bad Request.
any suggestions?
thanks