Hi
we have a system that gets nagiosxi hosts and services via NagiosXI Rest API. The system uses host ID as primary identifier. Now the problem is that when you change hostname, the ID changes. Is it possible to somehow get the previous ID with the API?
Regards,
Mirgo
host host_id
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: host host_id
Hello, @elinagios. Nagios doesn't keep track of object IDs in the rest API. Is there a particular reason why you can't use a hostname as the identifier?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: host host_id
You can use, we have a external system that gets Nagios hosts and services via API and we put comments to those services/hosts. Once we change hostname in Nagios XI, it creates a new host+services to our external system and all the comments stay with the old host/service.
Re: host host_id
As @npolovenko mentioned, there is no way to track the old object ID in the REST API. However, you could track some other attributes instead. Why not adding the "original" id into the host's notes. Then you could use it as a primary identifier (as it won't change after changing the host name), provided you don't put your comments for these services/hosts in notes.
CCM > Hosts > <your host> Misc Settings > Notes
CCM > Services > <your service> Misc Settings > Notes
CCM > Hosts > <your host> Misc Settings > Notes
CCM > Services > <your service> Misc Settings > Notes
Be sure to check out our Knowledgebase for helpful articles and solutions!