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

API host / error when trying to link template to an host

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Incomplete
    • Icon: Minor Minor
    • None
    • 1.8.4
    • API (A)
    • None

      I try to link hostid 10244 to templates :
      { 'params': {'templates': ['10059', '10228', '11176'],
      'hosts': [

      {'hostid': '10244'}

      ]},
      'jsonrpc': '2.0',
      'method': 'host.massUpdate',
      'auth': '162a55f1cdde6eaaa2aeed147f5a1332',
      'id': 6}

      response:
      {'jsonrpc': '2.0', 'id': 6, 'error': {'message': 'Application error.', 'code': -32500, 'data': '[ CTemplate::massAdd ] You do not have permission to perform this operation'}}

      the fix:

      api/classes/class.ctemplate.php:1152
      foreach($templates as $tnum => $template){

      • if(!isset($upd_templates[$template['templateid']]))
        Unknown macro: {+ if(!isset($upd_templates[$template])){ self::exception(ZBX_API_ERROR_PERMISSIONS, S_NO_PERMISSION); } }

            Unassigned Unassigned
            dakol dakol
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: