ExportXMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Major
    • 8.0.1rc1, 8.2.0alpha1
    • Affects Version/s: 8.0.0rc3
    • Component/s: Server (S)
    • None
    • Prev.Sprint, S26-W44/45
    • 0.125

      op_host_enable() in src/zabbix_server/operations/operations.c:1272 passes the wrong value to the WHERE clause of its update. It passes the h->status where the h->hostid must be:

        if (HOST_STATUS_MONITORED != h->status)
        {
                zbx_db_execute("update hosts"
                                " set status=%d"
                                " where hostid=" ZBX_FS_UI64,
                                HOST_STATUS_MONITORED, h->status);

      Impact:
        - Host stays disabled: the "Enable host" operation has no effect on the discovered or autoregistered host, so it is not monitored.
        - Wrong host can be changed: if a host with hostid=1 exists, it is enabled instead. If not, the update affects 0 rows and no error is reported.
        - Misleading audit log: zbx_audit_host_update_json_update_host_status() runs with the correct h->hostid, so the audit log shows the host as enabled when it wasn't.

      Steps to reproduce:
        1. Create a host through network discovery or autoregistration, then disable it.
        2. Configure a discovery or autoregistration action with the "Enable host" operation.
        3. Trigger the action, for example by restarting the agent so it autoregisters again.
       
      Expected result: the host's status becomes Enabled (hosts.status=0).

            Assignee:
            Sergejs Olonkins
            Reporter:
            Michael Veksler
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h