check_HTTP shows incorrect status on CGI vs. command line
Posted: Tue Dec 03, 2019 1:36 pm
I am trying to check for an expected string on HTTP. To troubleshoot, I executed this command:
and receive this response:
However, when I include that same command in a service definition, it reports 'OK':
displayed via CGI:
What could be causing the command line and CGI output to show different values?
Thanks.
Code: Select all
/usr/lib/nagios/plugins/check_http -H 192.168.0.62 -u "/index.html" -s "qwerty"
Code: Select all
HTTP CRITICAL: HTTP/1.1 200 OK - string 'qwerty' not found on 'http://192.168.0.62:80/index.html' - 11192 bytes in 0.001 second response time |time=0.001152s;;;0.000000;10.000000 size=11192B;;;0Code: Select all
define service{
use custom-service
host_name myhostname
service_description flag1
check_command check_http! -u "/index.html" --string="qwerty"
check_interval 1
}
Code: Select all
Service State Information
Current Status: OK (for 0d 0h 13m 46s)
Status Information: HTTP OK: HTTP/1.1 200 OK - 11192 bytes in 0.001 second response time
Performance Data: time=0.001216s;;;0.000000;10.000000 size=11192B;;;0Thanks.