Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#133 closed enhancement (worksforme)

Max output len from NRPE

Reported by: mitulasek@… Owned by: MickeM
Priority: 1 Milestone: 0.3.1
Component: NRPEListener Version: 0.3.0
Severity: Feature Requests Keywords:
Cc:

Description

It would be nice to increase max output length from NRPE listener. I tested string_length in NRPE section of ini file but it seems not to be right thing. In my opinion it will be useful especially in multiline outputs.
Thanks

Change History (10)

comment:1 Changed 5 years ago by mickem

  • Milestone set to 0.3.1
  • Resolution set to duplicate
  • Status changed from new to closed

that should work (in latest nightlies) but due to the protocols nature you need to edit the source of check_nrpe and rebuild that.

If you want to check can use the "internal" NRPE client which respect the same value and thus (I hope) should work, first edit BOTH string_length values (one under NRPE and one under Settings) then do:

nsclient++ -noboot NRPEClient -h 127.0.0.1 -p 5666 -c really_long_command

Worth to notice is that check_nrpe has a bug that prevents the payload from being to large (when it reads from the socket it "assumes" all data is there so if the payload is larger it will only read part of the data, for me that happens around 16K but I think it has to do with TCP/IP buffer/packet size settings.

(if it does not work, re-open the ticket)

MickeM

comment:2 Changed 5 years ago by anonymous

  • Resolution duplicate deleted
  • Status changed from closed to reopened

I fear it not work. I use recompiled rev 74 with increased MAX_INPUT_BUFFER in production environment without problems. But in rev 112 I don't know what to change. When I changed string_length in both sections max output is still 1024 B.

comment:3 Changed 5 years ago by mickem

you have recompiled check_nrpe?

Then changing string_length under [NRPE] to the same value should work.
ie:

...
[NRPE]
string_length=2048
...

If you set string_length "large" (larger then around 4k) you also need to up the nternal buffers:

...
[Settings]
string_length=16000
...
[NRPE]
string_length=15000
...

AFAIK the Settings one has to "slightly larger" then the NRPE one (and defaults to 4096).

It "should" work, if not let me know what NRPE says, and the log from NSClient++.

(maybe I should add a debug log for the length so it is visible when you do /test?)

MickeM

comment:4 Changed 5 years ago by anonymous

default MAX_INPUT_BUFFER in check_nrpe is 2048 so there is nothing to recompile
NRPE says nothing but "Injected Result:" in log has only first 1024 B

comment:5 Changed 5 years ago by mickem

  • Resolution set to worksforme
  • Status changed from reopened to closed

Default input buffer is not the argument you need to change in NRPE.
common.h

#define MAX_PACKETBUFFER_LENGTH	1024		/* max amount of data we'll send in one query/response */

This is the one you need to change, the other one is only used in the nrpe server I think.

MickeM

comment:6 Changed 5 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to reopened

change MAX_PACKETBUFFER_LENGTH cause error:
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
while nsc.log contains no message

comment:7 Changed 5 years ago by mickem

  • Resolution set to worksforme
  • Status changed from reopened to closed

try the latest nightly, should give you some debug/error logs so it should be simpler to diagnose...

comment:8 Changed 5 years ago by anonymous

thanks a lot - now it works like you expected
but there must be something more than debug log - interchange NRPEListener.dll between rev 112 and 114 make it working/fail

comment:9 follow-up: Changed 5 years ago by anonymous

humm... not really, you can check changeset:113 and changeset:114 only "code change" (ie. non log) is a ntohs() in NSCA module...
but as long as it works it is all good I guess...

MickeM

comment:10 in reply to: ↑ 9 Changed 5 years ago by anonymous

Replying to anonymous:

humm... not really, you can check changeset:113 and changeset:114 only "code change" (ie. non log) is a ntohs() in NSCA module...

113 and 114 are similar but 112 seems ignore string_length parameter

but as long as it works it is all good I guess...

of course

thanks again

Note: See TracTickets for help on using tickets.