Hi,
I am trying to add a host to a hostgroup using the python API
I get the groupid like this
group_id = zapi.hostgroup.get(output='extend',filter={"name":["group_name"]})
print group_id[0]['groupid']
19
and the hostID like this,
hostids=zapi.host.get(output='extend',filter={"hos t":["server_name"]})
print hostids[0]['hostid']
10122
Now I want to add the host with hostiD 10122 to the group with ID 19.
Somehow update isn't working for me. Can the ppl in the forum help please
I am trying to add a host to a hostgroup using the python API
I get the groupid like this
group_id = zapi.hostgroup.get(output='extend',filter={"name":["group_name"]})
print group_id[0]['groupid']
19
and the hostID like this,
hostids=zapi.host.get(output='extend',filter={"hos t":["server_name"]})
print hostids[0]['hostid']
10122
Now I want to add the host with hostiD 10122 to the group with ID 19.
Somehow update isn't working for me. Can the ppl in the forum help please
Comment