Page 1 of 1

correct syntax for filter arguments in nrpe

Posted: Wed Feb 08, 2017 6:21 am
by arpanet3
Hello Nagios Support Team,

I've a problem with the correct syntax of the filter arguments in nrpe.

I've wrote two commands:

Code: Select all

#'check_eventvwr_sys_errors' command definition
#Check the Windows System Log for Errors in the last hour

define command{
         command_name    check_eventvwr_sys_errors
         command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckEventLog -a filter=new file="system" MaxWarn=1 MaxCrit=1 filter=generated=\<1h filter+eventType==error filter=in filter=all
         }

Code: Select all

# 'check_exchange_backups' command definition
#Check for NTBackup Running within the last day
#Event ID 8001 is "end of backup"

define command{
         command_name    check_exchange_backups
         command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckEventLog -a filter=new file=application MinWarn=0 MinCrit=0 filter=generated=\>1d filter+eventID=="8001" filter+eventType==info filter=out filter=all
         }
Nagios gave me the output of "Invalid command line: unrecognised option 'filter+eventType==error " in the check_eventvwr_sys_errors
It gave me an "Invalid command line: unrecognised option 'filter+eventID=="8001"' and after that and "Invalid command line: unrecognised option 'filter+eventType==info' in the 'check_exchange_backups' command definition.

I use an old version of the correct syntax probably, but I doesn't knew the latest. I only worked with Nagios in 2010 and at this time the command was correct.

For better understanding:
I use Nagios Core 4.2.4 on Ubuntu 16.10
NSClient 0.5.061 and Nagios Plugins 2.1.4

Thanks for your help
And Sorry for this beginner question

Re: correct syntax for filter arguments in nrpe

Posted: Wed Feb 08, 2017 10:42 am
by rkennedy
Take a look at this answer by @lmiltchev which hits the nail on the head for what you're looking for I believe - https://support.nagios.com/forum/viewto ... 93#p109919 - the only missing part you'd need to append is the eventid.

Re: correct syntax for filter arguments in nrpe

Posted: Wed Mar 01, 2017 2:25 pm
by tmcdonald
Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up or has the issue otherwise been resolved?