correct syntax for filter arguments in nrpe

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
arpanet3
Posts: 3
Joined: Wed Dec 07, 2016 7:19 am

correct syntax for filter arguments in nrpe

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: correct syntax for filter arguments in nrpe

Post 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.
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: correct syntax for filter arguments in nrpe

Post 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?
Former Nagios employee
Locked