Page 1 of 1
The function of object (host or service) ID
Posted: Fri Mar 16, 2018 4:36 am
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 !
Re: The function of object (host or service) ID
Posted: Fri Mar 16, 2018 9:08 am
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.
Re: The function of object (host or service) ID
Posted: Fri Mar 16, 2018 10:52 am
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