trouble setting check_http
Posted: Wed Aug 07, 2013 12:29 pm
Hi.
Iḿ trying to use the plugin check_http to verify the result of an access to one URL to check if the responses of the server are ok.
This is the URL I want to check :
and it gives this response:
First I tested the access to this URL with links and I had to make slight modification in order to get it working (just encoding and scaping some chars). So i got this command line working like on the browser:
This is the output of the links command:
When I tested the URL with the check_http command everything worked like a charm:
Then I created the following command on the Nagios configuration:
Although the command worked by hand, it do not work under the Nagios process. It keeps giving the following error:
When the command is executed by the Nagios, you can notice an extra "$" at the end of the request on the error message.
Also if the command definition is changed to:
The error message change to:
With an extra "$" appended to the search string, making me believe the Nagios process is adding this "$" at the end of the check_http command.
Am I missing something? How can I fix this?
Please, any help will be very appreciated.
Iḿ trying to use the plugin check_http to verify the result of an access to one URL to check if the responses of the server are ok.
This is the URL I want to check :
Code: Select all
http://172.31.0.28:81/odbc/odbc_mapper_table.php?tb=ura_saldo&pr=%20WHERE%20'$runparam'%20=%20'1805,8419195204000,1,2121729026'Code: Select all
<documento>
<dados>
<linha>
<Saldo>000</Saldo>
<Pagtomin>000</Pagtomin>
<CC>84</CC>
<cartao>8419195204000</cartao>
<param>8419195204000</param>
<NroOrigem>ANA LUCIA DE LIMA COSTA</NroOrigem>
</linha>
</dados>
</documento>Code: Select all
# links "http://172.31.0.28:81/odbc/odbc_mapper_table.php?tb=ura_saldo&pr=%20WHERE%20%27\$runparam%27%20=%20%271805,8419195204000,1,2121729026%27"Code: Select all
<?xml version = "1.0" encoding = "ISO-8859-1"?>
<documento>
<dados>
<linha>
<Saldo>000</Saldo>
<Pagtomin>000</Pagtomin>
<CC>84</CC>
<cartao>8419195204000</cartao>
<param>8419195204000</param>
<NroOrigem>ANA LUCIA DE LIMA COSTA</NroOrigem>
</linha>
</dados>
</documento>Code: Select all
# /usr/libexec/nagios/check_http -H 172.31.0.28 -p81 -s "ANA LUCIA DE LIMA COSTA" -u "/odbc/odbc_mapper_table.php?tb=ura_saldo&pr=%20WHERE%20%27\$runparam%27%20=%20%271805,8419195204000,1,2121729026%27"
HTTP OK: HTTP/1.1 200 OK - 522 bytes in 2.953 second response time |time=2.952692s;;;0.000000 size=522B;;;0Code: Select all
define service{
use prioritary-service
host_name servidor-ura
service_description WEBTX-ura
check_command check_http_ip!$HOSTADDRESS$!-p81 -s "ANA LUCIA DE LIMA COSTA" -u "/odbc/odbc_mapper_table.php?tb=ura_saldo&pr=%20WHERE%20%27\$runparam%27%20=%20%271805,8419195204000,1,2121729026%27"
contact_groups cpd,support
}Code: Select all
HTTP CRITICAL: HTTP/1.1 200 OK - string 'ANA LUCIA DE LIMA COSTA' not found on 'http://172.31.0.28:81/odbc/odbc_mapper_table.php?tb=ura_saldo&pr=%20WHERE%20%27%27%20=%20%271805,8419195204000,1,2121729026%27$' - 422 bytes in 2.105 second response time Also if the command definition is changed to:
Code: Select all
define service{
use prioritary-service
host_name servidor-ura
service_description WEBTX-ura
check_command check_http_ip!$HOSTADDRESS$!-p81 -u "/odbc/odbc_mapper_table.php?tb=ura_saldo&pr=%20WHERE%20%27\$runparam%27%20=%20%271805,8419195204000,1,2121729026%27" -s "ANA LUCIA DE LIMA COSTA"
contact_groups cpd,support
}Code: Select all
HTTP CRITICAL: HTTP/1.1 200 OK - string 'ANA LUCIA DE LIMA COSTA$' not found on 'http://172.31.0.28:81/odbc/odbc_mapper_table.php?tb=ura_saldo&pr=%20WHERE%20%27%27%20=%20%271805,8419195204000,1,2121729026%27' - 421 bytes in 2.029 second response time Am I missing something? How can I fix this?
Please, any help will be very appreciated.