request string truncated

Issue #626 resolved
David Lopez created an issue

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&parameter2=parameter2&paremeter3=adsfasdfasdfdasfadsfdasfadsfadsfa&parameter4=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&parameter2=parameter2&paremeter3=adsfasdfasdfdasfadsfdasfadsfadsfa&parameter4=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)

  1. Tildeslash 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&parameter2=parameter2&paremeter3=adsfasdfasdfdasfadsfdasfadsfadsfa&parameter4=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)

  2. David Lopez 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!

  3. Tildeslash 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.

  4. Log in to comment