zabbix 添加主机组的时候如何同时添加主机

范海星 发布于 2011/12/14 11:53
阅读 1K+
收藏 0

大家好,我需要调用zabbix1.8的api中的添加主机组的create接口(http://www.zabbix.com/documentation/1.8/api/hostgroup/create),请问如何拼写JSON字符串才能在添加主机组的时候同时添加主机。

同样添加用户组的时候添加用户,我拼写的JSON字符串是:{"jsonrpc":"2.0","method":"usergroup.create","id":1,"auth":"27df2b86a1702e0dcbeaced308a40c2c","params":[{"users_status":"1","name":"Debug Group2","api_access":"1","debug_mode":"1","gui_access":"1","userids":["39","40"]}]}
结果可以添加。同样照葫芦画瓢,应用到主机组上面,添加不进来。主机组拼的JSON字符串是:{"jsonrpc":"2.0","method":"hostgroup.create","id":1,"auth":"46946e61d54df1c7318aae07de45f732","params":{"hostids":["10081","10082"],"name":"test hostname14","internal":"0"}}

请大家指教,看看小弟的哪里出现错误,应该怎么修改,谢谢。

加载中
返回顶部
顶部