NSClient++ Help (#1) - max string length (#161) - Message List
hello together,
i have a problem with the nrpe payload (for WINDOWS), it seems that only ~1024 bytes of text (plugin output) can be send back to the nagios server. I need more output.
I've added to the common.h:
1.#define MAX_INPUT_BUFFER 4096 /* max size of most buffers we use */
- #define MAX_PACKETBUFFER_LENGTH 4096 /* max amount of data we'll send in one query/response */
then i have recompiled and have added to the NSC.ini
1.[Settings] string_length=4096 2.[NRPE] string_length=4000
but i got this message:
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
the errormessage from the logfile: 2008-06-02 14:14:05: error:.\NRPEListener.cpp:323: We got more then we wanted 4012, we only got: 4192
can everbody help me?
thanks & regards
-
Message #446
not sure I understand what I assume you are trying to do is extend the payload of NRPE?
If so you need to do the following: 1, recompile check_nrpe (after changing the following):
#define MAX_PACKETBUFFER_LENGTH <your size>
2, change the NRPE payload in NSClient++:
[NRPE] string_length=<same size>
3, possibly change the internal buffer size (if changing to larger then 4k IIRC):
[Settings] string_length=<larger size>
4, Be aware that NRPE (the unix check client) is broken since it only reads the first chunk of data. This means if you set the size larger then what will fit inside the TCP buffer(?) (around 16k) it will only read the first 16k or so (this will give you intermittent errors). So when changing this take care and change a bit at a time and/or fix the buggy check_nrpe.
Michael Medin
mickem06/02/08 14:33:49 (5 years ago)-
Message #447
Hi Michael Medin,
thanks for your reply, but i get the same message.
2008-06-02 14:59:16: error:.\NRPEListener.cpp:323: We got more then we wanted 2060, we only got: 2096
I like to check our ERP System, and i will write the information in the mysql db, it could be possible that the information is bigger than 1024 bytes of text.
so i need more text bytes.
thanks
anonymous06/02/08 15:05:54 (5 years ago)-
Message #448
could you provide me with the values of:
#define MAX_PACKETBUFFER_LENGTH <your size>
and
[NRPE] string_length=<same size>
Looks to me one is: 2060 and the other 2096. Also what platform do you run nagios (check_nrpe) on? Michael Medin
mickem06/02/08 15:11:16 (5 years ago)-
Message #449
the ckeck_nrpe runs under SUSE 10 SP1
my common.h
#define DEFAULT_SOCKET_TIMEOUT 10 /* timeout after 10 seconds */ #define DEFAULT_CONNECTION_TIMEOUT 300 /* timeout if daemon is waiting for connection more than this time */
#define MAX_INPUT_BUFFER 1024 /* max size of most buffers we use */ #define MAX_FILENAME_LENGTH 256
#define MAX_HOST_ADDRESS_LENGTH 256 /* max size of a host address */
#define NRPE_HELLO_COMMAND "_NRPE_CHECK"
#define MAX_COMMAND_ARGUMENTS 16
/ PACKET STRUCTURE DEFINITION /
#define QUERY_PACKET 1 /* id code for a packet containing a query */ #define RESPONSE_PACKET 2 /* id code for a packet containing a response */
#define NRPE_PACKET_VERSION_3 3 /* packet version identifier */ #define NRPE_PACKET_VERSION_2 2 #define NRPE_PACKET_VERSION_1 1 /* older packet version identifiers (no longer supported) */
#define MAX_PACKETBUFFER_LENGTH 2048 /* max amount of data we'll send in one query/response */
do you speak german??
regards OLLi
anonymous06/02/08 15:32:28 (5 years ago)-
Message #450
hi Michael,
it works, but i get still 1024 bytes.
check_nrpe runs under SUSE 10 SP 1
common.h #define MAX_INPUT_BUFFER 1024 #define MAX_PACKETBUFFER_LENGTH 2048
NSC.ini [SETTINGS] string_length=2049 [NRPE] string_length=2048
thanks & regards OLLi
anonymous06/02/08 16:11:52 (5 years ago)-
Message #455
I have changed the values to:
#define MAX_INPUT_BUFFER 4096 #define MAX_PACKETBUFFER_LENGTH 4096
NSC.ini [SETTINGS] string_length=5000 [NRPE] string_length=4096
Whenn I type on the NSClient: nsclient++ -noboot NRPEClient -h 127.0.0.1 I get: .... [ --buffer-length ] arg -> Length of payload (default 4096) ....
but I still get 1024 bytes.
Has anybody an idea??
thanks Olli
anonymous06/03/08 11:43:06 (5 years ago)-
Message #457
what check do you try to run?
mickem06/04/08 07:21:28 (5 years ago)-
Message #459
i like to read some information from our erp-system. so i have written an 3gl script, which get the information from our erp-system and write the infos in a text file.
then i call
ckeck_nrpe212 -H x.x.x.x -c check_infos
the check get still the first 1024 bytes.
additional i have written an perl script (check_erp) that writes the information in the mysql DB from nagios.
check_erp.pl -H x.x.x.x -c check_infos
in ths script i call the nrpe_check -> ckeck_nrpe212 -H x.x.x.x -c check_infos
thanks & regards olli
anonymous06/04/08 09:41:35 (5 years ago)-
Message #460
Hi micheal,
now it works, i have found an error in my check.
thanks & regards
olli
anonymous06/04/08 14:26:36 (5 years ago)-
Message #474
Hi Olli,
I am actually doing sth similar to u; using nrpe to call a script that extracts and sends b data to Nagios server and store the data into a mysql db.
I find that your check_erp.pl would be of be of great use to me for my attachment project(maybe others too :p).
Is it possible to share it?
Thanks
Jason06/12/08 04:53:38 (5 years ago)
-
-
-
-
-
-
-
-
-








