NCPA is intended to simplify and universalize agent-based monitoring
across different operating systems.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Nagios queries.
In this context, we shall look into how to Install Nagios NCPA.
Here, you will learn how to install the Nagios Cross Platform Agent (NCPA) on Windows and Linux.
Overview of NCPA Installation
Firstly, we will install NCPA using the ready built packages for the following platforms:
1. Windows
i. EXE Package
2. Linux
i. RHEL/CentOS/Oracle Linux
a. Nagios Repository
b. RPM Package
ii. Ubuntu / Debian
i. DEB Package
Also, we can install NCPA from source.
Active vs Passive
NCPA can be used for both Active and Passive monitoring:
The NCPA installer may prompt for settings for active and passive. Active is the most common method used. If we are not using passive monitoring, then we do not need to configure those settings.
Please visit the downloads page given below to obtain the relevant download package for our operating system (OS):
https://www.nagios.org/ncpa/#downloads
If we are installing NCPA on Linux, then we do not need to download it right now.
The following instructions are for the graphical install of NCPA:
We will need to check the Send passive checks over NRDP box to enable passive checks.
We will also need to provide the following NRDP settings:
How to Install NCPA On Windows – Silent ?
The installer also supports a silent install, which allows system administrators to easily manage their network workstations without disrupting the workflow of the office.
The following arguments are currently supported:
Using the previous graphic install of NCPA as an example, here is how to install NCPA silently using those settings:
ncpa-2.1.6.exe /S /TOKEN=’Str0ngT0k3n’ /NRDPURL=’http://10.25.5.12/nrdp/’
/NRDPTOKEN=’NRDP_T0k3n’ /NRDPHOSTNAME=’S1601′
How to Install NCPA On Linux ?
There are several methods for installing NCPA on Linux depending on OS distribution. We will need to establish a terminal session as a root user to complete these steps.
1. Using Nagios Repository
The Nagios Repository can be used to install NCPA on RHEL/CentOS/Oracle Linux.
i. Firstly, install the repository depending on the version of Linux.
6.x
rpm -Uvh http://repo.nagios.com/nagios/6/nagios-repo-6-4.el6.noarch.rpm
7.x
rpm -Uvh http://repo.nagios.com/nagios/7/nagios-repo-7-4.el7.noarch.rpm
8.x
rpm -Uvh http://repo.nagios.com/nagios/8/nagios-repo-8-1.el8.noarch.rpm
ii. Once the repository has been installed, we will need to execute the following command to install NCPA:
# yum install ncpa -y
2. Using RPM Package
An RPM package can be used to install NCPA on RHEL/CentOS/Oracle Linux. The step below depends on the version and architecture of Linux we are running.
RHEL/CentOS/Oracle Linux 6.x i386
rpm -Uvh https://assets.nagios.com/downloads/ncpa/ncpa-latest.el6.i386.rpm
RHEL/CentOS/Oracle Linux 6.x x86_64
rpm -Uvh https://assets.nagios.com/downloads/ncpa/ncpa-latest.el6.x86_64.rpm
RHEL/CentOS/Oracle Linux 7.x
rpm -Uvh https://assets.nagios.com/downloads/ncpa/ncpa-latest.el7.x86_64.rpm
RHEL/CentOS/Oracle Linux 8.x
rpm -Uvh https://assets.nagios.com/downloads/ncpa/ncpa-latest.el8.x86_64.rpm
i. Using DEB Package
An DEB package can be used to install NCPA on Ubuntu/Debian. The steps below depends on the version and architecture of Linux we are running.
Debian 8.x i386
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.i386.deb
dpkg -i ./ncpa-latest.i386.deb
Debian 8.x amd64
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.amd64.deb
dpkg -i ./ncpa-latest.amd64.deb
Debian 9.x i386
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.d9.i386.deb
dpkg -i ./ncpa-latest.d9.i386.deb
Debian 9.x amd64
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.d9.amd64.deb
dpkg -i ./ncpa-latest.d9.amd64.deb
Debian 10.x amd64
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.d10.amd64.deb
dpkg -i ./ncpa-latest.d10.amd64.deb
Ubuntu i386
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.i386.deb
sudo dpkg -i ./ncpa-latest.i386.deb
Ubuntu amd64
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.amd64.deb
sudo dpkg -i ./ncpa-latest.amd64.deb
Linux installations do not provide configuration options as part of the installer.
However, the configuration file in Windows is the same, hence the information here is also valid for Windows.
Here we can configure NCPA for Active checks.
The NCPA configuration file is located here:
/usr/local/ncpa/etc/ncpa.cfg
i. Firstly, open the file in any text editor.
ii. Then, find the following line:
community_string = mytoken
iii. Change it to our required token, for example:
community_string = Str0ngT0k3n
iv. When we have finished, save the changes and close the file.
v. We will now need to restart the ncpa_listener service for these changes to take effect.
vi. Then, restart Service.
The command required for this will differ depending on OS and version.
RHEL/CentOS/Oracle Linux 6.x
# service ncpa_listener restart
RHEL/CentOS/Oracle Linux 7.x+
# systemctl restart ncpa_listener.service
Ubuntu 12.x/13.x/14.x
$ sudo service ncpa_listener restart
Ubuntu 15.x+
$ sudo systemctl restart ncpa_listener.service
Debian 7.x
# service ncpa_listener restart
Debian 8.x +
# systemctl restart ncpa_listener.service
How to Configure Firewall – Windows ?
A firewall rule needs to be created on our Windows machine to allow incoming traffic to NCPA on TCP Port 5693:
How to Configure Firewall – Linux ?
A firewall rule needs to be created on our Linux machine to allow incoming traffic to NCPA on TCP Port 5693.
The command required for this will differ depending on OS and version:
RHEL/CentOS/ Oracle Linux 5.x/6.x
# iptables -I INPUT -p tcp –destination-port 5693 -j ACCEPT
# service iptables save
# ip6tables -I INPUT -p tcp –destination-port 5693 -j ACCEPT
# service ip6tables save
RHEL/CentOS/ Oracle Linux 7.x+
# firewall-cmd –zone=public –add-port=5693/tcp
# firewall-cmd –zone=public –add-port=5693/tcp –permanent
On Ubuntu:
$ sudo mkdir -p /etc/ufw/applications.d
$ sudo sh -c “echo ‘[NCPA]’ > /etc/ufw/applications.d/ncpa”
$ sudo sh -c “echo ‘title=Nagios Cross Platorm Agent’ >> /etc/ufw/applications.d/ncpa”
$ sudo sh -c “echo ‘description=Nagios Monitoring Agent’ >> /etc/ufw/applications.d/ncpa”
$ sudo sh -c “echo ‘ports=5693/tcp’ >> /etc/ufw/applications.d/ncpa”
$ sudo ufw allow NCPA
$ sudo ufw reload
On Debian:
# iptables -I INPUT -p tcp –destination-port 5693 -j ACCEPT
# apt-get install -y iptables-persistent
Answer yes to saving existing rules
To ensure that the installation is successful and NCPA is now listening, try accessing the web interface of the agent. In order to do this, we will need to know:
Now that NCPA is installed on the remote machine, we can monitor the machine using the NCPA monitoring wizard in Nagios XI.
The NCPA agent has built-in documentation in web interface, this is located on the Help tab.
This gives the options to view or change configuration settings remotely as well as access additional info on NCPA.
This article covers how to Install Nagios NCPA on Linux and Windows. Basically, NCPA simplifies monitoring configurations and maintenance by allowing Nagios to monitor servers using the same agent regardless of platform. NCPA is intended to simplify and universalize agent-based monitoring
across different operating systems.
To monitor Windows Machines you will need to follow several steps and they are:
Why do we need Nagios?
Here, are the important reasons to use Nagios monitoring tool: