-
assigned issue to
- edited description
request string truncated
Hi, I have a check like this:
check test.com with address 127.0.0.1
if failed port 9191 protocol HTTP
request "/series?from=17-8-8-8¶meter2=parameter2&paremeter3=adsfasdfasdfdasfadsfdasfadsfadsfa¶meter4=eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340&paremeter5=eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340&paremeter6=siu"
with timeout 10 seconds
then alert
if 10 restarts within 10 cycles then timeout
When I run the check, in the logs appears:
error : 'test.com' failed protocol test [HTTP] at [127.0.0.1]:9191/series?from=17-8-8-8¶meter2=parameter2&paremeter3=adsfasdfasdfdasfadsfdasfadsfadsfa¶meter4=eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aac
There is a limitation of the string in the request? Because it seems that is not checking all the url.. Someone could help me? Thanks!!
Comments (6)
-
repo owner -
repo owner Hello David,
the request is not truncated by Monit, only the log message is truncated.
The most likely reason why the request fails is, that Monit by default uses HEAD method, if the content is not necessary (no content check nor checksum test are performed).
Monit 5.22 or later has a "method GET" option, so you can enforce it like this:
check test.com with address 127.0.0.1 if failed port 9191 protocol HTTP method GET # NOTE: this option forces monit to use GET instead of default HEAD method request "/series?from=17-8-8-8¶meter2=parameter2&paremeter3=adsfasdfasdfdasfadsfdasfadsfadsfa¶meter4=eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340&paremeter5=eff7765858259c1cd6f1a876d036ec83074784b92aacc7143238330afe472340&paremeter6=siu" with timeout 10 seconds then alert if 10 restarts within 10 cycles then timeout
If you use Monit < 5.22.0, you can enforce GET by adding "content" test (https://mmonit.com/monit/documentation/monit.html#HTTP)
-
reporter Hi!
I tried with the "method GET" option and appears this error:
syntax error 'method'
The version of monit that I have is 5.16
Thanks!
-
repo owner As mentioned, the "method GET" was added in Monit 5.22.0.
For Monit < 5.22.0 (including Monit 5.16.0): you need to extend the http protocol test by "content <pattern>" option, where the <pattern> matches some string in the returned data.
-
reporter Hi @tildeslash
Thanks for your help, now is working!
Cheers
-
repo owner - changed status to resolved
- Log in to comment