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

trigger.get API cannot expand macros for non-superadmin users

    XMLWordPrintable

Details

    • Problem report
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 5.4.3
    • None
    • API (A)
    • None

    Description

      If you query the trigger.get API using a non-superadmin account with "expandComment": true, "expandDescription": true, or "expandExpression": true, these parameters are ignored.

      Here is the output of sending the following JSON body using a non-superadmin account.

      Sent:

      {"jsonrpc": "2.0", "method": "trigger.get", "params": {"triggerids": ["130640"], "expandComment": true, "expandDescription": true, "expandExpression": true}, "auth": "ae3569d11dad48e50a2bbb009414fa13", "id": 1} 

       Received:

      [{'triggerid': '130640',
        'expression': 'min(/my_host/perf_counter_en["\\PhysicalDisk(0 C:)\\Avg. Disk sec/Write",60],15m) > {$VFS.DEV.WRITE.AWAIT.WARN:"0 C:"}',
        'description': '0 C:: Disk write request responses are too high (write > {$VFS.DEV.WRITE.AWAIT.WARN:"0 C:"}s for 15m)',
        'url': '',
        'status': '0',
        'value': '1',
        'priority': '2',
        'lastchange': '1632467660',
        'comments': 'This trigger might indicate disk 0 C: saturation.',
        'error': '',
        'templateid': '0',
        'type': '0',
        'state': '0',
        'flags': '4',
        'recovery_mode': '0',
        'recovery_expression': '',
        'correlation_mode': '0',
        'correlation_tag': '',
        'manual_close': '1',
        'opdata': '',
        'event_name': '',
        'uuid': ''}] 

      (notice the unexpanded macros)

      Here is the output making the same request from a superadmin account:

      Sent:

      {"jsonrpc": "2.0", "method": "trigger.get", "params": {"triggerids": ["130640"], "expandComment": true, "expandDescription": true, "expandExpression": true}, "auth": "bb02d12eaf1f5b46a319dcd86a4808bc", "id": 1}

      Received:

      [{'triggerid': '130640',
        'expression': 'min(/my_host/perf_counter_en["\\PhysicalDisk(0 C:)\\Avg. Disk sec/Write",60],15m) > 0.02',
        'description': '0 C:: Disk write request responses are too high (write > 0.02s for 15m)',
        'url': '',
        'status': '0',
        'value': '0',
        'priority': '2',
        'lastchange': '1632469402',
        'comments': 'This trigger might indicate disk 0 C: saturation.',
        'error': '',
        'templateid': '0',
        'type': '0',
        'state': '0',
        'flags': '4',
        'recovery_mode': '0',
        'recovery_expression': '',
        'correlation_mode': '0',
        'correlation_tag': '',
        'manual_close': '1',
        'opdata': '',
        'event_name': '',
        'uuid': ''}] 

      This bug is quite painful because we don't want everyone who watches the monitoring to be a superadmin.

      Attachments

        Activity

          People

            ksalins Karlis Salins
            alex.hunsberger Alex Hunsberger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: