the problem with hostgroups is that you can't use them with service groups, a royal pain for me. So we've been pulling services out of hostgroups because of how we're wanting to use metrics, which pushes us to servicegroups.krutaw wrote:Here's what we do. I assign services to hostgroups and then update the host to assign a hostgroup to the host, effectively assigning the service to the host. This allows for singular services to be applied across multiple hosts without having to redefine the services over and over. Further, I define OS hostgroups so that standard checks for say windows or linux can be assigned at the host level and then add hostgroups for the custom checks only where necessary.johncwelch wrote:So to start off, I did read this post: https://support.nagios.com/forum/viewto ... =6&t=36401
But it seems to be for creating new services and adding them to a host. I have a number of existing services (Windows C: Drive utilization for example), and I want to automate adding hosts to that service. All the parameters are already set, I just need to append a new host to that service.
Is this doable via the API?
Adding existing services to host via REST API
-
johncwelch
- Posts: 22
- Joined: Mon Jun 15, 2015 8:04 am
Re: Adding existing services to host via REST API
-
johncwelch
- Posts: 22
- Joined: Mon Jun 15, 2015 8:04 am
Re: Adding existing services to host via REST API
will do. Looks like the next addition to the REST api needs to be finer-grained control for services, etc., so we can add hosts without rebuilding every time.lmiltchev wrote:@johncwelch let us know if you have any more questions. Thank you!
Re: Adding existing services to host via REST API
Thanks for the feedback @ johncwelch! seems like the biggest number of requests are about the ability to modify existing objects without the need to delete/re-add them. There is a problem at the moment with the host_name, but this should be fixed in the future. REST API is being constantly updated and improved. BTW, there are some cool new features to come in Nagios XI 5.5!
Be sure to check out our Knowledgebase for helpful articles and solutions!