allow nagios to check service status on Nagios NRPE agent

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

allow nagios to check service status on Nagios NRPE agent

Post by xlin125 »

When installing Nagios NRPE agent to a Linux server (e.g., Red Hat 7, or CentOS 7), the following lines are added to /etc/sudoers:

# NEEDED TO ALLOW NAGIOS TO CHECK SERVICE STATUS
Defaults:nagios !requiretty
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_init_service

This has brought up an issue with the security scan by adding the account "nagios" to /etc/sudoers.

How does this service check work, and how important to allow nagios to check service status? Is it optional or required to run this plugin? If these lines are removed from /etc/sudoers, what would be the possible impact to the nagios agent?
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: allow nagios to check service status on Nagios NRPE agen

Post by jbrunkow »

I believe that the nagios user needs sudoer permissions to check whether the init service is running on a host. You would probably break the ability for NRPE to check whether init is running on the host...

If you would like to see exactly what that a plugin is doing, you can usually just open it in a text editor.

Code: Select all

vi /usr/local/nagios/libexec/check_init_service
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked