NRPE - How To Uninstall NRPE


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.

 
Warning

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.

 
Nagios XI

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:

 

 

 

RHEL | CentOS | Oracle Linux

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

Warning

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.

 

 

 

Ubuntu

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

Warning

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.

 

 

 

SUSE SLES | openSUSE Leap

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

Warning

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.

 

 

 

Debian | Raspbian

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

Warning

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.

 

 

 

Fedora

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

Warning

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.

 

 

Arch Linux

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

Warning

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.

 

 

 

Gentoo

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

Warning

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.

 

 

 

FreeBSD

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

Warning

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.

 

 

 

Solaris

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

Warning

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.

 

 

 

Apple OS X

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

Warning

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:

http://support.nagios.com/forum/



Article ID: 741
Created On: Thu, Aug 10, 2017 at 8:05 PM
Last Updated On: Fri, Aug 11, 2017 at 1:02 AM
Authored by: tlea

Online URL: https://support.nagios.com/kb/article/nrpe-how-to-uninstall-nrpe-741.html