Using NRDP (Passive Checks)
Using NRDP (Passive Checks)
I have an active check running on my Nagios XI Server that timeouts after 60 seconds. Rather than increase the global service_timeout configuration, I want to use NRDP to send a passive check from my Nagios XI server to itself (i.e. my Nagios XI server needs to run the NRDP client). Is it okay to do this?
Please advise how I set this up.
I notice the following
1. As part of the Nagios XI installation, I do have NRDP clients scripts
$ ls -l /usr/local/nrdp/clients/
total 60
-rwxr-xr-x. 1 nagios nagios 5289 Feb 17 2017 1-usersgroups
-rwxr-xr-x. 1 nagios nagios 1408 Feb 17 2017 init.sh
-rwxr-xr-x. 1 nagios nagios 5135 Feb 17 2017 installnrds
drwxr-xr-x. 2 nagios nagios 4096 Feb 17 2017 nrds
-rwxr-xr-x. 1 nagios nagios 15976 Nov 30 14:28 send_nrdp.php
-rwxr-xr-x. 1 nagios nagios 7649 Nov 30 14:28 send_nrdp.py
-rwxr-xr-x. 1 nagios nagios 8986 Nov 30 14:28 send_nrdp.sh
2. Crontab for nagios user is empty
# crontab -u nagios -l
no crontab for nagios
Although I have NRDP client scripts, given the crontab file for nagios is empty, does this imply I do not have a fully installed NRDP client installed on my XI server. To complete the installation, should I run the below command on my Nagios XI server. Part of this install script will set up nagios user and group, which already exists as part of the XI installation. Therefore, I am not sure if it is safe to run this install script.
./installnrds <HOSTNAME> <INTERVAL>
Should I update the crontab file for nagios user manually? What would be the entry I need to add. Alternatively, is it okay for me to run the ./installnrds command
Out of interest, how does the NRDS client get the latest configuration from "NRDS Config Manager". Does the client pick up this config when it submits its passive check?
Thanks,
Nelson
Please advise how I set this up.
I notice the following
1. As part of the Nagios XI installation, I do have NRDP clients scripts
$ ls -l /usr/local/nrdp/clients/
total 60
-rwxr-xr-x. 1 nagios nagios 5289 Feb 17 2017 1-usersgroups
-rwxr-xr-x. 1 nagios nagios 1408 Feb 17 2017 init.sh
-rwxr-xr-x. 1 nagios nagios 5135 Feb 17 2017 installnrds
drwxr-xr-x. 2 nagios nagios 4096 Feb 17 2017 nrds
-rwxr-xr-x. 1 nagios nagios 15976 Nov 30 14:28 send_nrdp.php
-rwxr-xr-x. 1 nagios nagios 7649 Nov 30 14:28 send_nrdp.py
-rwxr-xr-x. 1 nagios nagios 8986 Nov 30 14:28 send_nrdp.sh
2. Crontab for nagios user is empty
# crontab -u nagios -l
no crontab for nagios
Although I have NRDP client scripts, given the crontab file for nagios is empty, does this imply I do not have a fully installed NRDP client installed on my XI server. To complete the installation, should I run the below command on my Nagios XI server. Part of this install script will set up nagios user and group, which already exists as part of the XI installation. Therefore, I am not sure if it is safe to run this install script.
./installnrds <HOSTNAME> <INTERVAL>
Should I update the crontab file for nagios user manually? What would be the entry I need to add. Alternatively, is it okay for me to run the ./installnrds command
Out of interest, how does the NRDS client get the latest configuration from "NRDS Config Manager". Does the client pick up this config when it submits its passive check?
Thanks,
Nelson
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Using NRDP (Passive Checks)
NRDS gets installed on the machines you want to monitor, the receiving part is already installed on XI
Configurations get updates from the XI server every time they send results if there is a change
https://assets.nagios.com/downloads/nag ... h_NRDS.pdf
Configurations get updates from the XI server every time they send results if there is a change
https://assets.nagios.com/downloads/nag ... h_NRDS.pdf
Re: Using NRDP (Passive Checks)
Thanks for the documentation, it is helpful
Can I run a nrds client on the same machine as my nagios xi server. The install of nrds client looks to create a nagios user and group. I already have this user created as part of the xi installation. Will there be conflict in having an nrds client running on the same machine as xi or nrds server
Thanks, Nelson
Can I run a nrds client on the same machine as my nagios xi server. The install of nrds client looks to create a nagios user and group. I already have this user created as part of the xi installation. Will there be conflict in having an nrds client running on the same machine as xi or nrds server
Thanks, Nelson
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Using NRDP (Passive Checks)
You should be able to run it on the XI server without conflict.
Re: Using NRDP (Passive Checks)
I have tried installing the NRDS client on my Nagios XI server, but the following wget command is failing
wget -O NRDS_LINUX.tar.gz "http://<my nagios XI Server>/nrdp/?cmd=nrdsgetclient&token=<My Token>&configname=NRDS_LINUX"
Checking in the /var/log/httpd/error_log file, I get the following errors
[Wed Mar 06 16:10:48 2019] [error] PHP Notice: Undefined index: tmp_dir in /usr/local/nrdp/server/plugins/nrdsconfigupdate/nrdsconfigupdate.inc.php on line 103
mkdir: cannot create directory `/nrdsconfig_2858326': Permission denied
cp: cannot create directory `/nrdsconfig_2858326': Permission denied
chmod: cannot access `/nrdsconfig_2858326/clients/installnrds': No such file or directory
cp: cannot create regular file `/nrdsconfig_2858326/clients/nrds/nrds.cfg': No such file or directory
sh: line 0: cd: /nrdsconfig_2858326: No such file or directory
tar: clients: Cannot stat: No such file or directory
tar (child): /nrdsconfig_2858326/NRDS_LINUX.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
This is the same error that is reported in, https://support.nagios.com/forum/viewto ... =6&t=42017.
I have checked "Admin->Manage Components" in XI, and my "NRDS Config Manager" is up to date.
Please help
Thanks,
Nelson
wget -O NRDS_LINUX.tar.gz "http://<my nagios XI Server>/nrdp/?cmd=nrdsgetclient&token=<My Token>&configname=NRDS_LINUX"
Checking in the /var/log/httpd/error_log file, I get the following errors
[Wed Mar 06 16:10:48 2019] [error] PHP Notice: Undefined index: tmp_dir in /usr/local/nrdp/server/plugins/nrdsconfigupdate/nrdsconfigupdate.inc.php on line 103
mkdir: cannot create directory `/nrdsconfig_2858326': Permission denied
cp: cannot create directory `/nrdsconfig_2858326': Permission denied
chmod: cannot access `/nrdsconfig_2858326/clients/installnrds': No such file or directory
cp: cannot create regular file `/nrdsconfig_2858326/clients/nrds/nrds.cfg': No such file or directory
sh: line 0: cd: /nrdsconfig_2858326: No such file or directory
tar: clients: Cannot stat: No such file or directory
tar (child): /nrdsconfig_2858326/NRDS_LINUX.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
This is the same error that is reported in, https://support.nagios.com/forum/viewto ... =6&t=42017.
I have checked "Admin->Manage Components" in XI, and my "NRDS Config Manager" is up to date.
Please help
Thanks,
Nelson
Re: Using NRDP (Passive Checks)
Also, please note, I first tried to install NRDS client by running the command, ./installnrds MONITORING 30, as installnrds already existed as part of my Nagios XI installation.
The output from this command was
./installnrds MONITORING 30
nagios group already exists.
nagios user already exists.
Installing NRDS Client
cp: `send_nrdp.php' and `/usr/local/nrdp/clients/send_nrdp.php' are the same file
cp: `send_nrdp.py' and `/usr/local/nrdp/clients/send_nrdp.py' are the same file
cp: `send_nrdp.sh' and `/usr/local/nrdp/clients/send_nrdp.sh' are the same file
cp: `nrds/nrds.cfg' and `/usr/local/nrdp/clients/nrds/nrds.cfg' are the same file
cp: `nrds/nrds_common.pl' and `/usr/local/nrdp/clients/nrds/nrds_common.pl' are the same file
Adding cron jobs for MONITORING at a 30 minute interval
no crontab for nagios
Crontabs installed OK
Updating config and plugins
Use of uninitialized value $status in string eq at /usr/local/nrdp/clients/nrds/nrds_updater.pl line 161, <CONFIG> line 124.
ERROR: Could not connect to http://www.my-server.com/nrdp/. Check your cfg file. at /usr/local/nrdp/clients/nrds/nrds_updater.pl line 161, <CONFIG> line 124.
Installation complete
As I had error message saying, "Could not connect to http://www.my-server.com/nrdp/. I then tried to run
wget -O NRDS_LINUX.tar.gz "http://<my nagios server>/nrdp/?cmd=nrdsgetclient&token=<My Token>&configname=NRDS_LINUX".
This fails, as per my previous post
The output from this command was
./installnrds MONITORING 30
nagios group already exists.
nagios user already exists.
Installing NRDS Client
cp: `send_nrdp.php' and `/usr/local/nrdp/clients/send_nrdp.php' are the same file
cp: `send_nrdp.py' and `/usr/local/nrdp/clients/send_nrdp.py' are the same file
cp: `send_nrdp.sh' and `/usr/local/nrdp/clients/send_nrdp.sh' are the same file
cp: `nrds/nrds.cfg' and `/usr/local/nrdp/clients/nrds/nrds.cfg' are the same file
cp: `nrds/nrds_common.pl' and `/usr/local/nrdp/clients/nrds/nrds_common.pl' are the same file
Adding cron jobs for MONITORING at a 30 minute interval
no crontab for nagios
Crontabs installed OK
Updating config and plugins
Use of uninitialized value $status in string eq at /usr/local/nrdp/clients/nrds/nrds_updater.pl line 161, <CONFIG> line 124.
ERROR: Could not connect to http://www.my-server.com/nrdp/. Check your cfg file. at /usr/local/nrdp/clients/nrds/nrds_updater.pl line 161, <CONFIG> line 124.
Installation complete
As I had error message saying, "Could not connect to http://www.my-server.com/nrdp/. I then tried to run
wget -O NRDS_LINUX.tar.gz "http://<my nagios server>/nrdp/?cmd=nrdsgetclient&token=<My Token>&configname=NRDS_LINUX".
This fails, as per my previous post
Re: Using NRDP (Passive Checks)
Regarding the error message in /var/log/httpd/error_log, line 103 of /usr/local/nrdp/server/plugins/nrdsconfigupdate/nrdsconfigupdate.inc.php is
$nrds_config_tmp_dir=$cfg["tmp_dir"]."/nrdsconfig_$rand";
$cfg["tmp_dir"] does not seem to be defined in this file. Should I update this php file with something like
$cfg["tmp_dir"]="/tmp";
The below grep shows $cfg["tmp_dir"] is not defined
grep "cfg\[" /usr/local/nrdp/server/plugins/nrdsconfigupdate/nrdsconfigupdate.inc.php
$cfg["config_dir"]="/usr/local/nrdp/configs";
$cfg["plugin_root"]="/usr/local/nrdp/plugins";
$config_file=$cfg["config_dir"]."/".$configname.".cfg";
$handle = @fopen($cfg["config_dir"]."/".$configname.".cfg", "r");
$nrds_config_tmp_dir=$cfg["tmp_dir"]."/nrdsconfig_$rand";
"{$cfg['plugin_root']}/$os/$arch/$os_ver/$plugin",
"{$cfg['plugin_root']}/$os/$arch/$plugin",
"{$cfg['plugin_root']}/$os/$plugin",
"{$cfg['plugin_root']}/Generic/$arch/$plugin",
"{$cfg['plugin_root']}/Generic/$plugin",
if (!is_dir($cfg["config_dir"])) mkdir($cfg["config_dir"],755,true);
if (!file_exists($cfg["config_dir"]."/".$configname.".cfg")){
$configfile=$cfg["config_dir"]."/".$configname.".cfg";
$nrds_config_tmp_dir=$cfg["tmp_dir"]."/nrdsconfig_$rand";
$cfg["tmp_dir"] does not seem to be defined in this file. Should I update this php file with something like
$cfg["tmp_dir"]="/tmp";
The below grep shows $cfg["tmp_dir"] is not defined
grep "cfg\[" /usr/local/nrdp/server/plugins/nrdsconfigupdate/nrdsconfigupdate.inc.php
$cfg["config_dir"]="/usr/local/nrdp/configs";
$cfg["plugin_root"]="/usr/local/nrdp/plugins";
$config_file=$cfg["config_dir"]."/".$configname.".cfg";
$handle = @fopen($cfg["config_dir"]."/".$configname.".cfg", "r");
$nrds_config_tmp_dir=$cfg["tmp_dir"]."/nrdsconfig_$rand";
"{$cfg['plugin_root']}/$os/$arch/$os_ver/$plugin",
"{$cfg['plugin_root']}/$os/$arch/$plugin",
"{$cfg['plugin_root']}/$os/$plugin",
"{$cfg['plugin_root']}/Generic/$arch/$plugin",
"{$cfg['plugin_root']}/Generic/$plugin",
if (!is_dir($cfg["config_dir"])) mkdir($cfg["config_dir"],755,true);
if (!file_exists($cfg["config_dir"]."/".$configname.".cfg")){
$configfile=$cfg["config_dir"]."/".$configname.".cfg";
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Using NRDP (Passive Checks)
Can you show the output of the following
the expected output should be
Code: Select all
grep tmp_dir /usr/local/nrdp/server/config.inc.phpCode: Select all
$cfg["tmp_dir"]="/usr/local/nagiosxi/tmp";Re: Using NRDP (Passive Checks)
Hi Scott,
It is blank,
# grep tmp_dir /usr/local/nrdp/server/config.inc.php
#
In the end, I did add the line, $cfg["tmp_dir"]="/tmp";, to the file /usr/local/nrdp/server/plugins/nrdsconfigupdate/nrdsconfigupdate.inc.php.
The wget command then completed successfully and retrieved NRDS_LINUX.tar.gz
When I now run installnrds, I get "curl exited with error 1792". Do you know why?
# pwd
/tmp/clients
# ./installnrds 127.0.0.1 30
nagios group already exists.
nagios user already exists.
Installing NRDS Client
Adding cron jobs for 127.0.0.1 at a 30 minute interval
Crontabs installed OK
Updating config and plugins
curl exited with error 1792
Installation complete
I also noticed nrds.pl is a zero byte file. Is this expected?
/usr/local/nrdp/clients/nrds
# ls -l
total 16
-rwxrwxr-x. 1 nagios nagios 495 Mar 6 17:31 nrds.cfg
-rwxrwxr-x. 1 nagios nagios 1628 Mar 6 17:31 nrds_common.pl
-rwxrwxr-x. 1 nagios nagios 0 Mar 6 17:31 nrds.pl
-rwxrwxr-x. 1 nagios nagios 6329 Mar 6 17:31 nrds_updater.pl
#
It is blank,
# grep tmp_dir /usr/local/nrdp/server/config.inc.php
#
In the end, I did add the line, $cfg["tmp_dir"]="/tmp";, to the file /usr/local/nrdp/server/plugins/nrdsconfigupdate/nrdsconfigupdate.inc.php.
The wget command then completed successfully and retrieved NRDS_LINUX.tar.gz
When I now run installnrds, I get "curl exited with error 1792". Do you know why?
# pwd
/tmp/clients
# ./installnrds 127.0.0.1 30
nagios group already exists.
nagios user already exists.
Installing NRDS Client
Adding cron jobs for 127.0.0.1 at a 30 minute interval
Crontabs installed OK
Updating config and plugins
curl exited with error 1792
Installation complete
I also noticed nrds.pl is a zero byte file. Is this expected?
/usr/local/nrdp/clients/nrds
# ls -l
total 16
-rwxrwxr-x. 1 nagios nagios 495 Mar 6 17:31 nrds.cfg
-rwxrwxr-x. 1 nagios nagios 1628 Mar 6 17:31 nrds_common.pl
-rwxrwxr-x. 1 nagios nagios 0 Mar 6 17:31 nrds.pl
-rwxrwxr-x. 1 nagios nagios 6329 Mar 6 17:31 nrds_updater.pl
#
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Using NRDP (Passive Checks)
That doesn't sound right, lets run the following commands to try to rectify this
It is possible that installing NRDS on the XI system is a problem, this is not something that is normally done because you can just setup checks locally for the same server.
Code: Select all
cd /usr/local/nagiosxi/html/includes/components/nrdsconfigmanager/
rm -f installed.nrds
./install.sh