I have a problem with plugin check_http, when i run manually
/usr/lib/nagios/plugins$ ./check_http -H server.com -u /bla/bla/bla.jsp -s "wordtosearch"
HTTP OK: HTTP/1.1 200 OK - 26784 bytes en 0,561 segundo tiempo de respuesta |time=0,561292s;;;0,000000 size=26784B;;;0
but when i define as service:
define service {
use generic-service
host_name server.com
service_description server.com
check_command check_http! -H server.com -u /bla/bla/bla.jsp -s "wordtosearch" (or check_http! -u /bla/bla/bla.jsp -s "wordtosearch")
}
the result is:
HTTP WARNING: HTTP/1.1 404 Not Found
Nagios plugins: check_http
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Nagios plugins: check_http
Your service is check command is not going to work if you are using the built in check_http command.
This is because the check_http defined in commands.cfg is defined as:
Which does not match up with the command you tested with (for example you haven't used the -I argument).
You should define a custom command to run the check you want:
And your service definition needs to be defined as:
Does this make sense?
This is because the check_http defined in commands.cfg is defined as:
Code: Select all
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
You should define a custom command to run the check you want:
Code: Select all
define command{
command_name check_http_custom
command_line $USER1$/check_http -H $ARG1$ $ARG2$
}
Code: Select all
check_command check_http_custom!server.com!-u /bla/bla/bla.jsp -s "wordtosearch"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Nagios plugins: check_http
Thanks Box293, now i understand and it works!
Regards
Regards
Re: Nagios plugins: check_http
Glad that worked. I'm locking the thread now. Thanks.