Page 2 of 2

Re: Report that shows key information about Checks.

Posted: Tue Jan 11, 2011 3:40 pm
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.

Re: Report that shows key information about Checks.

Posted: Wed Jan 12, 2011 10:46 am
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

Re: Report that shows key information about Checks.

Posted: Wed Jan 26, 2011 4:55 pm
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

Re: Report that shows key information about Checks.

Posted: Thu Jan 27, 2011 3:46 pm
by rdedon
Definitely! And much appreciated as with all your hard work :-)

Re: Report that shows key information about Checks.

Posted: Wed Feb 02, 2011 8:38 am
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.

Re: Report that shows key information about Checks.

Posted: Thu Feb 03, 2011 10:41 am
by rdedon
Most excellent and thanks again.