I was going through this when I realized that if I have the same service attached to 50 hosts, it gets 50 separate entries in the return for GET Objects/Service, and each entry is treated like a completely separate service.
This creates a huge amount of work if one wants to get, say a list of services the way you'd see them in the web ui. It effectively makes getting service or servicestatus unusable given the massive amount of duplicate data you can get from even a smallish Nagios instance.
The fact that I have say, "Windows CPU Usage" as a service with 200 hosts shouldn't return 200 separate instances of that service. At worst, I should get a single return with a very long list of hosts and or hostgroups. This needs to be changed.
GET Objects/Service
Re: GET Objects/Service
GET Objects/Service is showing the objects (whatever core sees), not the configuration. Basically, if you added a service to let's say 100 hosts, you would see it as a "separate" service (object) under each and every one of these hosts.
GET Objects/Service is NOT showing a "listing of configuration". I hope this makes sense.
It's possible to add this functionality in the future but please keep in mind that the decision to implement the enhancement is at the sole discretion of our development team.
GET Objects/Service is NOT showing a "listing of configuration". I hope this makes sense.
It's possible to add this functionality in the future but please keep in mind that the decision to implement the enhancement is at the sole discretion of our development team.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
johncwelch
- Posts: 22
- Joined: Mon Jun 15, 2015 8:04 am
Re: GET Objects/Service
Right, but that's not how you view it in CCM. In CCM, you can have one service, with multiple hosts. You *can* do it the other way, with one service per host, but that scales not at all, and I think every nagios admin soon learns that if you have 100 hosts that need the *exact same service*, you create the service and add the hosts.GET Objects/Service is showing the objects (whatever core sees), not the configuration. Basically, if you added a service to let's say 100 hosts, you would see it as a "separate" service (object) under each and every one of these hosts.
The issue here is that what the API returns doesn't allow for the one service with many hosts, it forces you to always see one service per host, even if that's not how the Web UI shows it.
In any event, it makes the GET Objects/Service very close to useless as an API call because it requires massive amounts of manual de-duplication. In one case, I'd have almost 700 hosts that I'd have to manage that for, and I have multiple servers. The idea, usually, of an API is to increase efficiency, not make things more difficult.
It's not like GET Objects/Host or hoststatus tells you what services that host has, so there's literally no effcient way to do this via the API.
Re: GET Objects/Service
You're right that the objects/service API endpoint will only show you the objects that Core has already flattened. This is how the old API did it also, we still have a lot of improvements to make on the API and we are working on them. What you're really asking for is an API endpoint in config/service that would be the one that would show you only the one service even if it was applied to many hosts. Because of the linking we couldn't get it into XI 5.5 but hopefully we can get it into 5.6. There are lots of changes for the API on the roadmap (mostly just additional endpoints or more data) for the next few versions of XI.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.