Hello,
I'm using the check_service plugin which uses systemctl to determine if a service is running or not. When I run the command locally, I get one result. When I run the command using Nagios Core, I get something different.
Here's the output:
ubuntu@ip-redacted:/usr/lib/nagios/plugins$ ./check_service -s [service]
OK: Service [service] is running!
But in the Nagios user interface:
CRITICAL: Service [service] is not running!
It seems so simple yet I have absolutely no idea why it's getting it wrong.
check_service reporting incorrectly in Nagios
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_service reporting incorrectly in Nagios
My guess is that you need to add check_service to the sudoers file for you nrpe user (either nagios or nrpe depending on how you installed)
Then change your check_service command in your nrpe.cfg to call sudo first
such as
This is just an example, your setup/path may vary
Then change your check_service command in your nrpe.cfg to call sudo first
such as
Code: Select all
command[check_service]=sudo /usr/local/nagios/libexec/check_service -s $ARG1$