Adding a hostgroup to a host definition using REST API
Posted: Thu Apr 27, 2017 4:41 pm
Hi,
I have added few hosts in Nagiosxi and I have added hostgroups in the host definitions instead of adding them as a member in hostgroup definition. I now want to add another hostgroup to one of the hosts keeping its already added hostgroups intact.
I know I can do it from UI using manage hostgroups but can someone help me if there is a way to do it using command line? May be using REST API or Database query? I need it to put in a script.
I am OK to delete the hosts and recreate but I first need the list of already existing hostgroups in that host definition before deleting and recreating.
I have tried following REST API but it doesn't give hostgroups list in the output.
http://NagiosHost/nagiosxi/api/v1/objec ... v&pretty=1
Thanks for your help in advance.
I have added few hosts in Nagiosxi and I have added hostgroups in the host definitions instead of adding them as a member in hostgroup definition. I now want to add another hostgroup to one of the hosts keeping its already added hostgroups intact.
I know I can do it from UI using manage hostgroups but can someone help me if there is a way to do it using command line? May be using REST API or Database query? I need it to put in a script.
I am OK to delete the hosts and recreate but I first need the list of already existing hostgroups in that host definition before deleting and recreating.
I have tried following REST API but it doesn't give hostgroups list in the output.
http://NagiosHost/nagiosxi/api/v1/objec ... v&pretty=1
Thanks for your help in advance.