Bug 1204683 - check_ide_smart cannot be started by nrpe
Summary: check_ide_smart cannot be started by nrpe
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nagios-plugins
Version: 25
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Scott Wilkerson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-23 11:14 UTC by Christian Kujau
Modified: 2017-11-16 16:52 UTC (History)
8 users (show)

Fixed In Version: nagios-plugins-2.2.1-3git.fc24 nagios-plugins-2.2.1-4git.fc26 nagios-plugins-2.2.1-4git.el7 nagios-plugins-2.2.1-3git.fc25 nagios-plugins-2.2.1-4git.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-09 15:22:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Christian Kujau 2015-03-23 11:14:05 UTC
Description of problem:

/usr/lib/nagios/plugins/check_ide_smart is SUID root (see bug 251635) which is good, since it does not need "sudo" any more to be executed. However, the NRPE daemon is unable to run check_ide_smart because NRPE is running as nrpe:nrpe

 # grep ^nrpe_ /etc/nagios/nrpe.cfg
 nrpe_user=nrpe
 nrpe_group=nrpe

 # ls -l /usr/lib/nagios/plugins/check_ide_smart
 -rwsr-x---+ 1 root nagios 44720 Jun  7  2014 /usr/lib/nagios/plugins/check_ide_smart

There are several ways to tackle this:

1) Allow check_ide_smart to be started by "nrpe":
   # setfacl -m u:nrpe:rx /usr/lib/nagios/plugins/check_ide_smart

2) Add "nrpe" to the "nagios" group:
   # usermod -a -G nagios nrpe

3) Run NRPE as nrpe:nagios (with nrpe_group=nagios in nrpe.cfg)

Interestingly, check_ide_smart seems to be the only script belonging to the "nagios" group on this system:

# find / -xdev -user nrpe -o -user nagios -o -group nrpe -o -group nagios | xargs ls -ld
-rwsr-x---+ 1 root   nagios 44720 Jun  7  2014 /usr/lib/nagios/plugins/check_ide_smart
drwxr-xr-x. 2 nagios nagios     6 Mar 19 22:45 /var/spool/nagios

# rpm -qa | grep nagios
nagios-plugins-sensors-2.0.1-2.fc21.i686
nagios-plugins-users-2.0.1-2.fc21.i686
nagios-plugins-disk-2.0.1-2.fc21.i686
nagios-common-3.5.1-5.fc21.i686
nagios-plugins-2.0.1-2.fc21.i686
nagios-plugins-load-2.0.1-2.fc21.i686
nagios-plugins-procs-2.0.1-2.fc21.i686
nagios-plugins-check-updates-1.6.9-1.fc21.i686
nagios-plugins-tcp-2.0.1-2.fc21.i686
nagios-plugins-ssh-2.0.1-2.fc21.i686
nagios-plugins-ide_smart-2.0.1-2.fc21.i686
nagios-plugins-ntp-2.0.1-2.fc21.i686
nagios-plugins-swap-2.0.1-2.fc21.i686


Version-Release number of selected component (if applicable):

# rpm -q nrpe
nrpe-2.15-4.fc21.i686


How reproducible:

Always.

Steps to Reproduce:
1. Install nrpe & nagios-plugins-ide_smart
2. Configure check_ide_smart in nrpe.cfg, e.g.:
   command[check_smart_sda]=/usr/lib/nagios/plugins/check_ide_smart -d /dev/sda
3. Call check_ide_smart via nrpe

Actual results:

  NRPE: Unable to read output

Expected results:

  OK - Operational (17/17 tests passed)

Additional info:

Comment 1 Fedora Admin XMLRPC Client 2015-08-31 15:11:06 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 2 Fedora Admin XMLRPC Client 2015-08-31 15:16:09 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Scott Wilkerson 2015-09-18 21:33:55 UTC
I'm thinking that the best solution here may be to change this bug to actually take place in nrpe package.

I am of the opinion that it would be the least intrusive to add the following to the %post in the nrpe package.

%{_sbindir}/usermod -a -G nagios %{name} || :


My thinking is that nrpe requires nagios-common which ensures that the nagios group exists on the system.

Thoughts?

Comment 4 Fedora End Of Life 2015-11-04 15:50:54 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Mike McCune 2016-03-28 23:38:32 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 Christian Kujau 2016-03-29 01:44:38 UTC
Unfixed in F23:

$ dnf install nrpe nagios-plugins-ide_smart
$ ls -l /usr/lib/nagios/plugins/check_ide_smart
-rwsr-x---. 1 root nagios 48872 Sep 11  2015 /usr/lib/nagios/plugins/check_ide_smart

$ grep nrpe_ /etc/nagios/nrpe.cfg; id nrpe
nrpe_user=nrpe
nrpe_group=nrpe
uid=989(nrpe) gid=986(nrpe) groups=986(nrpe)

$ systemctl start nrpe
$ ps -o pid,euid,egid,uid,gid,cmd -p `pgrep nrpe`
  PID  EUID  EGID   UID   GID CMD
  956   989   986   989   986 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d

=> nrpe will not be able to execute check_ide_smart:

$ sudo -u nrpe /usr/lib/nagios/plugins/check_ide_smart
sudo: unable to execute /usr/lib/nagios/plugins/check_ide_smart: Permission denied

The proposed workarounds from above still apply.

Comment 7 Fedora End Of Life 2016-11-24 11:36:06 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Stephen John Smoogen 2017-07-03 23:16:30 UTC
Please check with the current version of the package. The RPM does not set the group to being nagios and has the permissions of the plugin to be 0755 so it should be usable.

Comment 9 Fedora Update System 2017-07-04 17:20:21 UTC
nagios-plugins-2.2.1-2git.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4337b54215

Comment 10 Christian Kujau 2017-07-10 19:44:56 UTC
After uninstalling nrpe and all nagios-plugin packages and then reinstalling, the check_ide_smart script is still owned by root:nagios while NRPE runs as nrpe:nrpe per default:


$ rpm -qf /usr/lib64/nagios/plugins/check_ide_smart 
nagios-plugins-ide_smart-2.2.1-1.fc25.x86_64

$ ls -l /usr/lib64/nagios/plugins/check_ide_smart 
-rwsr-x---. 1 root nagios 49784 Apr 20 16:47 /usr/lib64/nagios/plugins/check_ide_smart

$ ps -fp `pgrep nrpe`
UID        PID  PPID  C STIME TTY          TIME CMD
nrpe      2757     1  0 12:34 ?        00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f -n

$ sudo -u nrpe /usr/lib64/nagios/plugins/check_ide_smart -d /dev/sda
sudo: unable to execute /usr/lib64/nagios/plugins/check_ide_smart: Permission denied


Workaround:


$ sudo chgrp -c nrpe /usr/lib64/nagios/plugins/check_ide_smart
$ sudo chmod u+s /usr/lib64/nagios/plugins/check_ide_smart
$ sudo -u nrpe /usr/lib64/nagios/plugins/check_ide_smart -d /dev/sda
OK - Operational (17/17 tests passed)

Comment 11 Stephen John Smoogen 2017-07-10 20:32:50 UTC
OK I was an idiot when I looked at the spec file before. I mean how could I miss this part.

%files dhcp                                                                                                                                                                  
%defattr(4750,root,nagios,-)                                                                                                                                                 
%{_libdir}/nagios/plugins/check_dhcp                                                                                                                                         

%files fping                                                                                                                                                                 
%defattr(4750,root,nagios,-)                                                                                                                                                 
%{_libdir}/nagios/plugins/check_fping                                                                                                                                        

%files icmp                                                                                                                                                                  
%defattr(4750,root,nagios,-)                                                                                                                                                 
%{_libdir}/nagios/plugins/check_icmp                                                                                                                                         

%files ide_smart                                                                                                                                                             
%defattr(4750,root,nagios,-)                                                                                                                                                 
%{_libdir}/nagios/plugins/check_ide_smart                                                                                                                                    

I think those are the setuid packages which are wanted to be restricted down since they might blow up. 

So I am going to check with security but I believe the fix from upstream of putting the nrpe group in the nagios group is the easiest fix.

Comment 12 Fedora Update System 2017-07-11 19:26:16 UTC
nrpe-3.1.1-6.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d9a7b840d8

Comment 13 Fedora Update System 2017-07-12 15:52:46 UTC
nrpe-3.1.1-6.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-9d9d9c0909

Comment 14 Fedora Update System 2017-07-12 16:24:32 UTC
nrpe-3.1.1-6.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ec253d8f54

Comment 15 Fedora Update System 2017-07-12 18:21:56 UTC
nrpe-3.1.1-6.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-d9a7b840d8

Comment 16 Fedora Update System 2017-07-12 20:30:19 UTC
nagios-plugins-2.2.1-3git.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-76229ef8c9

Comment 17 Fedora Update System 2017-07-13 01:45:52 UTC
nrpe-3.1.1-6.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-18adf0fe26

Comment 18 Fedora Update System 2017-07-13 01:50:04 UTC
nrpe-3.1.1-6.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-1f50be4847

Comment 19 Fedora Update System 2017-07-13 19:48:57 UTC
nagios-plugins-2.2.1-3git.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-76229ef8c9

Comment 20 Fedora Update System 2017-07-13 19:50:34 UTC
nagios-plugins-2.2.1-3git.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-4b1c55c024

Comment 21 Fedora Update System 2017-07-13 21:21:25 UTC
nagios-plugins-2.2.1-3git.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-6401b28fc4

Comment 22 Fedora Update System 2017-07-13 21:23:44 UTC
nagios-plugins-2.2.1-3git.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-8d031793bf

Comment 23 Fedora Update System 2017-07-13 23:53:53 UTC
nagios-plugins-2.2.1-3git.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a5f81422dc

Comment 24 Fedora Update System 2017-07-14 18:57:50 UTC
nagios-plugins-2.2.1-4git.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c2e82de3b3

Comment 25 Fedora Update System 2017-07-14 21:35:13 UTC
nrpe-3.2.0-1git.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-487a01f0be

Comment 26 Fedora Update System 2017-07-14 22:26:36 UTC
nrpe-3.2.0-2git.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b30a5177e7

Comment 27 Fedora Update System 2017-07-16 21:21:04 UTC
nagios-plugins-2.2.1-4git.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c2e82de3b3

Comment 28 Fedora Update System 2017-07-16 21:22:01 UTC
nrpe-3.2.0-2git.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-b30a5177e7

Comment 29 Fedora Update System 2017-07-19 19:39:18 UTC
nrpe-3.2.0-3.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-47d1a274d4

Comment 30 Fedora Update System 2017-07-21 01:22:07 UTC
nrpe-3.2.0-3.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-47d1a274d4

Comment 31 Fedora Update System 2017-07-23 04:18:06 UTC
nagios-plugins-2.2.1-4git.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-8973027f42

Comment 32 Fedora Update System 2017-07-23 04:22:57 UTC
nagios-plugins-2.2.1-4git.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-87ebfdc686

Comment 33 Fedora Update System 2017-07-23 21:50:32 UTC
nrpe-3.1.1-6.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 34 Fedora Update System 2017-07-23 21:50:58 UTC
nagios-plugins-2.2.1-3git.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 35 Fedora Update System 2017-07-23 22:54:04 UTC
nrpe-3.1.1-6.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 36 Fedora Update System 2017-08-03 15:52:37 UTC
nagios-plugins-2.2.1-4git.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 37 Fedora Update System 2017-08-04 20:18:25 UTC
nrpe-3.2.0-6.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-030b96c51c

Comment 38 Fedora Update System 2017-08-07 02:48:59 UTC
nrpe-3.2.0-6.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-bb989d629b

Comment 39 Fedora Update System 2017-08-07 07:49:16 UTC
nrpe-3.2.0-6.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-030b96c51c

Comment 40 Fedora Update System 2017-08-09 15:22:36 UTC
nagios-plugins-2.2.1-4git.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 41 Fedora Update System 2017-08-09 15:53:57 UTC
nrpe-3.2.0-3.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 42 Fedora Update System 2017-08-09 19:56:53 UTC
nagios-plugins-2.2.1-3git.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 43 Fedora Update System 2017-08-10 06:19:36 UTC
nagios-plugins-2.2.1-4git.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 44 Fedora Update System 2017-11-16 15:47:34 UTC
nrpe-3.2.0-6.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 45 Fedora Update System 2017-11-16 16:52:44 UTC
nrpe-3.2.0-6.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.