Last active
August 6, 2018 09:09
-
-
Save kcleong/701672e70744893e5af26b6e37d8b802 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uninstall old NRPE (v 2.15) | |
apt remove -y nagios-nrpe-server | |
# Install NRPE 3.2.1 in /usr/local/nagios | |
apt install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget | |
cd /tmp | |
wget --no-check-certificate -O nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.1.tar.gz | |
tar xzf nrpe.tar.gz | |
cd /tmp/nrpe-nrpe-3.2.1/ | |
./configure --enable-command-args --with-ssl-lib=/usr/lib/x86_64-linux-gnu/ | |
make all | |
make install | |
make install-config | |
make install-init | |
systemctl enable nrpe.service | |
sh -c "sed -i '/^allowed_hosts=/s/$/,88.80.190.194/' /usr/local/nagios/etc/nrpe.cfg" | |
printf "Nagios NRPE is installed from source, the config here is not active anymore.\n\nInstead see:\n\n /usr/local/nagios/etc/\n\nMore info on wiki: https://wiki.pythonunited.com/wiki/inrichten-hosting/#wiki-toc-nagios" > /etc/nagios/README.txt | |
systemctl start nrpe.service | |
# Install NRPE plugins | |
apt install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext | |
cd /tmp | |
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.1.tar.gz | |
tar zxf nagios-plugins.tar.gz | |
cd /tmp/nagios-plugins-release-2.2.1/ | |
./tools/setup | |
./configure | |
make | |
make install | |
echo "Almost done, copy commands from /etc/nagios/nrpe_local.cfg to /usr/local/nagios/etc/nrpe.cfg" | |
echo "Restart NRPE afterwards using: systemctl restart nrpe.service" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment