Home » Categories » Products » NRDS » Documentation

NDRS - Understanding How The Linux Client Works

Overview

This KB article explains how the NDRS client works in Linux, which can be helpful when diagnosing issues.

This expands on the information in this KB article:

Documentation - Passive Monitoring with NRDS

It is assumed that you have already created a NRDS configuration and run the client installer on your linux machine.

In this KB article:

  • A Nagios XI server called xi-c6x-x64 is what is being used as the NRDS config manager and will receive the passive check results from the client

  • It is assumed that you have already created a NRDS configuration and run the client installer on your linux machine

  • A CentOS 6.x linux machine called centos13 is being used for the examples demonstrated in this KB article

 

 

After Installation

When running the client installer, output similar to the following is produced:

Group nagios does not exist. Creating...
User nagios does not exist. Creating...
Installing NRDS Client

Adding cron jobs for centos13 at a 2 minute interval

no crontab for nagios
Crontabs installed OK
Updating config and plugins
Updated config to version 0.1 Updated 7 plugins
Installation complete

 

How do you know it's working?

In your Nagios XI server Navigate to Admin > Monitoring Config > Unconfigured Objects.

Here you should see the check results received by the linux client, here is an example screenshot:

 

 

 

What Are "Unconfigured Objects" In Nagios XI?

The NRDS client submits passive check results to Nagios XI. What's a passive check?

It's easier to explain an "active check" first. An active check is a host or service defined in Nagios, the Nagios processes actively goes and executes the plugin to determine the health of that host or service. It's the responsibility of the Nagios server to scheduled the frequency of these checks.

Passive checks are the opposite. It's the responsibility of the client submitting the passive checks to Nagios to scheduled the frequency of the checks. This can reduce the load on the Nagios server, and can help in scenarios where devices may not always be powered on.

Going back to the original question, What Are "Unconfigured Objects" In Nagios XI? Passive checks require host and service definitions in Nagios for the check results to be viewable in Nagios. When Nagios XI receives a passive check result from a device and it there is no existing host or service definition for these check results, these check results will appear under "Unconfigured Objects". Think if it as a catch-all for anything that Nagios does not know about.

You can actually see Nagios Core complain about these missing host and services in the /usr/local/nagios/var/nagios.log file:

[1470198309] Error: Got check result for service 'Check Disk' on host 'centos13'. Unable to find service
[1470198309] Error: Got check result for service 'Check Total Procs' on host 'centos13'. Unable to find service
[1470198309] Error: Got check result for service 'Check Users' on host 'centos13'. Unable to find service
[1470198309] Error: Got check result for service 'Check Load' on host 'centos13'. Unable to find service
[1470198309] Error: Got check result for service 'Check Zombie Procs' on host 'centos13'. Unable to find service
[1470198309] Error: Got host checkresult for 'centos13', but no such host can be found

 

Unconfigured Objects is a feature of Nagios XI, it does not exist in Nagios Core. Nagios Core will still report the errors in nagios.log however there is no automated way of detecting these and turning them into host and service definitions.

 

From the "Unconfigured Objects" screen you can run the "Unconfigured Passive Object" wizard which will create the host and service definitions for these objects that do not yet exist.

After running the wizard, you'll have services that look like this:

 

 

These services will be updated the next time the NRDS client submits it's passive check results.

Once you have turned the Unconfigured Objects into host and service definitions, the passive check results will no longer be logged in the /usr/local/nagios/var/nagios.log file. If you require this functionality you will need to define log_passive_checks=1 in /usr/local/nagios/etc/nagios.cfg and then restart Nagios.

 

 

Force Sending Checking Results

If you want to force the NRDS client to send in check results, how do you do that?

The NRDS client is executed as per the cron job that was created when the client was installed, which you saw in the installation output:

 Adding cron jobs for centos13 at a 2 minute interval

 

How do you execute that cron job? First you'll need to get a list of the users crontab commands, execute the following command on the linux client:

crontab -u nagios -l

 

The output will be something like this:

*/2 * * * * /usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1

 

The text in bold is what you need to execute to force the client to send passive check results to the nagios server.

However the cron job runs as the nagios user, to execute as the nagios user the sudo command will be used:

sudo -u nagios /usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13'

 

Which should output something like the following:

Sent 6 checks to http://xi-c6x-x64/nrdp/

 

 

How Do I Check To See If The Cron Job Is Running ?

The cron jobs executed on the linux machine will be logged in the /var/log/cron log file, for example:

tail /var/log/cron

 

The output will be something like this:

Aug  3 14:42:01 centos13 CROND[2066]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 14:44:01 centos13 CROND[2075]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 14:46:01 centos13 CROND[2084]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 14:48:01 centos13 CROND[2093]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 14:50:01 centos13 CROND[2102]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 14:52:01 centos13 CROND[2111]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 14:54:01 centos13 CROND[2120]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 14:56:01 centos13 CROND[2129]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 14:58:01 centos13 CROND[2139]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)
Aug  3 15:00:01 centos13 CROND[2150]: (nagios) CMD (/usr/local/nrdp/clients/nrds/nrds.pl -H 'centos13' > /dev/null 2>&1)

 

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

5 (1)
Article Rating (1 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios XI - Passive Monitoring with NRDS
Viewed 5694 times since Thu, Jan 28, 2016
NRDS - Expanding NRDS Capabilities on a Linux System - NWC14
Viewed 2847 times since Tue, Feb 9, 2016
Nagios XI - Passive Monitoring With NRDS_Win
Viewed 4495 times since Thu, Jan 28, 2016