Skip to content

Agent Install Guide

Garðar Þorsteinsson edited this page Apr 12, 2024 · 5 revisions

Install NRPE agent on RHEL based distros

sudo rpm -ihv http://opensource.is/repo/ok-release.rpm
sudo yum update -y ok-release
sudo yum install -y nrpe nagios-plugins-load nagios-plugins-procs nagios-plugins-swap
sudo yum --enablerepo=ok-testing install -y nagios-plugins-check_cpu nagios-okconfig-nrpe

export NAGIOS_SERVER='192.168.1.100'
sed -i "/^allowed_hosts=/ s/$/,$NAGIOS_SERVER/" /etc/nagios/nrpe.cfg
sed -i '/^dont_blame_nrpe=/c\dont_blame_nrpe=1' /etc/nagios/nrpe.cfg

sudo systemctl enable nrpe
sudo systemctl restart nrpe

Install NRPE agent on Debian based distros

sudo apt install nagios-nrpe-server nagios-plugins

export NAGIOS_SERVER='192.168.1.100'
sed -i "/^allowed_hosts=/ s/$/,$NAGIOS_SERVER/" /etc/nagios/nrpe.cfg
sed -i '/^dont_blame_nrpe=/c\dont_blame_nrpe=1' /etc/nagios/nrpe.cfg

sudo systemctl restart nagios-nrpe-server
sudo systemctl enable nagios-nrpe-server

Firewall rules examples for NRPE - PORT 5666/TCP

### UFW firewall
# sudo ufw allow 5666/tcp

### Firewalld
# sudo firewall-cmd --add-port=5666/tcp --permanent
# Using rich rule
# sudo firewall-cmd --permanent --add-rich-rule 'rule family="ipv4" source address=$NAGIOS_SERVER service name="nrpe" accept'
# sudo firewall-cmd --reload