systemctl enable nrpe.service Failed to execute operation

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kaushalshriyan
Posts: 119
Joined: Fri May 22, 2015 7:12 am

systemctl enable nrpe.service Failed to execute operation

Post by kaushalshriyan »

Hi,

I have installed nrpe 3.0 on CentOS Linux release 7.2.1511 (Core)
[root@~]# cat /etc/init/nrpe.conf
# nrpe - the Nagios Remote Plugin Executor
#
# nrpe is a program that runs plugins on this host
# and reports the results back to a nagios server
#
# Copyright (c) 2016 Nagios(R) Core(TM) Development Team
description "the Nagios Remote Plugin Executor"
oom -10
start on started network
stop on runlevel [!2345]
respawn
exec /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
[root@~]# rpm -qa | grep nrpe
nrpe-3.0-1.x86_64
nrpe-plugin-3.0-1.x86_64
[root@~]# rpm -qa | grep nagios
nagios-plugins-2.2.0-1.x86_64
[root@~]# rpm -qil nrpe-3.0-1.x86_64
Name : nrpe
Version : 3.0
Release : 1
Architecture: x86_64
Install Date: Wed Mar 22 15:35:18 2017
Group : Application/System
Size : 119087
License : GPL
Signature : (none)
Source RPM : nrpe-3.0-1.src.rpm
Build Date : Tue Aug 23 20:58:15 2016
Build Host : app02.helpchat.in
Relocations : /usr /etc/init /etc/nagios
URL : http://www.nagios.org
Summary : Host/service/network monitoring agent for Nagios
Description :
NPRE (Nagios Remote Plugin Executor) is a system daemon that
will execute various Nagios plugins locally on behalf of a
remote (monitoring) host that uses the check_nrpe plugin.
Various plugins that can be executed by the daemon are available
at: http://sourceforge.net/projects/nagiosplug
This package provides the client-side NRPE agent (daemon).
/etc/init/nrpe.conf
/etc/nagios
/etc/nagios/nrpe.cfg
/usr/sbin/nrpe
/usr/sbin/nrpe-uninstall
/usr/share/doc/nrpe-3.0
/usr/share/doc/nrpe-3.0/Changelog
/usr/share/doc/nrpe-3.0/LEGAL
/usr/share/doc/nrpe-3.0/README.SSL.md
/usr/share/doc/nrpe-3.0/README.md
/usr/share/doc/nrpe-3.0/SECURITY.md
[root@~]# rpm -qil nrpe-plugin-3.0-1.x86_64
Name : nrpe-plugin
Version : 3.0
Release : 1
Architecture: x86_64
Install Date: Wed Mar 22 15:35:17 2017
Group : Application/System
Size : 64450
License : GPL
Signature : (none)
Source RPM : nrpe-3.0-1.src.rpm
Build Date : Tue Aug 23 20:58:15 2016
Build Host : app02.helpchat.in
Relocations : /usr /etc/init /etc/nagios
URL : http://www.nagios.org
Summary : Provides nrpe plugin for Nagios.
Description :
NPRE (Nagios Remote Plugin Executor) is a system daemon that
will execute various Nagios plugins locally on behalf of a
remote (monitoring) host that uses the check_nrpe plugin.
Various plugins that can be executed by the daemon are available
at: http://sourceforge.net/projects/nagiosplug
This package provides the server-side NRPE plugin for
Nagios-related applications.
/usr/lib/nagios/plugins
/usr/lib/nagios/plugins/check_nrpe
/usr/share/doc/nrpe-plugin-3.0
/usr/share/doc/nrpe-plugin-3.0/Changelog
/usr/share/doc/nrpe-plugin-3.0/LEGAL
/usr/share/doc/nrpe-plugin-3.0/README.md
[root@~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@~]#
[root@~]# systemctl enable nrpe.service
Failed to execute operation: No such file or directory
[root@~]# service nrpe status
Redirecting to /bin/systemctl status nrpe.service
● nrpe.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
[root@~]#
I am not seeing the nrpe service when i run command #systemctl list-unit-files | grep nrpe on CentOS Linux release 7.2.1511 (Core)

Any help will be highly appreciable. Thanks in Advance.

Regards,

Kaushal
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: systemctl enable nrpe.service Failed to execute operatio

Post by cdienger »

The systemd unit file can be found in the nrpe-3.0.1/startup directory of the nrpe tarball(https://github.com/NagiosEnterprises/nr ... 0.1.tar.gz). On my system it is under /tmp/nrpe-3.0.1/startup/default-service. Copy this file to the /etc/systemd/system/ directory with:

cp /tmp/nrpe-3.0.1/startup/default-service /etc/systemd/system/nrpe.service

change permissions with:

chmod 644 /etc/systemd/system/nrpe.service
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kaushalshriyan
Posts: 119
Joined: Fri May 22, 2015 7:12 am

Re: systemctl enable nrpe.service Failed to execute operatio

Post by kaushalshriyan »

Hi cdienger,

I followed the below steps.
[root@~]#cd /tmp/nrpe-3.0.1/startup/
[root@~]# ll
total 76
-rw-rw-r-- 1 root root 1263 Sep 8 2016 bsd-init.in
-rw-rw-r-- 1 root root 1070 Sep 8 2016 debian-init.in
-rw-rw-r-- 1 root root 324 Sep 8 2016 default-inetd.in
-rw-rw-r-- 1 root root 3190 Sep 8 2016 default-init.in
-rw-rw-r-- 1 root root 608 Sep 8 2016 default-service.in
-rw-rw-r-- 1 root root 404 Sep 8 2016 default-socket-svc.in
-rw-rw-r-- 1 root root 224 Sep 8 2016 default-socket.in
-rw-rw-r-- 1 root root 424 Sep 8 2016 default-xinetd.in
-rw-rw-r-- 1 root root 920 Sep 8 2016 mac-inetd.plist.in
-rw-rw-r-- 1 root root 754 Sep 8 2016 mac-init.plist.in
-rw-rw-r-- 1 root root 660 Sep 8 2016 newbsd-init.in
-rw-rw-r-- 1 root root 228 Sep 8 2016 openbsd-init.in
-rw-rw-r-- 1 root root 202 Sep 8 2016 openrc-conf.in
-rw-rw-r-- 1 root root 976 Sep 8 2016 openrc-init.in
-rw-rw-r-- 1 root root 376 Sep 8 2016 rh-upstart-init.in
-rw-rw-r-- 1 root root 2195 Sep 8 2016 solaris-inetd.xml.in
-rw-rw-r-- 1 root root 3191 Sep 8 2016 solaris-init.xml.in
-rw-rw-r-- 1 root root 91 Sep 8 2016 tmpfile.conf.in
-rw-rw-r-- 1 root root 454 Sep 8 2016 upstart-init.in
[root@~]#cp /tmp/nrpe-3.0.1/startup/default-service.in /etc/systemd/system/nrpe.service
[root@~]# systemctl status nrpe.service -l
● nrpe.service - Nagios Remote Program Executor
Loaded: error (Reason: Invalid argument)
Active: inactive (dead)
Docs: http://www.nagios.org/documentation

Mar 23 23:17:25 int-02.ttelchat.in systemd[1]: [/etc/systemd/system/nrpe.service:14] Not an absolute path, ignoring: @piddir@/nrpe.pid
Mar 23 23:17:25 int-02.ttelchat.in systemd[1]: [/etc/systemd/system/nrpe.service:17] Executable path is not absolute, ignoring: @sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -f
Mar 23 23:17:25 int-02.ttelchat.in systemd[1]: nrpe.service lacks both ExecStart= and ExecStop= setting. Refusing.
Mar 23 23:17:25 int-02.ttelchat.in systemd[1]: [/etc/systemd/system/nrpe.service:14] Not an absolute path, ignoring: @piddir@/nrpe.pid
Mar 23 23:17:25 int-02.ttelchat.in systemd[1]: [/etc/systemd/system/nrpe.service:17] Executable path is not absolute, ignoring: @sbindir@/nrpe -c @pkgsysconfdir@/nrpe.cfg -f
Mar 23 23:17:25 int-02.ttelchat.in systemd[1]: nrpe.service lacks both ExecStart= and ExecStop= setting. Refusing.
Warning: nrpe.service changed on disk. Run 'systemctl daemon-reload' to reload units.
[root@~]#
cat /etc/systemd/system/nrpe.service
[Unit]
Description=Nagios Remote Program Executor
Documentation=http://www.nagios.org/documentation
After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
Before=getty@tty1.service plymouth-quit.service xdm.service
Conflicts=nrpe.socket

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
Restart=on-abort
PIDFile=/var/run/nrpe.pid
RuntimeDirectory=nrpe
RuntimeDirectoryMode=0755
ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
ExecStopPost=/bin/rm -f /var/run/nrpe.pid
TimeoutStopSec=60
User=@nrpe_user@
Group=@nrpe_group@
PrivateTmp=true
OOMScoreAdjust=-500
[root@~]#
Please do let me know if you need any additional details.

Regards,

Kaushal
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: systemctl enable nrpe.service Failed to execute operatio

Post by cdienger »

There are two similar files found in the startup directory; default-service.in and default-service. You copied the default-service.in file when you should have copied the default-service file.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked