Unknown command: $ in using check_eventlog with check_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.
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

Unknown command: $ in using check_eventlog with check_nrpe

Post by raydx »

I'm having an issue with check_eventlog with check_nrpe. The Nagios console displays:
Unknown command(s): $

From nagios.log:
[1544688000] CURRENT SERVICE STATE: per320-01;Applications errors;UNKNOWN;HARD;3;Unknown command(s): $

Service I'm using:
define service{
use generic-service
host_name per320-01,per320-02,svicsdlver01,svicsdlver03,svicsdlver04,
service_description Applications errors
check_command check_nrpe!check_eventlog -a "filter=provider = 'Application Error' and id = 1000 and message like 'Spacelabs.SLNIService.exe'"
}

nrpe.cfg and commands.cfg are attached.

Thanks!
Attachments
commands.cfg
(7.85 KiB) Downloaded 369 times
nrpe.cfg
(12.18 KiB) Downloaded 374 times
danjoh
Posts: 73
Joined: Mon Dec 07, 2015 10:43 am
Location: Zürich, Switzerland
Contact:

Re: Unknown command: $ in using check_eventlog with check_nr

Post by danjoh »

In commands.cfg you have

Code: Select all

# 'check_nrpe' command definition
define command{
	command_name    check_nrpe
	command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -t 120 -c $ARGS$
	}
I think that should be:

Code: Select all

# 'check_nrpe' command definition
define command{
	command_name    check_nrpe
	command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -t 120 -c $ARG1$ -a $ARG2$
	}
and the check should look like this:

Code: Select all

define service{
        use generic-service
        host_name per320-01,per320-02,svicsdlver01,svicsdlver03,svicsdlver04,
        service_description Applications errors
        check_command check_nrpe!check_eventlog!"filter=provider = 'Application Error' and id = 1000 and message like 'Spacelabs.SLNIService.exe'"
}
And looking through your nrpe.cfg I do not see any command definition for "check_eventlog" .
--
D/\N
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Unknown command: $ in using check_eventlog with check_nr

Post by scottwilkerson »

In addition to what @danjoh mentioned about the service definition, the service you have defined looks like something you would be running against a windows machine running nsclient++

Can you share the nsclient.ini from the windows machine?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

Re: Unknown command: $ in using check_eventlog with check_nr

Post by raydx »

Thank you @danjoh and @scottwilkerson for your assistance.

I up-dated commands.cfg and ICS.cfg. NRPE Plugin for Nagios is now displayed.

/usr/local/nagios/libexec does not contain check_eventlog

nsclient.ini is attached.
Attachments
nsclient.ini
(1.56 KiB) Downloaded 515 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Unknown command: $ in using check_eventlog with check_nr

Post by scottwilkerson »

raydx wrote:I up-dated commands.cfg and ICS.cfg. NRPE Plugin for Nagios is now displayed.
Is it now working as expected?
raydx wrote:/usr/local/nagios/libexec does not contain check_eventlog
It would not be in /usr/local/nagios/libexec, it is part of nsclient++
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

Re: Unknown command: $ in using check_eventlog with check_nr

Post by raydx »

It is not working as expected.

What should I check on the windows machine that has NSClient++?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Unknown command: $ in using check_eventlog with check_nr

Post by scottwilkerson »

After making the change to the commands.cfg did you restart nagios?

what error are you getting in the UI after that? before it was this which was related to the error in the check_nrpe command

Code: Select all

Unknown command(s): $
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

Re: Unknown command: $ in using check_eventlog with check_nr

Post by raydx »

After making the changes to commands.cfg and ICS.cfg, nagios was re-started and
NRPE Plugin for Nagios was displayed in the Nagios console.

I reverted the changes and Unknown command(s): $ is displayed for all the check_eventlogs.

In checking the web for solutions, I did see that someone ran in
/usr/local/nagios/libexec$ ./check_nrpe - H 10.11.96.130 -t 30 -c check_event_log -a "file=security" "filetr=written 1t -2d" and NRPE: Command 'check_event_log' not defined is returned.

I am having difficulty with getting the correct command for nrpe.cfg.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Unknown command: $ in using check_eventlog with check_nr

Post by scottwilkerson »

Please show in your next post what you have configured for check_nrpe in the GUI

Also, the command you were trying to run before is different than what you are trying to run now from the CLI, try

Code: Select all

./check_nrpe - H 10.11.96.130 -t 30 -c check_eventlog -a "filter=provider = 'Application Error' and id = 1000 and message like 'Spacelabs.SLNIService.exe'" 
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

Re: Unknown command: $ in using check_eventlog with check_nr

Post by raydx »

In re to "what you have configured for check_nrpe in the GUI", which file are you referring to?

In the CLI, in /usr/local/nagios/libexec$, I ran the command and CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
Locked