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

API 'maintenance.get' sets internally invalid options for related query

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • None
    • 2.0.13, 2.2.6
    • API (A)
    • 'maintenance.get' with 'hostids' or/and 'groupids' parameter(s)

      CMaintenance.php / function get

      if user presets 'groupids' parameter,
      this function overrides 'selectGroups' parameter by value '1'

      if (!is_null($options['groupids']))

      { $options['selectGroups'] = 1; }


      so if user sets 'selectGroups' parameter (e.g.'extend') was lost..

      'selectGroups' parameter is used later at calls 'addRelatedObjects' function.
      this function internally calls api 'hostgroup.get',
      value of 'selectGroups' is set to 'hostgroup.get' 's 'output' parameter.

      Value '1' might be invalid...
      value of 'output' should be 'api query settings' e.g.'extend' 'refer'...

      I think as follows
      if user not presets 'selectGroups' parameter, then it needs set to 'refer'

      if (!is_null($options['groupids'])) {
      if (is_null($options['selectGroups']))

      { $options['selectGroups'] = API_OUTPUT_REFER; }

      }

      There is the same issue with 'hosts' and 'selectHosts'...

            Unassigned Unassigned
            fripper Fripper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: