Check NRPE Services. OK in Shell and Wrong in Nagios

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Check NRPE Services. OK in Shell and Wrong in Nagios

Postby dliberal » Mon Jan 07, 2019 11:08 am

I have a problem in Nagios Core when I try to monitor Services.

In Linux shell these comands works OK

./check_nrpe -H x.x.x.x -n -c checkservicestate -a CheckAll exclude=SysmonLog
Ok: All 118 service(s) are ok.

./check_nrpe -H x.x.x.x -n -c check_service -a "filter=start_type = 'auto' and name not in ('SysmonLog')"

Ok: All 118 service(s) are ok.

But in Nagios when I try these commands, they show a CRITICAL Alarm

check_command check_nrpe!checkservicestate! -a CheckAll exclude=SysmonLog

CRITICAL: SysmonLog stopped delayed ()

check_command check_nrpe!check_service! -a "filter=start_type = 'auto' and name not in ('SysmonLog')"[/b]
CRITICAL: SysmonLog stopped delayed ()

I do not know what I'm doing wrong, I do not understand.

Please I need help. I'm desperate
dliberal
 
Posts: 5
Joined: Mon Jan 07, 2019 10:39 am

Re: Check NRPE Services. OK in Shell and Wrong in Nagios

Postby mcapra » Mon Jan 07, 2019 11:22 am

Can you share your Nagios command definition for the check_nrpe command?
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3513
Joined: Thu May 05, 2016 3:54 pm

Re: Check NRPE Services. OK in Shell and Wrong in Nagios

Postby dliberal » Mon Jan 07, 2019 11:54 am

In commands.cfg file

define command{
command_name check_nrpe
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 60 -n
}

In windows.cfg file

define service {
host_name MyServer
service_description Automatic Services
check_command check_nrpe!checkservicestate! -a CheckAll exclude=SysmonLog
#check_command check_nrpe!check_service!-a "filter=start_type = 'auto' and name not in ('SysmonLog')" exclude=SysmonLog

max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

I thought that maybe it could be due to an argument problem, but I discard it since this command works correctly.

define service {
host_name MyServer
service_description Disk Use
check_command check_nrpe!check_drivesize! "crit=free<10%" "warn=free<20%" drive=c:
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
dliberal
 
Posts: 5
Joined: Mon Jan 07, 2019 10:39 am

Re: Check NRPE Services. OK in Shell and Wrong in Nagios

Postby npolovenko » Mon Jan 07, 2019 4:07 pm

@dliberal, Can you wrap the whole argument in double quotes inside the Nagios command?
check_command check_nrpe!checkservicestate! -a "CheckAll exclude=SysmonLog"

Restart the nagios service with:
service nagios restart

And let me know if the check works in the GUI.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 2846
Joined: Mon May 15, 2017 5:00 pm

Re: Check NRPE Services. OK in Shell and Wrong in Nagios

Postby dliberal » Mon Jan 07, 2019 4:38 pm

I tried

check_command check_nrpe!checkservicestate! -a "CheckAll exclude=SysmonLog"

but it still does not work
dliberal
 
Posts: 5
Joined: Mon Jan 07, 2019 10:39 am

Re: Check NRPE Services. OK in Shell and Wrong in Nagios

Postby npolovenko » Mon Jan 07, 2019 4:42 pm

@dliberal, Can you upload the status.dat file or send it to me in a PM?
/usr/local/nagios/var/status.dat
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 2846
Joined: Mon May 15, 2017 5:00 pm

Re: Check NRPE Services. OK in Shell and Wrong in Nagios

Postby dliberal » Mon Jan 07, 2019 11:34 pm

In /usr/local/nagios/var/status.dat file it shows:

plugin_output=CRITICAL: SysmonLog=stopped (auto), delayed ()
dliberal
 
Posts: 5
Joined: Mon Jan 07, 2019 10:39 am

Re: Check NRPE Services. OK in Shell and Wrong in Nagios

Postby dliberal » Mon Jan 07, 2019 11:50 pm

I have changed in Windows the service from "Automatic" to "Manual" and then the output is:

OK: All 119 service(s) are ok.

It seems that the "exclude = SysmonLog" argument does not work

I do not know if there is a problem changing the service from automatic to manual in Windows
dliberal
 
Posts: 5
Joined: Mon Jan 07, 2019 10:39 am

Re: Check NRPE Services. OK in Shell and Wrong in Nagios

Postby npolovenko » Tue Jan 08, 2019 4:01 pm

@dliberal, Change the nrpe command like this and try again:
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ -t 60 -n

And as for the service command, try with double quotes and without:
check_command check_nrpe!checkservicestate! -a "CheckAll exclude=SysmonLog"

And without:
check_command check_nrpe!checkservicestate! -a CheckAll exclude=SysmonLog
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 2846
Joined: Mon May 15, 2017 5:00 pm


Return to Nagios Core

Who is online

Users browsing this forum: Google [Bot], rfaraci and 47 guests