Re: [monit-dev] Is content match result a variable ?
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'"
On Jul 1, 2011, at 3:32 PM, Eric Pailleau wrote:
> 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\" "
> monit-dev mailing list
> [hidden email] > https://lists.nongnu.org/mailman/listinfo/monit-dev