Uninstalling NRPE
This document describes how to uninstall NRPE that is installed from source. The installation could have been performed using the linux-nrpe-agent that ships with Nagios xi OR directly from the source files. This KB article does not apply if you have installed NRPE using your operating system (OS) package manager like yum.
The steps in this KB article could lead to unexpected results if you are not familiar with the commands being executed. If you are unsure about the steps being provided it is recommended to seek advice from the Nagios Support Forums before proceeding.
DO NOT follow this procedure on your Nagios xi server! NRPE is a part of Nagios xi and performing the commands in this KB article can result in a broken Nagios xi server.
This guide is broken up into several sections and covers different Linux distributions and non-Linux operating systems.
It is assumed that you are logged onto the machine as the root user, or a user with sufficient privileges. Some OS's like Ubuntu and SUSE have stricter user permissions, in those cases the listed commands have sudo in front of them to ensure you are able to complete the steps. A best effort has been made to ensure if you follow all the relevant steps you will completely remove NRPE.
Please select your OS:
Identify NRPE Daemon
NRPE can be running as a dedicated service or via the xiNETD daemon. You must identify this as the steps to stop and remove the service will be different. To identify if you are using xiNETD execute the following command:
file /etc/xinetd.d/nrpe
This output indicates that you are using xiNETD:
/etc/xinetd.d/nrpe: ASCII text
Follow the xiNETD steps below.
This output indicates that you are NOT using xiNETD and hence must be using a dedicated service:
/etc/xinetd.d/nrpe: cannot open `/etc/xinetd.d/nrpe' (No such file or directory)
Follow the dedicated daemon steps below.
Stop And Remove xiNETD Daemon
Execute these commands to stop xiNETD from running NRPE.
Delete the configuration file:
rm -f /etc/xinetd.d/nrpe
Restart the xiNETD daemon depending on your operating system version:
===== CentOS 5.x / 6x | RHEL 5.x / 6x | Oracle Linux 5.x / 6x =====
service xinetd restart
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl restart xinetd.service
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service, depending on your operating system version:
===== CentOS 5.x | RHEL 5.x | Oracle Linux 5.x =====
service nrpe stop
chkconfig nrpe off
rm -f /etc/init.d/nrpe
===== CentOS 6.x | RHEL 6.x | Oracle Linux 6.x =====
stop nrpe
rm -f /etc/init/nrpe.conf
===== CentOS 7.x | RHEL 7.x | Oracle Linux 7.x =====
systemctl stop nrpe.service
systemctl disable nrpe.service
rm -f /usr/lib/systemd/system/nrpe.service
systemctl daemon-reload
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
rm -f /usr/local/nagios/bin/nrpe*
rm -f /usr/local/nagios/etc/nrpe*
rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
userdel nagios
groupdel nagios
This completes uninstalling NRPE.
Identify NRPE Daemon
NRPE can be running as a dedicated service or via the xiNETD daemon. You must identify this as the steps to stop and remove the service will be different. To identify if you are using xiNETD execute the following command:
file /etc/xinetd.d/nrpe
This output indicates that you are using xiNETD:
/etc/xinetd.d/nrpe: ASCII text
Follow the xiNETD steps below.
This output indicates that you are NOT using xiNETD and hence must be using a dedicated service:
/etc/xinetd.d/nrpe: cannot open `/etc/xinetd.d/nrpe' (No such file or directory)
Follow the dedicated daemon steps below.
Stop And Remove xiNETD Daemon
Execute these commands to stop xiNETD from running NRPE.
Delete the configuration file:
sudo rm -f /etc/xinetd.d/nrpe
Restart the xiNETD daemon depending on your operating system version:
===== Ubuntu 13.x / 14.x =====
sudo service xinetd restart
===== Ubuntu 15.x / 16.x / 17.x =====
sudo systemctl restart xinetd
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service, depending on your operating system version:
===== Ubuntu 13.x / 14.x =====
sudo stop nrpe
sudo rm -f /etc/init/nrpe.conf
===== Ubuntu 15.x / 16.x / 17.x =====
sudo systemctl stop nrpe.service
sudo systemctl disable nrpe.service
sudo rm -f /lib/systemd/system/nrpe.service
sudo systemctl daemon-reload
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
sudo rm -f /usr/local/nagios/bin/nrpe*
sudo rm -f /usr/local/nagios/etc/nrpe*
sudo rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
sudo userdel nagios
sudo groupdel nagios
This completes uninstalling NRPE.
Identify NRPE Daemon
NRPE can be running as a dedicated service or via the xiNETD daemon. You must identify this as the steps to stop and remove the service will be different. To identify if you are using xiNETD execute the following command:
file /etc/xinetd.d/nrpe
This output indicates that you are using xiNETD:
/etc/xinetd.d/nrpe: ASCII text
Follow the xiNETD steps below.
This output indicates that you are NOT using xiNETD and hence must be using a dedicated service:
/etc/xinetd.d/nrpe: cannot open `/etc/xinetd.d/nrpe' (No such file or directory)
Follow the dedicated daemon steps below.
Stop And Remove xiNETD Daemon
Execute these commands to stop xiNETD from running NRPE.
Delete the configuration file:
sudo rm -f /etc/xinetd.d/nrpe
Restart the xiNETD daemon depending on your operating system version:
===== SUSE SLES 11.x =====
sudo /sbin/service xinetd restart
===== SUSE SLES 12.x | openSUSE =====
sudo systemctl restart xinetd
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service, depending on your operating system version:
===== SUSE SLES 11.x =====
sudo /sbin/service nrpe stop
sudo rm -f /etc/init.d/nrpe
===== SUSE SLES 12.x | openSUSE =====
sudo systemctl stop nrpe.service
sudo systemctl disable nrpe.service
sudo rm -f /usr/lib/systemd/system/nrpe.service
sudo systemctl daemon-reload
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
sudo rm -f /usr/local/nagios/bin/nrpe*
sudo rm -f /usr/local/nagios/etc/nrpe*
sudo rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
===== SUSE SLES 11.x =====
sudo /usr/sbin/userdel nagios
sudo /usr/sbin/groupdel nagios
===== SUSE SLES 12.x | openSUSE =====
sudo userdel nagios
sudo groupdel nagios
This completes uninstalling NRPE.
All steps on Debian require to run as root. To become root simply run:
Debian
su
Raspbian
sudo -i
All commands from this point onwards will be as root.
Identify NRPE Daemon
NRPE can be running as a dedicated service or via the xiNETD daemon. You must identify this as the steps to stop and remove the service will be different. To identify if you are using xiNETD execute the following command:
file /etc/xinetd.d/nrpe
This output indicates that you are using xiNETD:
/etc/xinetd.d/nrpe: ASCII text
Follow the xiNETD steps below.
This output indicates that you are NOT using xiNETD and hence must be using a dedicated service:
/etc/xinetd.d/nrpe: cannot open `/etc/xinetd.d/nrpe' (No such file or directory)
Follow the dedicated daemon steps below.
Stop And Remove xiNETD Daemon
Execute these commands to stop xiNETD from running NRPE.
Delete the configuration file:
rm -f /etc/xinetd.d/nrpe
Restart the xiNETD daemon depending on your operating system version:
===== Debian 7.x =====
service xinetd restart
===== Debian 8.x / 9.x =====
systemctl restart xinetd.service
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service, depending on your operating system version:
===== Debian 7.x =====
service nrpe stop
update-rc.d nrpe disable
rm -f /etc/init.d/nrpe
===== Debian 8.x / 9.x =====
systemctl stop nrpe.service
systemctl disable nrpe.service
rm -f /lib/systemd/system/nrpe.service
systemctl daemon-reload
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
rm -f /usr/local/nagios/bin/nrpe*
rm -f /usr/local/nagios/etc/nrpe*
rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
userdel nagios
groupdel nagios
This completes uninstalling NRPE.
Identify NRPE Daemon
NRPE can be running as a dedicated service or via the xiNETD daemon. You must identify this as the steps to stop and remove the service will be different. To identify if you are using xiNETD execute the following command:
file /etc/xinetd.d/nrpe
This output indicates that you are using xiNETD:
/etc/xinetd.d/nrpe: ASCII text
Follow the xiNETD steps below.
This output indicates that you are NOT using xiNETD and hence must be using a dedicated service:
/etc/xinetd.d/nrpe: cannot open `/etc/xinetd.d/nrpe' (No such file or directory)
Follow the dedicated daemon steps below.
Stop And Remove xiNETD Daemon
Execute these commands to stop xiNETD from running NRPE and restart the xiNETD daemon.
rm -f /etc/xinetd.d/nrpe
systemctl restart xinetd.service
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service:
systemctl stop nrpe.service
systemctl disable nrpe.service
rm -f /usr/lib/systemd/system/nrpe.service
systemctl daemon-reload
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
rm -f /usr/local/nagios/bin/nrpe*
rm -f /usr/local/nagios/etc/nrpe*
rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
userdel nagios
groupdel nagios
This completes uninstalling NRPE.
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service:
systemctl stop nrpe.service
systemctl disable nrpe.service
rm -f /usr/lib/systemd/system/nrpe.service
systemctl daemon-reload
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
rm -f /usr/local/nagios/bin/nrpe*
rm -f /usr/local/nagios/etc/nrpe*
rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
userdel nagios
groupdel nagios
This completes uninstalling NRPE.
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service, depending on your operating system init system:
===== init =====
service nrpe stop
rc-update del nrpe default
rm -f /etc/init.d/nrpe
===== systemd =====
systemctl stop nrpe.service
systemctl disable nrpe.service
rm -f /usr/lib/systemd/system/nrpe.service
systemctl daemon-reload
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
rm -f /usr/local/nagios/bin/nrpe*
rm -f /usr/local/nagios/etc/nrpe*
rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
userdel nagios
groupdel nagios
This completes uninstalling NRPE.
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service:
service nrpe stop
sed -i '' '/nrpe start/d' /etc/rc.local
rm -f /etc/rc.d/nrpe
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
rm -f /usr/local/nagios/bin/nrpe*
rm -f /usr/local/nagios/etc/nrpe*
rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
pw user del nagios
pw group del nagios
This completes uninstalling NRPE.
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service:
svcadm disable nrpe
svccfg delete svc:/network/nagios/nrpe:default
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
rm -f /usr/local/nagios/bin/nrpe*
rm -f /usr/local/nagios/etc/nrpe*
rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
userdel nagios
groupdel nagios
This completes uninstalling NRPE.
Stop And Remove Dedicated Daemon
Execute these commands to stop, disable and remove the NRPE service:
sudo launchctl stop org.nagios.nrpe
sudo launchctl remove org.nagios.nrpe
sudo rm -f /Library/LaunchDaemons/org.nagios.nrpe.plist
Delete NRPE Files
These commands will delete the key NRPE files. The commands do not delete any other files such as Nagios Pluigns.
sudo rm -f /usr/local/nagios/bin/nrpe*
sudo rm -f /usr/local/nagios/etc/nrpe*
sudo rm -f /usr/local/nagios/libexec/*nrpe*
Remove User And Group
If you have other Nagios components installed such as Nagios Core you should NOT execute these commands.
These commands will remove the nagios user and group.
sudo dscl localhost delete /Local/Default/Users/nagios
sudo dscl localhost delete /Local/Default/Groups/nagios
This completes uninstalling NRPE.
Final Thoughts
For any support related questions please visit the Nagios Support Forums at: