[Pkg-nagios-devel] Bug#742788: npcdmod problem with largs perfdata (>8192)

Thomas Sesselmann thomas.sesselmann at uni-jena.de
Thu Mar 27 14:09:13 UTC 2014


Package: pnp4nagios-bin
Version: 0.6.16-2
Severity: normal
Tags: patch


Hello,

i use debian stable (7.4) as my nagios server and have some checks with large perfdata.
I use the npcdmod.o to write this perfdata to file (broker_module).
If the perfdata is to long, the string will not terminted by newline and the next line append to this line.

See Attached file: perfdata.dump.gz
 zgrep ".DATATYPE" perfdata.dump.gz  #will help to find the line/problem

---- this is one line ----
DATATYPE::SERVICEPERFDATA	TIMET::1395924718	HOSTNAME::xx2.rz.uni-jena.de	SERVICEDESC::multi_nrpe_stat-fc3	SERVICEPERFDATA::check_multi::check_multi::plugins=19
time=1.530292 stat_dev_sdi::stat_dev::sdi_readB=1578376192c;
....
sdbx_readB=189207294976c; sdbx_writeB=11083DATATYPE::SERVICEPERFDATA	TIMET::1395924718	HOSTNAME::mailout1.rz.uni-jena.de	SERVICEDESC::multi_nrpe_stat
SERVICEPERFDATA::check_multi::check_multi::plugins=4 time=0.125382 stat_net::stat_net::eth0_in=895375029c; eth0_out=470741808c; eth0_in_err=0c; eth0_in_drop=0c;
eth0_out_err=0c; eth0_out_drop=0c; lo_in=14205c; lo_out=14205c; lo_in_err=0c; lo_in_drop=0c; lo_out_err=0c; lo_out_drop=0c; stat_dev::stat_dev::sda_readB=567335936c;
sda_writeB=5723353088c; sda_read_time=62052c; sda_write_time=899829c; sda_read=23177c; sda_write=412738c; sda_read_merged=4104c; sda_write_merged=1000449c; sda_io_wait=0;
sda_io_time=340722c; sda_io_weighted=961474c;	SERVICECHECKCOMMAND::my_check_multi!nrpe_stat.cmd!-t 35 -T 60	SERVICESTATE::0	SERVICESTATETYPE::1
----------------------------

So this perfdata will be assigned to an other host/service ...


I converted this code (npcdmod.c) from snprintf with fput to fprintf only,
see patch attached. So the length of perfdata is not relevant.
In my environment i tested this patch successfully.



best regards

Thomas Sesselmann

-- 
Thomas Sesselmann, Dipl.-Inf.
Friedrich-Schiller-Universität Jena
Rechenzentrum
Am Johannisfriedhof 2
D-07743 Jena
Tel.: 03641/9-40530
Fax.: 03641/9-40630
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perfdata.dump.gz
Type: application/gzip
Size: 8022 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-nagios-devel/attachments/20140327/4af81bbf/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pnp4nagios-perfdatafile_template-fprintf.patch
Type: text/x-patch
Size: 2178 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-nagios-devel/attachments/20140327/4af81bbf/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4912 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-nagios-devel/attachments/20140327/4af81bbf/attachment-0002.bin>


More information about the Pkg-nagios-devel mailing list