How To Test Nagios Remote NRPE Commands

Published Date Author: , Posted September 27th, 2018 at 10:46:20am

There are many things to configure in Nagios, especially when using custom check commands. Recently I needed to configure all of the Continuent Clustering Nagios checks. Once setup on the database side, I wanted to confirm that everything was working.

Basics: Run a Remote NRPE Check

To test a remote NRPE client command from a nagios server via the command line, use the check_nrpe command:

The above command calls the NRPE daemon running on host db1 and executes the NRPE command “check_tungsten_latency” as defined in the db1:/etc/nagios/nrpe.cfg file.

Here is the line used in nrpe.cfg to define the check_tungsten_latency remote NRPE call:

Note that sudo is in use to give the nrpe user access as the tungsten user to the tungsten-owned check scripts using the sudo wildcard configuration.

Here is the service check definition in the /opt/local/etc/nagios/objects/services.cfg file:

Security: Sudo Configuration

To enable sudo for the nrpe user, create or edit the file /etc/sudoers.d/20_nagios like so:

sudo vim /etc/sudoers.d/20_nagios

Additional Command Examples

/etc/nagios/nrpe.cfg

/opt/local/etc/nagios/objects/services.cfg

For more information about monitoring Continuent clusters, please visit https://docs.continuent.com/tungsten-clustering-6.0/ecosystem-nagios.html.

To learn about Continuent solutions in general, check out https://www.continuent.com/solutions

No comments as yet.

Leave Your Comment  Leave a comment

All fields marked with "*" are required.