Page 1 of 1

Re: [Nagios-devel] Plugin message size

Posted: Wed Nov 17, 2004 6:02 am
by Guest
Jaap Hogenberg wrote:
> Hi !
>
> I'm running into a little problem using nagios 1.2 with plugins that
> return a lot of data. One of those is the check_disk plugin on a system
> with many disks. In the performance files that are written out, the data
> from the plugin is truncated.
>
> The command to generate the performance data output is:
>
> define command {
> command_name process-service-perfdata
> command_line /usr/bin/printf "%b"
> "$LASTCHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\
> t$LATENCY$\t$OUTPUT$\t$PERFDATA$\n" >>
> /usr/local/nagios/var/perfdata/$HOSTNAME$-$SERVICEDESC$.out }
>
> But somehow I think the data is already truncated where nagios reads the
> data from the plugin ....
>
> Running the plugin from the command line gives me all the data, so it
> looks like the data is truncated somewhere in nagios.
> I've tried to look at the source but I'm not that skilled in C
> programming.
>
> Does anyone know where the data may be truncated ?
>

In checks.c, where it says something like
plugin_output[sizeof(plugin_output) - 1] = '\0';
plugin_output is declared as
char plugin_output[MAX_PLUGIN_OUTPUT_LENGTH] (or something).
MAX_PLUGIN_OUTPUT_LENGTH is defined in nagios.h, I believe.

I think this is fixed in nagios 2.0, which incorporates a 4KB buffer for
plugin output.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Lead Developer





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]