Install the Nagios NCPA Agent
The Nagios Cross-Platform Agent (NCPA) runs on monitored hosts and exposes metrics to the Nagios server. The steps below install NCPA on CentOS 7 and Ubuntu 16/18/20.
Open the required firewall port
sudo firewall-cmd --permanent --add-port=5693/tcp
sudo firewall-cmd --reload
Install on CentOS 7
rpm -Uvh https://repo.nagios.com/nagios/7/nagios-repo-7-4.el7.noarch.rpm
yum install ncpa -y
systemctl enable ncpa_listener ncpa_passive
systemctl start ncpa_listener ncpa_passive
Install on Ubuntu 18.04 / 20.04
wget -qO - https://repo.nagios.com/GPG-KEY-NAGIOS-V2 | sudo apt-key add -
echo "deb https://repo.nagios.com/deb/bionic ./" | sudo tee /etc/apt/sources.list.d/nagios.list
sudo apt-get update
sudo apt-get install ncpa -y
Install on Ubuntu 16.04
wget -qO - https://repo.nagios.com/GPG-KEY-NAGIOS-V2 | sudo apt-key add -
echo "deb https://repo.nagios.com/deb/xenial ./" | sudo tee /etc/apt/sources.list.d/nagios.list
sudo apt-get update
sudo apt-get install ncpa -y
Configure the NCPA token
Edit /usr/local/ncpa/etc/ncpa.cfg and set a strong community token:
[api]
community_string = your-secret-token
sudo systemctl restart ncpa_listener
Test the agent
curl "https://AGENT_IP:5693/api?token=your-secret-token" -k