The function of object (host or service) ID

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hyacinth
Posts: 19
Joined: Wed Dec 13, 2017 2:21 am

The function of object (host or service) ID

Post by hyacinth »

Dear,
I find in XI CCM page each monitor host and service has its own ID as attached. How can we make use of the ID ? Hope Nagios can give me a professional advice. Thanks !
You do not have the required permissions to view the files attached to this post.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: The function of object (host or service) ID

Post by mcapra »

hyacinth wrote:How can we make use of the ID ?
That is an auto-incremented integer and MySQL primary key. It can be used as a unique identifier for a given Nagios configuration object. Note that each object has it's own primary key, eg you can have a host with "id 1" and a service with "id 1". I think anyway; It's been a while since I've actually laid eyes on the schema.

It's not terribly useful for most third-party integrations, but it could be used as a reference to a specific Nagios configuration object. Using SQL as pseudo-code, WHERE host.id=1 sort of stuff.
Former Nagios employee
https://www.mcapra.com/
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: The function of object (host or service) ID

Post by cdienger »

I can't say I've ever really needed it for anything but I suppose it would be useful to help find items in the database. You can get a description of each table with:

echo "describe nagios_hosts" | mysql -unagiosxi -pnagiosxi -Dnagios
echo "describe nagios_services" | mysql -unagiosxi -pnagiosxi -Dnagios
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked