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

Updating macros using Host.massUpdate()

XMLWordPrintable

      If we have a couple of hosts, one of which has a host macro with hostmacroid 28, then the following API request will update the given macro, but delete all of the other macros on both hosts.

      API::Host()->massUpdate(array(
      'macros' => array(
      'hostmacroid' => 28,
      'macro' => '{$C}',
      'value' => 3
      ),
      'hosts' => array(
      array('hostid' => 10116),
      array('hostid' => 10091),
      )
      ));

      This seems illogical, the massUpdate method should just replace all of the macros on both hosts with the given macros, and passing a 'hostmacroid' should probably trigger an error.

      I haven't checked, but there maybe similar problems with other massUpdate methods.

            Unassigned Unassigned
            jelisejev Pavels Jelisejevs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: