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

API requires unnecessary param to create an snmp-trap template item

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • 6.0.12, 6.2.6, 6.4.0beta6
    • API (A)

      Steps to reproduce:

      1. Try to create an snmp-trap item for any template with API

      Result:
      See debug output:

      Sending:

      {'jsonrpc': '2.0', 'method': 'item.create', 'params': {'hostid': '14494', 'name': 'test', 'type': 17, 'key_': 'snmptrap[test]', 'value_type': 2}, 'id': 2, 'auth': 'my_token'}
      

      Response Code: 200
      Response Body:

      {'jsonrpc': '2.0', 'error': {'code': -32602, 'message': 'Invalid params.', 'data': 'Incorrect arguments passed to function.'}, 'id': 2} 
      ('Error -32602: Invalid params., Incorrect arguments passed to function.', -32602)
      

      When i added the delay param with random value, for example 1, it works fine:

      Sending:

      {'jsonrpc': '2.0', 'method': 'item.create', 'params': {'hostid': '14494', 'name': 'test', 'type': 17, 'key_': 'snmptrap[test]', {*}'delay': 1{*}, 'value_type': 2}, 'id': 2, 'auth': 'my_token'}
      

      Response Code: 200
      Response Body:

      {'jsonrpc': '2.0', 'result': {'itemids': ['1345814']}, 'id': 2}
      

      There is no such option in web-interface for creating an snmp-trap item. 

            zabbix.dev Zabbix Development Team
            hasculdr Шепилов Семён
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: