[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [monit-dev] Is content match result a variable ?
From: |
Martin Pala |
Subject: |
Re: [monit-dev] Is content match result a variable ? |
Date: |
Sat, 2 Jul 2011 23:26:30 +0200 |
Hi,
monit sets "MONIT_DESCRIPTION" environment variable for the executed program,
you may need to wrap it with shell to expand it:
if match /etc/monit/test.regex then exec "/bin/bash -c
'/path/to/my/script $MONIT_DESCRIPTION'"
Regards,
Martin
On Jul 1, 2011, at 3:32 PM, Eric Pailleau wrote:
> Hi,
>
> I can't find any answer to this question in the documentation.
>
> I'm using content match rule to detect entries in a log, this work perfectly,
> but instead sending alert, it is possible to do an exec with
> content match as variable given as argument to a script ?
>
> [...]
> if match /etc/monit/test.regex then exec "/path/to/my/script \"$CONTENT\" "
>
> ???
> Regards.
>
> _______________________________________________
> monit-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/monit-dev