[ZBX-5732] Zabbix_sender does not send correctly data from a file Created: 2012 Oct 24  Updated: 2017 May 30  Resolved: 2012 Nov 20

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 2.0.4rc1, 2.1.0
Fix Version/s: 2.0.4rc1, 2.1.0

Type: Incident report Priority: Critical
Reporter: Alexey Pustovalov Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: sender
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Solaris 10/11


Attachments: File zabbix_sender.c.ZBX-5732_Solaris.patch    
Issue Links:
Duplicate

 Description   

zabbix_sender utility makes duplicates and send them to Zabbix server. For example:

  1. ./test.pl 200 > test2 && ./zabbix_sender -z 192.168.137.22 -p 10051 -T -i ./test2
    info from server: "Processed 250 Failed 0 Total 250 Seconds spent 0.003012"
    info from server: "Processed 250 Failed 0 Total 250 Seconds spent 0.003321"
    info from server: "Processed 100 Failed 0 Total 100 Seconds spent 0.001202"
    sent: 600; skipped: 0; total: 600
  2. cat ./test2 | wc -l
    400

We have only 400 records in file, but zabbix_sender sent 600.

It happens only with zabbix_sender installed on Solaris 10/11.



 Comments   
Comment by Andris Mednis [ 2012 Nov 14 ]

Problem reproduced. The bug is observed if a number of records in the input file is more than 250 (maximum for one connection, defined in src/zabbix_sender/zabbix_sender.c) and the input file is read either directly or via redirected input:

$ cat 400_records | zabbix_sender .... -i -     <--- ok.
$ zabbix_sender .... -i 400_records    <--- bug occurs.
$ zabbix_sender .... -i - < 400_records    <--- bug occurs.
Comment by Andris Mednis [ 2012 Nov 16 ]

Attachment "zabbix_sender.c.ZBX-5732_Solaris.patch" contains a quick-fix for Solaris.
To apply the patch:
Change to Zabbix source directory, for example:
$ cd zabbix-2.0.4rc1

Apply the patch, for example:
$ patch -bNp1 -i /tmp/zabbix_sender.c.ZBX-5732_Solaris.patch
patching file src/zabbix_sender/zabbix_sender.c

Check the difference between the original and patched files:
$ diff src/zabbix_sender/zabbix_sender.c.orig src/zabbix_sender/zabbix_sender.c
107c107
< exit(FAIL);

> _exit(FAIL);
195c195
< zbx_thread_exit(ret);

> _exit(ret);

It is a quick-fix for Solaris, but has not been tested on other platforms.

Comment by Andris Mednis [ 2012 Nov 20 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-5732

Comment by dimir [ 2012 Nov 21 ]

Successfully tested! Please review my comments in r31586 .

<Andris> Thanks! I reviewed and agree.

Comment by Andris Mednis [ 2012 Nov 22 ]

Fixed in versions pre-2.0.4 rev. 31617 and pre-2.1.0 rev. 31618.

Comment by richlv [ 2013 Apr 03 ]

this resulted in a regression : ZBX-6285

Generated at Fri Mar 29 10:34:12 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.