host host_id

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

host host_id

Post by elinagios »

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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: host host_id

Post by npolovenko »

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.
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

Re: host host_id

Post by elinagios »

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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: host host_id

Post by lmiltchev »

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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked