correct syntax for filter arguments in nrpe

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

correct syntax for filter arguments in nrpe

Postby arpanet3 » Wed Feb 08, 2017 6:21 am

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
Posts: 3
Joined: Wed Dec 07, 2016 7:19 am

Re: correct syntax for filter arguments in nrpe

Postby rkennedy » Wed Feb 08, 2017 10:42 am

Take a look at this answer by @lmiltchev which hits the nail on the head for what you're looking for I believe - viewtopic.php?f=7&t=28893#p109919 - the only missing part you'd need to append is the eventid.
Posts: 6545
Joined: Mon Oct 05, 2015 11:45 am

Re: correct syntax for filter arguments in nrpe

Postby tmcdonald » Wed Mar 01, 2017 2:25 pm

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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Support Manager
Posts: 8177
Joined: Mon Sep 23, 2013 8:40 am

Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 1 guest