Thanks Michael,

just after some more tests I saw it don't like arguments, so I make a
wrapper script (as you suggested).

I'm lucky since I need only to start again the process, so at least now it
works.

Thanks for your time, much appreciated.

Antonio


On Thu, Nov 15, 2012 at 11:27 AM, Michael Johnson - MJ <[email protected]> wrote:

> To my knowledge, you cannot pass arguments to the program specified by
> 'check program'.  You can however write a simple wrapper script.  Annoying,
> yes, but manageable.
>
> You will notice however that the 'check program' functionality is
> problematic in other ways as well.  Specifically, becuase of the way it
> works, when a failure is detected, the stop and/or start program will be
> executed simultaneously to the next 'check' program resulting in the status
> for the next check to also indicate failure and then your stop and/or start
> program will be executed again even though the monitored program may
> already be running.
>
> Good luck!
>
>
> On Thu, Nov 15, 2012 at 2:01 AM, Antonio Fernández Vara <
> [email protected]> wrote:
>
>> Hi all, and thanks in advance.
>>
>> We are using monit to check 3 servers, each will run some services that
>> often can fail, since it will be doing tests of code.
>>
>> So I made an script to monitor if each service is running or not,
>> returning 0 or 1 as exit error code.
>>
>> For each service I'm writting a monit configuration file inside the
>> conf.d, with this contents (way simpler):
>>
>> check program 001 with path "/opt/scripts/running.sh 001"
>>      if status != 0 then exec "/opt/scripts/run.sh 001"
>>
>> but every time I test the config files I get this error: Program does not
>> exist: '"/opt/scripts/running.sh exec"'.
>>
>> Not enclosing the command it will say that the argument is a syntax error
>> for the monit language.
>>
>> So, is there any form I can pass an argument to an script monitored by
>> check program? Or I'm doing something wrong?
>>
>> Thanks in advance.
>>
>> Antonio
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>>
>
>
>
> --
> Michael Johnson - MJ
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to