check_nrpe: Invalid packet type received from server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nelsonw
Posts: 64
Joined: Wed Feb 22, 2017 4:03 am

check_nrpe: Invalid packet type received from server

Post by nelsonw »

$ ./check_nrpe -H x.x.x.x -n -c Test
CHECK_NRPE: Invalid packet type received from server.

I receive "Invalid packet type received from server" when using check_nrpe.

I believe there is a constraint within nrpe in that it cannot, by default, manage output more than 1K from NSClient++.

Reading the article, https://support.nagios.com/kb/article.php?id=518, it suggests I make the following changes

- Add the line "payload length=8192" to my nsclient.ini file and restart NSClient++
- Include a "-2" and "P 8192" in the check_nrpe command (for example, /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -2 -P 8192)

However, the version of check_nrpe does not recognize the -2 and -P options

$ ./check_nrpe -H x.x.x.x -n -2 -P 8192
./check_nrpe: invalid option -- '2'
./check_nrpe: invalid option -- 'P'

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
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.

$
$ ./check_nrpe -H x.x.x.x -n
I (0.5.0.62 2016-09-14) seem to be doing fine...
$

Please help
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_nrpe: Invalid packet type received from server

Post by mcapra »

According to the KB article you linked, in order for check_nrpe v2 to process those larger packets:

Code: Select all

NSClient++ also has this fixed packet size (referred to as payload length) which can be increased in the config file. However it required the same source code edit for the check_nrpe plugin on the Nagios server.
Have you tried using check_nrpe v3 instead with the arguments mentioned?
Former Nagios employee
https://www.mcapra.com/
nelsonw
Posts: 64
Joined: Wed Feb 22, 2017 4:03 am

Re: check_nrpe: Invalid packet type received from server

Post by nelsonw »

Thanks, upgrading check_nrpe has worked :-)
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: check_nrpe: Invalid packet type received from server

Post by cdienger »

Glad to hear! Are we okay to lock the thread or did you have further questions?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked