-
Problem report
-
Resolution: Fixed
-
Critical
-
4.0.5
-
Sprint 51 (Apr 2019)
-
0.5
How to reproduce:
1. Create host with 2 same type interfaces. For example, Zabbix Agent
{ "jsonrpc": "2.0", "method": "hostinterface.get", "params": { "output": "extend", "hostids": "10319" }, "auth": "4c039068a9b6986bb6e8a6bc1ed71ae9", "id": 1 }
{ "jsonrpc": "2.0", "result": [ { "interfaceid": "64", "hostid": "10319", "main": "0", "type": "1", "useip": "1", "ip": "127.0.0.1", "dns": "", "port": "10050", "bulk": "1" }, { "interfaceid": "86", "hostid": "10319", "main": "1", "type": "1", "useip": "1", "ip": "127.0.0.1", "dns": "", "port": "30051", "bulk": "1" } ], "id": 1 }
2. Set to non-main interface main: 1 via the hostinterface.update method.
{ "jsonrpc": "2.0", "method": "hostinterface.update", "params": { "interfaceid": "64", "main": "1" }, "auth": "4c039068a9b6986bb6e8a6bc1ed71ae9", "id": 1 }
{ "jsonrpc": "2.0", "result": { "interfaceids": [ "64" ] }, "id": 1 }
*Result: *
1. There will be two interfaces with the "main": "1" parameter
{ "jsonrpc": "2.0", "result": [ { "interfaceid": "64", "hostid": "10319", "main": "1", "type": "1", "useip": "1", "ip": "127.0.0.1", "dns": "", "port": "10050", "bulk": "1" }, { "interfaceid": "86", "hostid": "10319", "main": "1", "type": "1", "useip": "1", "ip": "127.0.0.1", "dns": "", "port": "30051", "bulk": "1" } ], "id": 1 }
2. The host configuration page "breaks".
Expected result:
The hostinterface.update method must downgrade previous main(default) interface to non-default.