Report that shows key information about Checks.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
QS1
Posts: 195
Joined: Tue Sep 21, 2010 3:30 pm

Re: Report that shows key information about Checks.

Post by QS1 »

tonyyarusso wrote:Good luck - let us know how it goes!
SO far I have found most of it in SQL. Loaded MySQL Workbench so that we can have a gui fronted. Very impressive. Thanks.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Report that shows key information about Checks.

Post by mguthrie »

Not sure if this is helpful or not, but both the Nagios Core Interface and the Nagios V-Shell interface have the ability to view configurations in a table for just about anything that there is a config file for. You can access the Core interface on your XI box by going to http://<yourserver>/nagios
configscreenshot.jpg
You do not have the required permissions to view the files attached to this post.
QS1
Posts: 195
Joined: Tue Sep 21, 2010 3:30 pm

Re: Report that shows key information about Checks.

Post by QS1 »

mguthrie wrote:Not sure if this is helpful or not, but both the Nagios Core Interface and the Nagios V-Shell interface have the ability to view configurations in a table for just about anything that there is a config file for. You can access the Core interface on your XI box by going to http://<yourserver>/nagios
configscreenshot.jpg
Excellent, that is good to know. We wrote a really good QRY to get everything we need and more. If anyone else needs it I can post it here. Thanks
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Report that shows key information about Checks.

Post by rdedon »

Definitely! And much appreciated as with all your hard work :-)
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
QS1
Posts: 195
Joined: Tue Sep 21, 2010 3:30 pm

Re: Report that shows key information about Checks.

Post by QS1 »

rdedon wrote:Definitely! And much appreciated as with all your hard work :-)

No problem, used MySQL WorkBench


For Service:
SELECT s.id as 'Service ID',
h.host_name as 'Host Name',
s.config_name as 'Service Name',
s.service_description as 'Check Details',
s.max_check_attempts as 'Max Check Attempts',
s.check_interval as 'Normal Check Interval',
s.retry_interval as 'Retry Check Interval',
tp.timeperiod_name as 'Check Period',
con.contact_name as 'Contact Name',
cg.contactgroup_name as 'Contact Group',
tp2.timeperiod_name as 'Notification Period',
"" as 'Ports Open'



FROM tbl_service s left join tbl_lnkServiceToContact stc on (s.id=stc.idMaster)
left join tbl_contact con on (stc.idSlave = con.id)
left join tbl_lnkServiceToContactgroup stcg on (s.id = stcg.idMaster)
left join tbl_contactgroup cg on (stcg.idSlave = cg.id)
left join tbl_timeperiod tp on (s.check_period = tp.id)
left join tbl_timeperiod tp2 on (s.notification_interval = tp2.id)
left join tbl_lnkServiceToHost sth on (s.id = sth.idMaster)
left join tbl_host h on (sth.idSlave = h.id)






For Host:
SELECT h.id as 'Host ID',
h.host_name as 'Host Name',
h.address as 'Host IP',
"" as 'Check Details',
h.max_check_attempts as 'Max Check Attempts',
h.check_interval as 'Normal Check Interval',
h.retry_interval as 'Retry Check Interval',
tp.timeperiod_name as 'Check Period',
con.contact_name as 'Contact Name',
cg.contactgroup_name as 'Contact Group',
tp2.timeperiod_name as 'Notification Period',
h.hostgroups as 'Host Groups',
"" as 'Ports Open'


FROM tbl_host h left join tbl_lnkHostToContact htc on (h.id=htc.idMaster)
left join tbl_contact con on (htc.idSlave = con.id)
left join tbl_lnkHostToContactgroup htcg on (h.id = htcg.idMaster)
left join tbl_contactgroup cg on (htcg.idSlave = cg.id)
left join tbl_timeperiod tp on (h.check_period = tp.id)
left join tbl_timeperiod tp2 on (h.notification_interval = tp2.id)



Also we had to make sure "nagiosql" was the default Schema.
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Report that shows key information about Checks.

Post by rdedon »

Most excellent and thanks again.
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
Locked