Page 1 of 1

Problem with service check Nagios 2012R1.1

Posted: Tue Oct 30, 2012 10:12 am
by guppy_rules
We are running the trial version of Nagios 2012R1.1 and we have some problems.

First we want to add a check like this:
$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c $ARG1$ -a $ARG2$ $ARG3$

The arguments are:
$ARG1$: check_eventlog
$ARG2$: "file=System filter+generated=<1h filter+eventType==warning MaxWarn=1 MaxCrit=1"

When we run this command in a nagiosxi, we get the error:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H example.com -p 5666 -c check_eventlog -a "file=System filter generated=\<1h filter eventType==warning MaxWarn=1 MaxCrit=1"
OUTPUT: Unknown argument: generated

It's loose the + between filter and generated.

On the command line this command works:
/usr/local/nagios/libexec/check_nrpe -H example.host -p 5666 -c check_eventlog -a "file=System filter+generated=<1h filter+eventType==warning MaxWarn=1 MaxCrit=1"
Eventlog check ok|'eventlog'=0;1;1

What to do to fix this?

Re: Problem with service check Nagios 2012R1.1

Posted: Tue Oct 30, 2012 10:59 am
by mguthrie
Try single quotes instead of double. It looks like the backslash is escaping the rest of the command.

Re: Problem with service check Nagios 2012R1.1

Posted: Tue Oct 30, 2012 11:37 am
by guppy_rules
With single quotes we have the same problem:

COMMAND: /usr/local/nagios/libexec/check_nrpe -H sede0035.ede.nl -p 5666 -c check_eventlog -a 'file=System filter generated=\>1h filter eventType==warning MaxWarn=1 MaxCrit=1'
OUTPUT: Unknown argument: generated

Without quotes:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H sede0035.ede.nl -p 5666 -c check_eventlog -a file=System filter generated=\>1h filter eventType==warning MaxWarn=1 MaxCrit=1
OUTPUT: No filters specified try adding: filter+generated=>2d

Re: Problem with service check Nagios 2012R1.1

Posted: Wed Oct 31, 2012 9:25 am
by mguthrie
Oh, try setting up the command the way that worked from the command-line and see if the check runs properly once the configuration is Applied. It's possible there's an escaping bug with the command test from the UI.

Re: Problem with service check Nagios 2012R1.1

Posted: Thu Nov 01, 2012 4:03 am
by guppy_rules
Yes the command works when we did an apply. So it's only the test that failed.

Thanks.