CHECK PROGRAM timeout parsing issue when run as another user

Issue #336 resolved
ekulyk
created an issue

There appears to be an issue when parsing the "with timeout" value when using "CHECK PROGRAM" along with "as uid" .

Here are some test cases to reproduce the issue:

Case 1) Timeout value correctly set (1000)

check program timeout
    with path "sleep 1"
    with timeout 1000 seconds
    every "* * * * *"
    if status != 0 then alert

Case 2) Timeout value incorrectly set (random value)

check program timeoutError
    with path "sleep 1"
    as uid "user"
    with timeout 1000 seconds
    every "* * * * *"
    if status != 0 then alert

I think the issue lies here: https://bitbucket.org/tildeslash/monit/src/f76ef784b79ff88ede3ca1dc220318347a3db92f/src/p.y?at=master&fileviewer=file-view-default#p.y-1210

Probably a copy/paste and forgot to increment it to account for the additional params.

Comments (1)

  1. Log in to comment