Plugin message size
Andreas Ericsson
ae at op5.se
Wed Nov 17 15:02:19 CET 2004
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 andreas.ericsson at op5.se
OP5 AB www.op5.se
Lead Developer
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
More information about the Developers
mailing list