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.
Filter check_nrpe by string in the message
Re: Filter check_nrpe by string in the message
Are you looking for a warning or critical is the severity = error and the message contains 'Service Control Manager'?
If so, the command should look like this
The opposite would be
If so, the command should look like this
Code: Select all
check_nrpe -H $HOSTNAME$ -p 5666 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1h AND severity = 'error' AND message like 'Service Control Manager'"Code: Select all
check_nrpe -H $HOSTNAME$ -p 5666 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1h AND severity = 'error' AND message not like 'Service Control Manager'"Be sure to check out our Knowledgebase for helpful articles and solutions!