Home Directory Addons Passive Checks send_nrdp Bash NRDP Client

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

send_nrdp Bash NRDP Client

Rating
2 votes
Favoured:
0
Current Version
0.1
Last Release Date
2012-02-16
Compatible With
  • Nagios 3.x
  • Nagios XI
Hits
180243
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Bash implementation of the send_nrdp client.

send_nrdp.sh Revision 0.1 - Send NRPD script for Nagios

Usage: send_nrdp.sh -u URL -t token [options]

Usage: send_nrdp.sh -h Help file


This script is used to send NRPD 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 name
-S State
-o output

STDIN:
**Optional**
-d delimiter (default "t")
With only the required parameters send_nrdp.sh is capable of
processing data piped to it either from a file or other
process. By default, we use t as the delimiter however this
may be specified with the -d option data should be in the
following formats one entry per line.
For Host checks:
hostname  State   output

For Service checks
hostname  servicename     State   output


File:
-f /full/path/to/file
This file will be sent to the NRDP server specified in -u
The file should be an XML file in the following format
##################################################

<?xml version='1.0'?>
<checkresults>
<checkresult type="host" checktype="1">
<hostname>YOUR_HOSTNAME</hostname>
<state>0</state>
<output>OK|perfdata=1.00;5;10;0</output>
</checkresult>
<checkresult type="service" checktype="1">
<hostname>YOUR_HOSTNAME</hostname>
<servicename>YOUR_SERVICENAME</servicename>
<state>0</state>
<output>OK|perfdata=1.00;5;10;0</output>
</checkresult>
</checkresults>
##################################################

Directory:
-D /path/to/temp/dir
This is a directory that contains XML files in the format
above. Additionally, if the -d flag is specified, send_nrdp.sh
will create temp files here if the server could not be reached.
On additional calls with the same -D path, if a connection to
the server is successful, all temp files will be sent.
Reviews (2)
This plugin works fine for me, except that it doesn't seem to support check-plugins that outputs multiline results. This is a new feature in Nagios 3.x from what I can tell.

I have one of those in my setup, check_jmxeval, that does two tests at the same time. The output is like this:

JMXEval CRITICAL - 2 checks, 1 critical [Threads], 1 ok
[1] Threads CRITICAL - ThreadCount is 73
[2] PeakThreads OK - PeakThreadCount is 73 | threadCount=73;150;100 peakThreadCount=76 time=0.0s

All that is returned to my Nagios server after this script generates the XML-code and sends it is the first line, like this:

JMXEval CRITICAL - 2 checks, 1 critical [Threads], 1 ok

I would like to see support for multiline output implemented in this script in the future. Right now I'm looking for a work around for this problem.
bymguthrie, November 7, 2012
1 of 1 people found this review helpful
Only requires curl or wget to run. For setting up a passive check it doesn't get more lightweight than this!