[ZBX-5208] Add a new JMX Interface via api fails Created: 2012 Jun 18  Updated: 2017 May 30  Resolved: 2012 Jun 29

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 2.0.1rc1
Fix Version/s: 2.0.2rc1, 2.1.0

Type: Incident report Priority: Major
Reporter: Thorsten Kohlhepp Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

debian 6.0


Attachments: Text File add_new_interface.log    

 Description   

when trying to add a new interface with json
{
"auth":"dd2ff148338334ef917547f21a25749f",
"method":"host.update",
"id":1,
"params":{
"hostid":10017,
"interfaces":

{ "dns":"", "main":1, "hostid":10017, "useip":1, "type":4, "ip":"127.0.0.1", "port":"8810" }

},
"jsonrpc":"2.0"
}

I'll get an error SON-rpc error generation failed. No such error "".
See atteched log for details
thorko79



 Comments   
Comment by Pavels Jelisejevs (Inactive) [ 2012 Jun 25 ]

There's a bug with the host.update method, it currently only accepts an array of interfaces, and doesn't work when passing a single interface. By the way, host.update will not add a new interface, it will replace all interfaces on the host. If you need to add just one interface, use the hostinterface.create method.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jun 25 ]

(1) Related issue: updating interfaces with host.massupdate doesn't seem to work at all.

<pavels> RESOLVED.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jun 25 ]

RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-5208.

Comment by Eduards Samersovs (Inactive) [ 2012 Jun 26 ]

(2)

If you want to update interfaces you can use, for example, this json query:
{
"auth":"dd2ff148338334ef917547f21a25749f",
"method":"hostinterface.update",
"id":1,
"params":

{ "dns": "", "main": 1, "interfaceid": "100100000000006", "useip": 1, "type": 4, "ip": "127.0.0.1", "port": "8810" }

,
"jsonrpc":"2.0"
}

<richlv> let's document at least some of that in the manual

<pavels> The hostinterface API will be documented when we're done with the new documentation format.

<richlv> sounds good, but let's do it in this issue then

<pavels> We and Zalex agreed, that we will open separate issues for docs, it will be more convenient that way. CLOSED.

<richlv> please, create a new issue for this specific case and mention it here - thanks REOPENED

<pavels> Done ZBX-5256. CLOSED.

Comment by Eduards Samersovs (Inactive) [ 2012 Jun 26 ]

Tested

Comment by Thorsten Kohlhepp [ 2012 Jun 27 ]

hostinterface.create method works just fine. Thanks guys.
But it would be nice to have these methods documented in the manual as richlv already mentioned.
Cheers

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jun 28 ]

Fixed in 2.0 r28509 and trunk r28510.

CLOSED.

Generated at Wed Apr 24 23:27:57 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.