-e or --expect option is monitoring http response code, at least one of them is expected in the first line of server response "httpd/1.". For example ( 404, 403, 500, etc).
As we are exprect the http code is 200. Incase if you receives an 400 error code the output shows "HTTP/1.1 400 Bad Request"
Open your hosts service on nagios server,
define service{
host_name yourdomain.com
use HTTP_RESPONSE
check_command check_http!-u /path -H your_domain_name.com -e "HTTP/1.1 200"
}
host_name yourdomain.com
use HTTP_RESPONSE
check_command check_http!-u /path -H your_domain_name.com -e "HTTP/1.1 200"
}
open the nrpe.cfg file on your client system and add below lines.
# vim /usr/local/nagios/etc/nrpe.cfg
command[check_http]=/usr/local/nagios/libexec/check_http -S -H your_domain.com -I 192.168.0.202 -c 5 -p 443 -m 12010:13000 -u 'https://www.your_domain.com/' -s 'add your webpage contenet' -e "HTTP/1.1 200"
Do you want to check manually,
# /usr/local/nagios/libexec/check_http -S -H your_domain.com -I 192.168.0.202 -c 5 -p 443 -m 12010:13000 -e "HTTP/1.1 200" -u 'https://www.your_domain.com/' -s 'add your webpage contenet'
HTTP OK: Status line output matched "HTTP/1.1 200" - 12511 bytes in 0.012 second response time |time=0.011877s;;5.000000;0.000000 size=26818B;20000;0;0
Comments (0)