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
Check NRPE Services. OK in Shell and Wrong in Nagios
Re: Check NRPE Services. OK in Shell and Wrong in Nagios
Can you share your Nagios command definition for the check_nrpe command?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Check NRPE Services. OK in Shell and Wrong in Nagios
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
}
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
}
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Check NRPE Services. OK in Shell and Wrong in Nagios
@dliberal, Can you wrap the whole argument in double quotes inside the Nagios command?
Restart the nagios service with:check_command check_nrpe!checkservicestate! -a "CheckAll exclude=SysmonLog"
And let me know if the check works in the GUI.service nagios restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Check NRPE Services. OK in Shell and Wrong in Nagios
I tried
check_command check_nrpe!checkservicestate! -a "CheckAll exclude=SysmonLog"
but it still does not work
check_command check_nrpe!checkservicestate! -a "CheckAll exclude=SysmonLog"
but it still does not work
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Check NRPE Services. OK in Shell and Wrong in Nagios
@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.
Re: Check NRPE Services. OK in Shell and Wrong in Nagios
In /usr/local/nagios/var/status.dat file it shows:
plugin_output=CRITICAL: SysmonLog=stopped (auto), delayed ()
plugin_output=CRITICAL: SysmonLog=stopped (auto), delayed ()
Re: Check NRPE Services. OK in Shell and Wrong in Nagios
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
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
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Check NRPE Services. OK in Shell and Wrong in Nagios
@dliberal, Change the nrpe command like this and try again:
And as for the service command, try with double quotes and without:command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ -t 60 -n
And without:check_command check_nrpe!checkservicestate! -a "CheckAll exclude=SysmonLog"
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.