Home » Categories » Multiple Categories

NRPE - Packet Size Explained

Overview

This KB article discusses NRPE and the network packet size used in the different versions of the client and the check_nrpe plugin.

 

 

Nomenclature

The following explains the terms used in this document.

  • Client / Agent

    • This is what is listening for NRPE requests

    • "NRPE Client" refers to the Unix/Linux based client, provided by Nagios Enterprises

    • NSClient++ is the Windows client that has an NRPE listening module, developed externally by a third party

  • Plugin

    • This is what sends the request off to the client / agent

    • check_nrpe is the name of the binary

    • This is what is installed on the Nagios server, but is also installed on the NRPE client by default (not NSClient++)

 

 

Before NRPE v3

NRPE v2.15 and earlier have had a fixed packet size of 1024 bytes (referred to as v2 packet). What this means is that any plugin executed by NRPE that had an output which exceeded 1024 bytes would be truncated past this. Apart from cutting off useful information, any performance data at the end of the output would also be missing / incomplete and cause irregularities in the performance data (gaps in graphs).

It has been possible in the past to modify the source code and increase this to a larger number. However you were required to do this on the Nagios core server (check_nrpe plugin) and all the clients, there was no easy way to implement this with minimal interruption.

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.

 

 

NRPE v3 Onwards

NRPE v3 has had major improvements to the packet size to resolve the limitations of previous versions. The packet size is now variable up to 64K (referred to as v3 packet).

Compatibility with previous versions of NRPE and NSClient++ were taken into account to ensure a smooth transition to the new version of the client and plugin. This allows you to migrate to NRPE v3 without any immediate changes required to the server or clients/agents. These compatibilities are described as follows.

 

NRPE v3 plugin -> NRPE v2 (and earlier) Client

The v3 of check_nrpe will contact the client trying to establish a v3 packet session. This will fail immediately and then check_nrpe will retry using a v2 packet session. The connection will then succeed allowing NRPE to operate as per normal. This backwards compatibility allows you to implement the updated plugin on your Nagios server and then transition the clients as required.

There will be some errors in the logs which is described in more detail in this KB article:

Documentation - v3 Compatibility With Previous Versions

Until you update the clients you will not be able to take advantage of the larger v3 packet size. Monitoring will function as normal.

 

NRPE v2 (and earlier) plugin -> NRPE v3 Client

The v2 of check_nrpe will contact the client trying to establish a v2 packet session (just like it always has).  The connection will succeed allowing NRPE to operate as per normal. This backwards compatibility allows you to update all of your clients before updating the plugin on your Nagios server.

Until you update the check_nrpe plugin you will not be able to take advantage of the larger v3 packet size. Monitoring will function as normal.

 

NRPE v3 plugin -> NRPE v3 Client

The v3 of check_nrpe will contact the client trying to establish a v3 packet session.  The connection will succeed allowing NRPE to operate as per normal along with the enhanced v3 packet size.

 

NRPE v3 plugin -> NSClient++

The v3 of check_nrpe will contact the client trying to establish a v3 packet session. This will fail immediately and then check_nrpe will retry using a v2 packet session. The connection will then succeed allowing NSClient++ to operate as per normal. This backwards compatibility allows you to implement the updated plugin on your Nagios server while ensuring NSClient++ continues to function normally.

Information on enabling NSClient++ to allow an increased packet size is covered in the next section.

 

 

Increasing NSClient++ Payload Length

To allow v3 of check_nrpe to communicate with NSClient++ using an increase packet size will require some planning. The changes to the NSClient++ config file are explained below, however once you make these changes you will also need to update the Nagios command and service definitions as the check_nrpe plugin requires additional command line arguments.

You will need to decide on the size of the packet you wish NRPE and NSClient++ to communicate with. This is a fixed size, which means regardless how much data needs to be transmitted, the entire size will be transmitted. With this in mind, you may only need a size around 8192 instead of a large value like 65536. The following example will use 8192.

 

NSClient++ Changes

On your Windows server open the C:\Program Files\NSClient++\nsclient.ini file in a text editor.

Add the following line to the [/settings/NRPE/server] section (add both lines if the section does not exist).

[/settings/NRPE/server]
payload length=8192

Save the file and restart the NSClient++ service.

Alternatively the following commands inside a command prompt will do these changes instead of editing the file manually:

cd "\Program Files\NSClient++\"
nscp settings --path /settings/NRPE/server --key "payload length" --set 8192
nscp service --restart

 

check_nrpe Plugin Syntax

You will need to update your Nagios command and service definitions to include -2 -P 8192 to allow the plugin and client to communicate.

/usr/local/nagios/libexec/check_nrpe -2 -P 8192 -H 10.25.14.2

 

This is an example result from running the command:

I (0.5.0.22 2016-02-11) seem to be doing fine...

 

The following KB article explains how you can define these arguments in a config file:

Documentation - v3 check_nrpe Config File

 

 

Final Thoughts

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

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

0 (0)
Article Rating (No 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 - Installing The Linux Agent
Viewed 1475 times since Wed, Jan 27, 2016
NRPE - Warning: This Plugin Must Be Either Run As Root Or Setuid
Viewed 888 times since Mon, Jul 17, 2017
NRPE - CHECK_NRPE: Error Receiving Data From Daemon
Viewed 1308 times since Mon, Jul 17, 2017
Nagios XI - Monitoring AIX With Nagios
Viewed 647 times since Thu, Jan 28, 2016
NRPE - Error While Loading Shared Libraries: libssl.so
Viewed 863 times since Mon, Jul 17, 2017
NRPE - Configuring NRPE Commands To Accept Arguments
Viewed 5885 times since Sun, Oct 15, 2017
NRPE - Remote does not support Version 3 Packets
Viewed 1990 times since Mon, Nov 27, 2017
NRPE - General Troubleshooting Tips
Viewed 1441 times since Mon, Jul 17, 2017
NRPE - CHECK_NRPE: Error - Could Not Complete SSL Handshake
Viewed 14857 times since Fri, Jul 14, 2017
NRPE - How To Install NRPE v3 From Source
Viewed 34603 times since Fri, Jun 3, 2016