Create and Rotate users in Contactgroup programatically.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
Sargento
Posts: 42
Joined: Tue Feb 23, 2021 6:32 am

Create and Rotate users in Contactgroup programatically.

Post by Sargento »

All,

We want to create a contact group through the Nagios REST API but I've been struggling to find a doc about this task online. I need your help here. The below text is what I have so far (not working).

curl -XGET "http://(IP)/nagiosxi/api/v1/system/status?apikey=(API KEY)&pretty=1" -d "contactgroup_name=(API-CONTACT-GROUP)&alias=(API-CONTACT-GROUP)&members=(MEMBERNAME)"

Basically we want to create a group through the API and then have the group members change once a week or so. So the programming side of changing the user isn't the problem here it's figuring out the curl command to actually create the group or change the user of an existing group.

Any help would be great. There was a post on here from 2017 that says this functionality didn't exist yet but it was coming soon so I'm hoping that this is possible.

Thanks
Sargento
Posts: 42
Joined: Tue Feb 23, 2021 6:32 am

Re: Create and Rotate users in Contactgroup programatically.

Post by Sargento »

Here is the answer I was looking for.

curl -XPUT "http://(ip)/nagiosxi/api/v1/config/contactgroup/(contactgroupname)?apikey=(apikey)&pretty=1&members=(membername)&applyconfig=1"
Post Reply