-
Problem report
-
Resolution: Fixed
-
Major
-
4.0.29, 5.0.12, 5.4.1, 6.0.0alpha1
-
CentOS 7
Alpine 3.13/fping 5.0
-
Sprint 77 (Jun 2021), Sprint 78 (Jul 2021)
-
1
I found icmpping items become unsupported state when zabbix-server is interrupted by any signal, such as SIGUSR1 (runtime control) or others.
I tested on Zabbix-4.0.29 on CentOS 7, but it can occur on other versions and platforms.
Here is zabbix_server.log messages.
7268:20210318:151118.309 item "test02:icmpping[,2,2000,,2000]" became not supported: fping failed: no output 7276:20210318:151124.360 item "test01:icmpping[,2,2000,,2000]" became not supported: fping failed: 10.2.190.177 : [0], 84 bytes, 0.27 ms (0.27 avg, 0% loss)
It looks fping unexpectedly exited and zabbix-server could not get fping results.
I investigated the cause and figured out that fgets() returns NULL and set errno=EINTR if it is interrupted by a signal. But zabbix-server does not check errno and break fgets() loop.
So we maybe need to retry to call fgets() in the case. I made a patch to fix the problem. Would you mind checking it?
Steps to reproduce:
- install zabbix-server
- add hosts and configure icmpping items
- keep executing runtime control many times (e.g., zabbix_server -R log_level_increase)
- icmpping items become unsupported
Result:
zabbix-server can not get fping result and icmpping items become unsupported.
Expected:
icmpping does not become unsupported.
P.S., similar problems might occur elsewhere using fgets(), but I have not checked.