check nrpe check arguments

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
martijnmoi
Posts: 17
Joined: Mon Feb 22, 2016 8:23 am

check nrpe check arguments

Post by martijnmoi »

ok i've got this short question.

i think the code explains itself.
[root@nagiosproxy ~]# ./check_nrpe -H 10.0.1.7 -c check_memory
OK: committed = 1.206GB, physical = 1.321GB|'committed'=1.20558GB;6.39788;7.19762;0;7.99735 'committed %'=15%;79;89;0;100 'physical'=1.32079GB;3.19965;3.5996;0;3.99956 'physical %'=33%;79;89;0;100
[root@nagiosproxy ~]# ./check_nrpe -H 10.0.1.7 -c check_memory -w 90 -c 95
./check_nrpe: invalid option -- 'w'

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required

Usage: check_nrpe -H <host> [ -b <bindaddr> ] [-4] [-6] [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]

Options:
-n = Do no use SSL
-u = Make socket timeouts return an UNKNOWN state instead of CRITICAL
<host> = The address of the host running the NRPE daemon
<bindaddr> = bind to local address
-4 = user ipv4 only
-6 = user ipv6 only
[port] = The port on which the daemon is running (default=5666)
[timeout] = Number of seconds before connection times out (default=10)
[command] = The name of the command that the remote daemon should run
[arglist] = Optional arguments that should be passed to the command. Multiple
arguments should be separated by a space. If provided, this must be
the last option supplied on the command line.

Note:
This plugin requires that you have the NRPE daemon running on the remote host.
You must also have configured the daemon to associate a specific plugin command
with the [command] option you are specifying here. Upon receipt of the
[command] argument, the NRPE daemon will run the appropriate plugin command and
send the plugin output and return code back to *this* plugin. This allows you
to execute plugins on remote hosts and 'fake' the results to make Nagios think
the plugin is being run locally.

[root@nagiosproxy ~]#

i tried something with single and double quotes but it wont work.

(server setup: Nagios ---(ssh)--> 'Nagios_proxy' ---(nrpe)--->Server with nsclient 0.4.4.) (proxy is needed because of DMZ server splitting. Only ssh nagios->nagiosproxy is available

The above code is executed on the Nagios_proxy server.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: check nrpe check arguments

Post by lmiltchev »

The correct syntax is:

Code: Select all

./check_nrpe -H <ip address> -c <command> -a <arguments>
So, try:

Code: Select all

./check_nrpe -H 10.0.1.7 -c check_memory -a '-w 90 -c 95'
This depends on how the "check_memory" is defined on the remote box. It you had something like this (for example):

Code: Select all

command[check_memory]=/usr/local/nagios/libexec/custom_check_mem -n $ARG1$
then you could pass arguments. By looking at your first command, it seems like that you hard-coded your arguments. Can you show us how the "check_memory" is defined?
Be sure to check out our Knowledgebase for helpful articles and solutions!
martijnmoi
Posts: 17
Joined: Mon Feb 22, 2016 8:23 am

Re: check nrpe check arguments

Post by martijnmoi »

heyhey,

i think i just made a typo. i forgot the whole '-a argument' and also got messy with the quotes.


topic may be closed. i might have opened one to soon..


Thank you for your support :)
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check nrpe check arguments

Post by mcapra »

Closing this up
Former Nagios employee
https://www.mcapra.com/
Locked