Filter check_nrpe by string in the message
Posted: Fri Apr 15, 2016 10:35 am
Hi All,
I'm trying to filter the email automatically sent by nagios applying a filter based on string in the message.
The original command is: check_nrpe -H $HOSTNAME$ -p 5666 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1h AND severity = 'error'"
and I tried to add message filter in this way: check_nrpe -H $HOSTNAME$ -p 5666 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1h AND severity = 'error' AND NOT message like 'test' "
but it obviously does not work.
What I'm trying to do is a command who filters message by string, for example if in the error message shows 'Service Control Manager'.
Can anyone help me, please?
Thank in advance.
I'm trying to filter the email automatically sent by nagios applying a filter based on string in the message.
The original command is: check_nrpe -H $HOSTNAME$ -p 5666 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1h AND severity = 'error'"
and I tried to add message filter in this way: check_nrpe -H $HOSTNAME$ -p 5666 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1h AND severity = 'error' AND NOT message like 'test' "
but it obviously does not work.
What I'm trying to do is a command who filters message by string, for example if in the error message shows 'Service Control Manager'.
Can anyone help me, please?
Thank in advance.