Currently for testing I set the service check as follows:
define service{
use generic-service
host_name <host>
service_description HTTP
check_command check_http!-s "blablabla" -f follow
}
Note the string "blablabla" does not exist on the page, this is simply for testing.
Nagios is reporting
HTTP OK: HTTP/1.1 301 Moved Permanently - 294 bytes in 6.607 second response time
Performance Data: time=6.606636s;;;0.000000 size=294B;;;0
However if I run the check_http plugin directly I get the following:
<user>@<nagiosbox>:/usr/lib/nagios/plugins# ./check_http -H <host> -s "blablabla" -f follow
HTTP CRITICAL: HTTP/1.1 200 OK - string 'blablabla' not found on 'http://<host>:80/' - 92654 bytes in 3.984 second response time |time=3.983636s;;;0.000000 size=92654B;;;0
Are you sure you are calling the same plugin with the same arguments? It seems to me that you did not define the service correctly. Usually, the arguments are passed without options such as:
They are spearated by
!
. In the command definition, you can specify the correct options of the check_http plugin such as:The arguments
$ARG1$
and$ARG2$
will be replaced with the real values you specified in the service definition.