Page 1 of 3

Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Fri Oct 15, 2021 8:08 am
by frankwijers
Hi all,

we have a Nagios XI configuration running in our datacenter, which is running fine. I'm still adding things every week.
We want to add a remote site to our central environment. This remote site already has a Nagios 3.2.3 running with a few hundred hosts.
I read things with inbound/outbound transfers and found where I can configure that in XI, but not sure if the 3.2.3 version has something similar.

I know I can export/import config files to get everything in the central environment, but then I would also need to edit all hosts to allow the central XI server to talk to the NSClient++ (which will eventually be replaced with the ncpa client).

What would be the best way to connect both environments?

Thanks.
Frank

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Fri Oct 15, 2021 12:54 pm
by tgriep
This document describes how to use Nagios Remote Data Processor (NDRP) as a distributed monitoring solution.
You will be shown how a central Nagios XI server can receive check results from Nagios XI and Nagios Core servers.

https://support.nagios.com/kb/article/n ... p-744.html

On the top of Page 3 in the PDF file, has the instructions for setting up the commands for a Core server.

Take a look at it and if you have any questions, let us know.

Thank you.

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Wed Oct 20, 2021 2:43 am
by frankwijers
Thanks for the quick reply. I tried implementing it today, but no luck so far.
I think I did all steps ok, but for some reason, checks are not poping up on the central server.
As a test, I installed the send_nrdp.php script on the central XI server and ran this command:
./send_nrdp.php --url=https://10.5.8.x/nrdp/ --token=XXXXXX --host=testhost --state=0 --output="OK"

That got the data in the "unconfigured objects". So my command is good and that seems to work.
When I copy/paste the command to the remote nagios core server, data never arrives at the XI server.
I tried opening the web page from another server on the same remote subnet and sent the json check result, this went fine.
I'm a bit lost to where the issue might reside.

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Wed Oct 20, 2021 10:12 am
by tgriep
Do you see any errors in the nagios.log file on the Core server when the script is running?

When you ran the command in the command line on the Core server, were there any errors displayed?

What OS and release is the Core server running?
What version of PHP is installed on it?

Thank you.

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Fri Oct 22, 2021 2:31 am
by frankwijers
In the nagios.log I cannot find anything about send_nrdp.php.
When I run the command on the prompt, it just goes back to the prompt without any notifications whatsoever, but that's the same on the XI server.
On the nagios core PHP version 5.3.17 is installed. It's running nagios 3.2.3 on Suse linux enterprise server 11 patchlevel 3.

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Fri Oct 22, 2021 2:29 pm
by tgriep
To further troubleshoot this, we will need to install tcpdump on the Nagios server and capture the data from your core server to see if it is received.

To install tcpdump,run the following as root in the Nagios XI server.

Code: Select all

yum install tcpdump -y
Then, to capture the data, run the following as root (Replace xxx.xxx.xxx.xxx with the IP address of the CORE server)

Code: Select all

tcpdump -i any -s 65535 -w core.cap host xxx.xxx.xxx.xxx
Run the send_nrdp.php script on the Core server, stop the tcpdump on the XI and post the core.cap file here so we can see if any data is received.

Thank you.

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Wed Oct 27, 2021 6:00 am
by frankwijers
tcpdump dit not receive any packets when using the php file, so I guess there is an issue with php on the core server.
tried a ping, tcpdump saw the package, so connection seems ok.
curl -vvv -k https://10.5.8.x/nrdp/
gave me the cert and output of the nrdp website, so port 443 also seems to be open.
On the core server openssl is very old (0.9.8j), and php is version 5.3.17.

only issue is that there currently are some political struggles, so I cannot make much changes to "their" server.

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Wed Oct 27, 2021 2:31 pm
by tgriep
There are other scripts you can try instead of the PHP script.

On the XI server you will find send_nrdp.php, send_nrdp.py and send_nrdp.sh clients located at the following location:

Code: Select all

/usr/local/nrdp/clients/
You can distribute this standalone client to remote Linux servers that you want to submit check results or send
commands from. The client you choose to use is entirely up to you, they each provide the same basic
functionality.

I tested the send_nrdp.sh script from the command line and it did work. It is not the same OS as your core server but you can try that script.

The send_nrdp.sh options are as follows.
Usage: send_nrdp.sh -h display help
This script is used to send NRDP data to a Nagios server

Required:
-u, URL of NRDP server. Usually http://<IP_ADDRESS>/nrdp/
-t, Shared token. Must be the same token set in NRDP Server

Options:
Single Check:
-H Host name
-s Service description
-S State
-o Output

command_line for the host command would have to be changed to this.

Code: Select all

$USER1$/send_nrdp.sh -u https://xxx.xxx.xxx.xxx/nrdp/ -t XXXXX -H "$HOSTNAME$" -S $HOSTSTATEID$ -o "$HOSTOUTPUT$"
For the Service command, use this.

Code: Select all

$USER1$/send_nrdp.sh -u https://xxx.xxx.xxx.xxx/nrdp/ -t XXXXX -H "$HOSTNAME$" -s "$SERVICEDESC$" -S $HOSTSTATEID$ -o "$HOSTOUTPUT$"
Thank you.

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Fri Oct 29, 2021 7:35 am
by frankwijers
Using the send_nrdp.sh script, I was able to send data to the XI machine and saw it as an unconfigured object.
This probably means that php, openssl or both are too outdated on the core server.
Since I'm about an hour away from weekend, I'm not making any changes now which might cause an impact, will test Monday morning.

I think we are about 99% there.

Re: Add Nagios 3.2.3 server to Nagios XI configuration

Posted: Fri Oct 29, 2021 12:54 pm
by tgriep
I agree. The bash script should work for you.
If you have any issues or questions next week, just post them here.