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

Hosts not auto deleted when not discovered anymore

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 4.0.2
    • Frontend (F)
    • None

      Zabbix 4.0.2, running on Ubuntu 18.04 with a PostgreSQL 10 database.

      I had initially installed version 3.4 then subsequently upgraded to 4.0.0 and then 4.0.2 using the instructions provided in the manual.

      I am trying to get the feature working where hosts are automatically deleted when they are no longer part of the discovery rule's IP range. It seems my hosts are never deleted and at the same time I can fully edit the host's details where it used to be read-only.

      Looking through the frontend PHP code, I notice a number of checks are done for ZBX_FLAG_DISCOVERED_CREATED along with checks for ts_delete. This is to indicate when hosts are scheduled to be deleted and to identify the ones that were created through a discovery rule? I might be misunderstanding the purpose of the flags.

      I see the database has a "flags" column in the "hosts" table but all my values are 0. When I set hosts I expected to be deleted to a flags value of "4" (which is the value I found in include/defines.inc.php) then the various fields on the Host Edit page do become read-only along with these error messages displayed:

      Undefined index: ts_delete [hosts.php:1374 → CView->render() → include() → get_header_host_table() in include/html.inc.php:357]

      Undefined index: name [hosts.php:1374 → CView->render() → include() in include/views/configuration.host.edit.php:55]

      Undefined index: itemid [hosts.php:1374 → CView->render() → include() in include/views/configuration.host.edit.php:56]

      I still don't notice any hosts being deleted even when re-running the discovery rules several times. I can't be sure of course that setting that one table entry is enough for this to work.

      I am seeing "undefined index" warnings on several pages. Are these expected or is this a sign of an upgrade maybe having gone wrong?

      I am willing to install Zabbix 4.0.2 from scratch but I would like some direction on how to save all the actions, triggers and network discovery rules I've created. Templates I can export and later on import again, but all those other item I can't seem to export.

            Unassigned Unassigned
            gbeekmans Gerard Beekmans
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: