Page 1 of 1

MySQL Schema question

Posted: Fri Dec 27, 2019 3:36 pm
by seaward1983
RHEL 6.x
NagiosXI 5.6.9
VMWare

Long way around the barn - but here goes
I added all my hosts for ICMP. I export, regularly, our device list from our managed service provided, compare, and add what is missing. To find out what hosts exists in NagiosXI - I run this query:

use nagios;
select display_name, address from nagios_hosts;

I then export the list, and run a compare. Easy enough.

I'm now adding services, but I'm adding the servers by "type", to make adding by bulk as painless as I can. Is there a way to run a MySQL query to see how many systems I've added services to?

Thank you in advance.

Re: MySQL Schema question

Posted: Fri Dec 27, 2019 4:22 pm
by scottwilkerson
These would be the objects that are active and have services

Code: Select all

select name1 AS HOST from nagios_objects where is_active=1 AND objecttype_id=2 group by name1;

Re: MySQL Schema question

Posted: Fri Dec 27, 2019 4:30 pm
by seaward1983
PERFECT!! Exactly what I needed.

Re: MySQL Schema question

Posted: Fri Dec 27, 2019 4:44 pm
by scottwilkerson
seaward1983 wrote:PERFECT!! Exactly what I needed.
Great!

Locking thread