[clug] nagios npre protcol

Robert Edwards bob at cs.anu.edu.au
Tue Apr 2 22:57:46 MDT 2013


 
 
----------------original message-----------------
From: "David Tulloh" david at tulloh.id.au
To: "jm" jeffm at ghostgun.com
CC: "CLUG List" 
Date: Wed, 3 Apr 2013 12:18:49 +1100
-------------------------------------------------
 
 
> The documentation is essentially the source code,
> 
> http://nagios.svn.sourceforge.net/viewvc/nagios/nrpe/trunk/include/c
> ommon.h?revision=2548&view=markup
> 
> NRPE is done by taking the following C struct and throwing it, bytewise,
at
> the other end via TCP. Not great if to ever want to talk to a different
> endian machine but very simple to implement. The struct can optionally be
> wrapped in SSL for security.
> 
> 
> typedef struct packet_struct{
> int16_t packet_version;
> int16_t packet_type;
> u_int32_t crc32_value;
> int16_t result_code;
> char buffer[MAX_PACKETBUFFER_LENGTH==1024];
> }packet;
> 

Of course, this is _not_ how the struct is defined in the above source.
Else "char buffer[MAX_PACKETBUFFER_LENGTH==1024]" would give an array of
size 1 (if MAX_PACKETBUFFER_LENGTH is set to 1024) or size 0 (if it
isn't)...

Maybe another way to put it would be:

typedef struct packet_struct{
 int16_t packet_version;
 int16_t packet_type;
 u_int32_t crc32_value;
 int16_t result_code;
 char buffer[MAX_PACKETBUFFER_LENGTH];
 }packet;

where MAX_PACKETBUFFER_LENGTH is defined elsewhere as 1024.

Cheers,

Bob Edwards.

> David
> 
> 
> On Mon, Mar 25, 2013 at 7:04 PM, jm jeffm at ghostgun.com wrote:
> 
>> Did a bit of a web search for documentation on the protocol used by
Nagios
>> to talk to its npre agent, but haven't been able to dig anything up. Does
>> anyone know if there is any documentation of this protocol and if so
where
>> it is to be located?
>>
>> Jeff.
>>
>> --
>> linux mailing list
>> linux at lists.samba.org
>> 
>> https://lists.samba.org/**mailman/listinfo/linux>
ba.org/mailman/listinfo/linux>
>>
> -- 
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux
> 




More information about the linux mailing list