ZABBIX BUGS AND ISSUES

Zabbix_sender does not send correctly data from a file

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.0.4rc1, 2.1.0
  • Fix Version/s: 2.0.4rc1, 2.1.0
  • Component/s: None
  • Labels:
  • Environment:
    Solaris 10/11
  • Zabbix ID:
    RTF

Description

zabbix_sender utility makes duplicates and send them to Zabbix server. For example:
# ./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
# 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.

Activity

Hide
Andris Mednis added a comment - - edited

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.
Show
Andris Mednis added a comment - - edited 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.
Hide
Andris Mednis added a comment -

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.

Show
Andris Mednis added a comment - 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.
Hide
Andris Mednis added a comment -

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

Show
Andris Mednis added a comment - Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-5732
Hide
dimir added a comment - - edited

Successfully tested! Please review my comments in r31586 .

<Andris> Thanks! I reviewed and agree.

Show
dimir added a comment - - edited Successfully tested! Please review my comments in r31586 . <Andris> Thanks! I reviewed and agree.
Hide
Andris Mednis added a comment -

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

Show
Andris Mednis added a comment - Fixed in versions pre-2.0.4 rev. 31617 and pre-2.1.0 rev. 31618.
Hide
richlv added a comment -

this resulted in a regression : ZBX-6285

Show
richlv added a comment - this resulted in a regression : ZBX-6285

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: