[ZBXNEXT-4967] Zabbix sender does not send to all IP's defined with ServerActive in config file Created: 2015 Aug 20  Updated: 2024 Apr 10  Resolved: 2019 Apr 10

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: None
Affects Version/s: None
Fix Version/s: 4.2.0rc1, 4.4 (plan)

Type: New Feature Request Priority: Trivial
Reporter: Shaun Rampersad Assignee: Viktors Tjarve
Resolution: Fixed Votes: 6
Labels: multiple, sender
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified
Environment:

Linux
Centos 6.


Issue Links:
Causes
causes ZBX-18886 Huge number of open semaphores, AIX V... Closed
causes ZBX-19274 Opened semaphores are not closing if ... Closed
Duplicate
is duplicated by ZBX-11499 Zabbix-Sender and two active servers Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
ZBXNEXT-5123 zabbix_sender will show host name or ... Change Request (Sub-task) Closed Andris Zeila  
Team: Team A
Sprint: Sprint 48, Jan 2019, Sprint 49 (Feb 2019), Sprint 50 (Mar 2019), Sprint 51 (Apr 2019)
Story Points: 4

 Description   

Hi

When using zabbix_sender from the command line and specifying the agent conf file, zabbix_sender does not send data to multiple IP's.

How to reproduce:
1. Configure zabbix_agend.conf with 2 IP's for ServerActive
ServerActive=10.0.0.2,10.0.0.3

These will be 2 zabbix servers monitoring the same host with a trapper item configured.

2. Run zabbix_sender from the client to send data.
zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k test.key -o "testvalue"

Result:
Only the first server(10.0.0.2) will receive the info. The other server does not receive anything.

I hope this is sufficient info. If not please let me know

Thanks
Shaun



 Comments   
Comment by Tiago Cruz [ 2016 Nov 17 ]

Also, the verbose level should be more useful to debug this problem

Comment by bunkzilla [ 2018 Mar 24 ]

Any status on this? Would be helpful to have this functionality working!

Comment by Alexander Vladishev [ 2019 Jan 18 ]

Such behavior documented in man files and --help output of zabbix_sender binary. It will be converted to ZBXNEXT issue.

Comment by Mikhail Grigorev [ 2019 Feb 19 ]

Hi

Will this fix be available in 4.0 LTS?

Comment by Vitaly Zhuravlev [ 2019 Feb 19 ]

cherts , currently, it's planned for 4.2+ only. But you would be able to use Zabbix sender 4.2 with Zabbix server 4.0 without any issues as far as I see it.

Comment by Mikhail Grigorev [ 2019 Feb 19 ]

Well, you understand that using zabbix-agent version 4.0 and zabbix-sender 4.2+ with this feature is absurd.

It's like driving a  Zaporozhets with a engine Mercedes

Comment by Vitaly Zhuravlev [ 2019 Feb 19 ]

cherts , what's wrong with that?

Comment by Mikhail Grigorev [ 2019 Feb 20 ]

If you are using a DEB or RPM based Linux distribution, then using 2 versions of packages (zabbix-agent 4.0) and (zabbix-sender 4.2) on one server at the same time is not a good idea. I want to use the LTS version of zabbix and that it has all the necessary functionality.

Comment by Andris Mednis [ 2019 Feb 25 ]

(9) In sender_threads_wait() on Windows WaitForMultipleObjectsEx() is used to wait for all data-sending threads to finish, then it follows with WaitForSingleObject() for each thread in zbx_thread_wait(). Is that known to be a good solution - one WaitForMultipleObjectsEx() and then WaitForSingleObject() for every thread ?

Also - is it a good idea to use WaitForMultipleObjectsEx(..., ..., ..., INFINITE, ...) - i.e. no timeout at all ? Maybe it is better to set a long timeout. I'm afraid of deadlocks that infinite waiting can cause and user might have to intervene manually or even reboot the Windows server because of Zabbix agent.

<viktors.tjarve> The logic of calling one WaitForMultipleObjectsEx() and then WaitForSingleObject() for every thread is used in other places. The research to find out if that is the correct and the best approach I think is out of scope for this task. Maybe a DEV ticket should be created for this.
As for the INFINITE timeout - when the TCP connection is created for each thread a default socket timeout is set - GET_SENDER_TIMEOUT. This timeout is 60 seconds and all communication operations has to be completed during this time period or thread will exit with FAIL status.
CLOSED

Comment by Andris Mednis [ 2019 Mar 13 ]

We have noticed a strange error when zabbix_sender reads input values from file and runs under Valgrind on Linux.

The input file has 600 records.
The 1st batch of 250 records is sent as expected.
At he beginning of the 2nd batch of 250 records the current file position is corrupted (it is set 71 bytes backwards), it results in a corrupted record sent to server.
At he beginning of the 3rd batch of 250 records the current file position is again corrupted (it is set 6765 bytes backwards), as a result a number of records are sent to server twice.

Without Valgrind it works without error.

It has something to do with fork to send data in a separate process.
No actual sending is required, it happens even with "empty" function after fork in child process:

static ZBX_THREAD_ENTRY(send_value, args)
{
 _exit(SUCCEED);
}

Logging the current position, reported by ftell() shows corruption.
Saving the position before fork() with ftell() and restoring it with fseek() does not solve the issue (although produces different error).
Child process does not use the inherited input stream, it cannot close it because the file stream is not passed in arguments).

Comment by Viktors Tjarve [ 2019 Mar 14 ]

Added the somewhat unusual error message when using Zabbix sender compiled with TLS support to send data to Zabbix server/proxy compiled without TLS to TLS troubleshooting documentation - 3.0, 4.0, 4.2.

Sender side:

...End of zbx_tls_connect():FAIL error:'connection closed by peer'
...send value error: TCP successful, cannot establish TLS to [[localhost]:10051]: connection closed by peer
Comment by Viktors Tjarve [ 2019 Mar 15 ]

Released in:

  • 4.2.0rc1 r91025, r91090
Comment by Alexander Vladishev [ 2019 Apr 10 ]

Updated documentation:

Generated at Sat Apr 26 06:08:14 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.