Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-19134

icmpping becomes unsupported when zabbix-server catches a signal

    XMLWordPrintable

    Details

    • Team:
      Team A
    • Sprint:
      Sprint 77 (Jun 2021), Sprint 78 (Jul 2021)
    • Story Points:
      1

      Description

      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:

      1. install zabbix-server
      2. add hosts and configure icmpping items
      3. keep executing runtime control many times (e.g., zabbix_server -R log_level_increase)
      4. 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.

        Attachments

        1. fix-icmpping-fgets.patch
          1 kB
          Kento Takahashi
        2. Screenshot 2021-06-16 at 10.39.13.png
          67 kB
          Edgar Akhmetshin

          Activity

            People

            Assignee:
            dgoloscapov Dmitrijs Goloscapovs
            Reporter:
            kento.takahashi Kento Takahashi
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: