wesupport

Need help?

Our experts have had an average response time of 13.14 minutes in February 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Install NRDP From Source – Install it in different Linux distributions

by | May 14, 2021

Don’t know how to Install NRDP From Source? We can help you.

PHP-based passive result collector for use with Nagios, NRDP is a flexible data transport mechanism and processor.

It has a simple and powerful architecture that allows for it to be easily extended and customized to fit individual users’ needs.

As part of our Server Management Services, we assist our customers with several Nagios queries.

Today, let us see how to install Nagios Remote Data Processor (NRDP) from the source.

 

Install NRDP From Source

In order to begin, our Support Techs suggest having:

  • Nagios Core
  • Apache and PHP on the Nagios Core server.

Nagios XI includes NRDP by default.

  • RHEL|CentOS|Oracle Linux

We need to install the php-xml and php-json modules in RHEL 8:

# dnf install -y php-xml php-json
a. Download the Source
# cd /tmp
# wget -O nrdp.tar.gz https://github.com/NagiosEnterprises/nrdp/archive/1.5.1.tar.gz
# tar xzf nrdp.tar.gz
b. Copy Files

We create the /usr/local/nrdp directory to store the NDRP php files.

# cd /tmp/nrdp-1.5.1/
# mkdir -p /usr/local/nrdp
# cp -r clients server LICENSE* CHANGES* /usr/local/nrdp
# chown -R nagios:nagios /usr/local/nrdp
c. Define Tokens

Generally, the client uses tokens to authenticate with NRDP on the Nagios Core server.

We can use the same token on all clients or we can define a different token for each client.

We need to edit the config.inc.php file and define the token(s) to use. To do so, open the file in vi:

# vi /usr/local/nrdp/server/config.inc.php

The section to define the tokens is at the top of the file, it is a PHP array.

For example,

$cfg[‘authorized_tokens’] = array(
“cda35gtdfu72”,
“90dfs7jwncsd908fng8fhgb54ynq690xc9vt8uw9ty53”,
“+23rf==34m12n-v73nciu”,
);

Here, we can see three tokens.

We should surround each token with double quotes and end with a comma.

Once done, we save the changes and close config.inc.php file.

d. Copy Apache Config File
# cp nrdp.conf /etc/httpd/conf.d/
e. Restart Apache Web Server

RHEL 5/6|CentOS 5/6|Oracle Linux 5/6

# service httpd restart

RHEL 7/8|CentOS 7|Oracle Linux 7

# systemctl restart httpd.service
  • Ubuntu

Ubuntu 16/17/18 requires the php-xml module to be installed:

$ apt-get update
$ apt-get install -y php-xml
a. Download the Source
$ cd /tmp
$ wget -O nrdp.tar.gz https://github.com/NagiosEnterprises/nrdp/archive/1.5.1.tar.gz
$ tar xzf nrdp.tar.gz
b. Copy Files

We will create the /usr/local/nrdp directory to store the NDRP php files.

$ cd /tmp/nrdp-1.5.1/
$ sudo mkdir -p /usr/local/nrdp
$ sudo cp -r clients server LICENSE* CHANGES* /usr/local/nrdp
$ sudo chown -R nagios:nagios /usr/local/nrdp
c. Define Tokens

We can define different tokens for each client. This allows us to revoke access at a later date by removing it. But it also adds an extra level of administration.

Here, we will edit the config.inc.php file and define the token(s):

$ sudo vi /usr/local/nrdp/server/config.inc.php

For exampe,

$cfg[‘authorized_tokens’] = array(
“cda35gtdfu72”,
“90dfs7jwncsd908fng8fhgb54ynq690xc9vt8uw9ty53”,
“+23rf==34m12n-v73nciu”,
);

Eventually, we save the changes and close config.inc.php file.

d. Copy Apache Config File
$ sudo cp nrdp.conf /etc/apache2/sites-enabled/
e. Restart Apache Web Server

Ubuntu 13.x/14.x

$ sudo service apache2 restart

Ubuntu 15.x/16.x/17.x

$ sudo systemctl restart apache2.service
  • Debian

All steps on Debian require to run as root. To become root, we run:

# su

From this point, all commands will be as root.

Debian requires the php-xml module:

# apt-get update
# apt-get install -y php-xml
a. Download the Source
# cd /tmp
# wget -O nrdp.tar.gz https://github.com/NagiosEnterprises/nrdp/archive/1.5.1.tar.gz
# tar xzf nrdp.tar.gz
b. Copy Files

Then we proceed to create the /usr/local/nrdp directory:

# cd /tmp/nrdp-1.5.1/
# mkdir -p /usr/local/nrdp
# cp -r clients server LICENSE* CHANGES* /usr/local/nrdp
# chown -R nagios:nagios /usr/local/nrdp
c. Define Tokens

We edit the config.inc.php file and define the token(s):

# vi /usr/local/nrdp/server/config.inc.php

For example,

$cfg[‘authorized_tokens’] = array(
“cda35gtdfu72”,
“90dfs7jwncsd908fng8fhgb54ynq690xc9vt8uw9ty53”,
“+23rf==34m12n-v73nciu”,
);

Each token surrounds by double quotes and ends with a comma.

Then, we save the changes and close config.inc.php file.

d. Copy Apache Config File
# cp nrdp.conf /etc/apache2/sites-enabled/
e. Restart Apache Web Server

Debian 7.x

# service apache2 restart

Debian 8.x/9.x

# systemctl restart apache2.service
  • Fedora

Here, we need to install the php-xml and php-json module:

# dnf install -y php-xml php-json
a. Download the Source
# cd /tmp
# wget -O nrdp.tar.gz https://github.com/NagiosEnterprises/nrdp/archive/1.5.1.tar.gz
# tar xzf nrdp.tar.gz
b. Copy Files

Then we create the /usr/local/nrdp directory:

# cd /tmp/nrdp-1.5.1/
# mkdir -p /usr/local/nrdp
# cp -r clients server LICENSE* CHANGES* /usr/local/nrdp
# chown -R nagios:nagios /usr/local/nrdp
c. Define Tokens

We define the token(s) in the config.inc.php file:

# vi /usr/local/nrdp/server/config.inc.php

For example,

$cfg[‘authorized_tokens’] = array(
“cda35gtdfu72”,
“90dfs7jwncsd908fng8fhgb54ynq690xc9vt8uw9ty53”,
“+23rf==34m12n-v73nciu”,
);

We surround each token with double quotes and end with a comma.

Once we add, we save the changes and close the config.inc.php file.

d. Copy Apache Config File
# cp nrdp.conf /etc/httpd/conf.d/
e. Restart Apache Web Server
# systemctl restart httpd.service
  • FreeBSD

a. Download the Source
# cd /tmp
# wget -O nrdp.tar.gz https://github.com/NagiosEnterprises/nrdp/archive/1.5.1.tar.gz
# tar xzf nrdp.tar.gz
b. Copy Files

Then we create the /usr/local/nrdp directory:

# cd /tmp/nrdp-1.5.1/
# mkdir -p /usr/local/nrdp
# cp -r clients server LICENSE* CHANGES* /usr/local/nrdp
# chown -R nagios:nagios /usr/local/nrdp
c. Define Tokens

We edit the config.inc.php file and define the token(s) we want to use:

# vi /usr/local/nrdp/server/config.inc.php

For example,

$cfg[‘authorized_tokens’] = array(
“cda35gtdfu72”,
“90dfs7jwncsd908fng8fhgb54ynq690xc9vt8uw9ty53”,
“+23rf==34m12n-v73nciu”,
);

Eventually, we save the changes and close config.inc.php file.

d. Copy Apache Config File
# cp nrdp.conf /usr/local/etc/apache24/Includes/
e. Restart Apache Web Server
# service apache24 restart

Test NRDP

NRDP is now running. To confirm this, we can open the NRDP Web Interface.

Point the web browser to the IP address or FQDN of our NRDP server, for example:

http://10.25.5.143/nrdp
http://xyz.domain.local/nrdp

Then, we will see the Nagios Remote Data Processor screen.

To test that it is working, we submit a passive check result. It populates the Token field and defines both a host and service passive check result. Then we click the Submit JSON Check Result button.

If successful, the browser will display an OK under the Submit JSON Check Result button.

In addition, we will see the following in the /usr/local/nagios/var/nagios.log file:

[1514933633] Error: Got host checkresult for ‘somehost’, but no such host can be found
[1514933633] Error: Got check result for service ‘someservice’ on host ‘somehost’. Unable to find service

We can expect this error because the somehost host does not actually exist in the Nagios configs. So Nagios will record this in the log file.

On the other hand, if the configs exist, then we will this reflected in the Nagios Core GUI.

Install NRDP From Source

[Need help with the installation? We’d be happy to assist]

 

Conclusion

In short, we saw how our Support Techs install NRDP from the source.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags