Steps to reproduce:
- 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.