Page 1 of 2

check_nrpe returning truncated performance data

Posted: Mon Dec 08, 2014 7:39 pm
by rajasegar
Nagios XI 2014R1.2
nrpe v 2.15

We have an issue where the performance data is being truncated.
Please advice on options available to fix this issue.

Code: Select all

[nagios@nagiosprodxi1 libexec]$ ./check_nrpe -H 10.10.10.10 -c check_disk -a MB 30% 15% '/tmp' ' -e -A -x /cdrom -i /zones -i /platform/sun4v'
CRITICAL - /oravl11 >Tot:307200MB Used:286934MB(94%) Free:20265MB(6%), /oravl12 >Tot:307200MB Used:286934MB(94%) Free:20265MB(6%), /oravl13 >Tot:307200MB Used:286933MB(94%) Free:20266MB(6%), /oravl51 >Tot:307200MB Used:286947MB(94%) Free:20252MB(6%), /oravl52 >Tot:307200MB Used:286943MB(94%) Free:20256MB(6%), /oravl53 >Tot:307200MB Used:286942MB(94%) Free:20257MB(6%), /oravl54 >Tot:307200MB Used:286945MB(94%) Free:20254MB(6%), /oravl55 >Tot:307200MB Used:225447MB(74%) Free:81752MB(26%), /oravl56 >Tot:307200MB Used:225451MB(74%) Free:81748MB(26%),| /tmp=28MB;716;870;0;1024 /=32810MB;42356;51432;0;60509 /dev=32810MB;42356;51432;0;60509 /oravl00=4950MB;7168;8704;0;10240 /oravl01=6489MB;7168;8704;0;10240 /oravl02=862MB;7168;8704;0;10240 /oravl03=1063MB;7168;8704;0;10240 /oravl04=862MB;7168;8704;0;10240 /oravl05=862MB;7168;8704;0;10240 /oravl06=37113MB;71680;87040;0;102400 /oravl11=286934MB;215040;261120;0;307200 /oravl12=286934MB;215040;261120;0;307200 /oravl13=286933MB;215040;261120;0;307200 /oravl14=204947MB;2
Thanks

Re: check_nrpe returning truncated performance data

Posted: Mon Dec 08, 2014 9:22 pm
by Box293
NRPE has a return limit of 1K by default.

There are some patches/mods out there that allow you to increase it but it means you need to re-compile NRPE at both ends :(

Personally for these situations I use check_by_ssh as it does not have limits on the amount of data that can be sent back.

Re: check_nrpe returning truncated performance data

Posted: Mon Dec 08, 2014 9:28 pm
by rajasegar
Box293 wrote:NRPE has a return limit of 1K by default.

There are some patches/mods out there that allow you to increase it but it means you need to re-compile NRPE at both ends :(

Personally for these situations I use check_by_ssh as it does not have limits on the amount of data that can be sent back.
Recompiling is not an issue.
Can you please provide info on the mods?

Thanks

Re: check_nrpe returning truncated performance data

Posted: Mon Dec 08, 2014 9:32 pm
by Box293

Re: check_nrpe returning truncated performance data

Posted: Mon Dec 08, 2014 9:39 pm
by rajasegar
Box293 wrote:Have a read of this forum post.

http://support.nagios.com/forum/viewtop ... 34&t=25221
Ok, found the info required. Will try it out

Code: Select all

./include/common.h:#define MAX_INPUT_BUFFER     4096    /* max size of most buffers we use */
./include/common.h:#define MAX_PACKETBUFFER_LENGTH      4096            /* max amount of data we'll send in one query/response */
./contrib/nrpe_check_control.c:#define MAX_CHARS        4096
Thanks

Re: check_nrpe returning truncated performance data

Posted: Tue Dec 09, 2014 10:11 am
by tmcdonald
Let us know how this works out. I was personally interested in that thread and never got to see the end results, so I am curious to see if those changes work for anyone.

Re: check_nrpe returning truncated performance data

Posted: Sun Feb 08, 2015 8:05 pm
by rajasegar
Confirmed working fine. I set the values to 8192.

Before

Code: Select all

nagios@unix-test-server:/usr/local/nagios/libexec$ ./check_nrpe.old -H localhost -c rs_test -a ""
CHECK_NRPE: Received 0 bytes from daemon.  Check the remote server logs for error messages.
nagios@unix-test-server:/usr/local/nagios/libexec$
After

Code: Select all

nagios@unix-test-server:/usr/local/nagios/libexec$ ./check_nrpe -H localhost -c rs_test -a ""
total 23867
-rwxr-xr-x   1 nagios   nagios    323324 May 19  2014 check_apt
-rwxr-xr-x   1 nagios   nagios      2256 May 19  2014 check_breeze
-rwxr-xr-x   1 nagios   nagios    159760 May 19  2014 check_by_ssh
lrwxrwxrwx   1 root     root           9 Jan 28 15:14 check_clamd -> check_tcp
....
.... snipped
....
-rw-r--r--   1 root     root           0 Feb  9 08:54 test.txt
-rwxr-xr-x   1 nagios   nagios    124008 May 19  2014 urlize
-rwxr-xr-x   1 nagios   nagios      1912 May 19  2014 utils.pm
-rwxr-xr-x   1 nagios   nagios      2791 May 19  2014 utils.sh
OK - dumped long listing
Need to change check_nrpe on the nagios server also. Have not done this yet.

Re: check_nrpe returning truncated performance data

Posted: Sun Feb 08, 2015 9:53 pm
by rajasegar
--WARNING ----

The newly compiled nrpe and check_nrpe only works with similarly compiled check_nrpe in the Nagios server.
The new check_nrpe does not work with the stock agents anymore and returns the following error.

Code: Select all

CHECK_NRPE: Received 0 bytes from daemon.  Check the remote server logs for error messages.
Anybody know how to fix this so that this new version can work for both new and modified agents?

Please take note and rename accordingly.

Re: check_nrpe returning truncated performance data

Posted: Sun Feb 08, 2015 11:22 pm
by Box293
As a work around, name the newly compiled check_nrpe as check_nrpe_larger
Then create a new command defition that uses this check_nrpe_larger plugin
Then modify the services you require to use this modified command.

I tried what you were after and this was one of the reasons why I decided to use check_by_ssh.

Re: check_nrpe returning truncated performance data

Posted: Mon Feb 09, 2015 12:22 am
by rajasegar
Box293 wrote:As a work around, name the newly compiled check_nrpe as check_nrpe_larger
Then create a new command defition that uses this check_nrpe_larger plugin
Then modify the services you require to use this modified command.

I tried what you were after and this was one of the reasons why I decided to use check_by_ssh.
Yeah. This is what I did.
Change to check_by_ssh needs proper testing so I am using this as a temp measure.