NRPE - Packet Size Explained
This KB article discusses NRPE and the network packet size used in the different versions of the client and the check_nrpe plugin.
The following explains the terms used in this document.
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:
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.
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).
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++\"
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:
For any support related questions please visit the Nagios Support Forums at:
|Posted by: tlea - Thu, Jun 30, 2016 at 12:14 AM. This article has been viewed 6146 times.|
|Online URL: https://support.nagios.com/kb/article/nrpe-packet-size-explained-518.html|
Powered by PHPKB (Knowledge Base Software)