Hi,
I have the rest API to add a host to a single service but would like to know if there is any API available which can add a host to a service group?
thanks
Parthiv
How to add a Host to a service Group using NagiosXI rest API
-
parthiv39731
- Posts: 8
- Joined: Mon Dec 28, 2015 1:14 pm
Re: How to add a Host to a service Group using NagiosXI rest
You can add a service to a host, hostgroup or a servicegroup. You can also add a host to a hostgroup. However, you cannot add a host to a servicegroup... unless I am missing something obvious. Let's step aside from the REST API for a while and see if this can be done at all in Nagios XI or Nagios Core. Can you show us an example config, demonstrating what you would like to accomplish?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
parthiv39731
- Posts: 8
- Joined: Mon Dec 28, 2015 1:14 pm
Re: How to add a Host to a service Group using NagiosXI rest
my apologies, I got your point after going through the functionality on the portal. My goal is to register a set of standard services on a Host instead of adding the services one by one every time a server is provisioned. Based up your inputs I believe services can be added in to Host group and hence if the host is added in to the host group it would automatically subscribe to the services of the host group as well.
So is there any API which can be used for -
>>adding the host to the host group
>>adding the services to the host group
So is there any API which can be used for -
>>adding the host to the host group
>>adding the services to the host group
Re: How to add a Host to a service Group using NagiosXI rest
Looking through the API documentation, I don't believe it is possible at the moment. I will reach out to the developers first thing tomorrow morning, and get a more official answer for you.
Former Nagios Employee.
me.
me.
Re: How to add a Host to a service Group using NagiosXI rest
Once of our other support technicians informed me that we have a feature request in place for this, but it is not currently possible.
Former Nagios Employee.
me.
me.
-
parthiv39731
- Posts: 8
- Joined: Mon Dec 28, 2015 1:14 pm
Re: How to add a Host to a service Group using NagiosXI rest
can it be done through any command line which can be executed on the Nagios Server.
Re: How to add a Host to a service Group using NagiosXI rest
Former Nagios Employee.
me.
me.
-
parthiv39731
- Posts: 8
- Joined: Mon Dec 28, 2015 1:14 pm
Re: How to add a Host to a service Group using NagiosXI rest
I was mostly looking for some CLI commands or scripts which can be run on the server to add the host to the host group. The link posted refers to something else.
Re: How to add a Host to a service Group using NagiosXI rest
What I was getting at is you could write a script to write the configuration files, drop them in this directory, and then reapply the configuration. It's not the cleanest solution, but it's one route you can pursue.
Former Nagios Employee.
me.
me.