Icinga / icinga-reports

Icinga Reports 1.x MySQL (EOL 31.12.2018)
GNU General Public License v2.0
14 stars 13 forks source link

[dev.icinga.com #3686] Host Overview - Empty contacts & contactgroups #42

Closed icinga-migration closed 11 years ago

icinga-migration commented 11 years ago

This issue has been migrated from Redmine: https://dev.icinga.com/issues/3686

Created by tkoeberl on 2013-02-11 08:48:58 +00:00

Assignee: mfriedrich Status: Resolved (closed on 2013-03-03 18:55:14 +00:00) Target Version: 1.8.2 Last Update: 2013-03-03 18:55:14 +00:00 (in Redmine)

Icinga Version: 1.8.3
DB Type: MySQL
DB Version: mysql  Ver 14.14 
Jasper Version: 5.0.0

In the Host Overview Report, the sub dataset with the contactgroups is empty.

Attachments

Changesets

2013-03-03 18:51:02 +00:00 by (unknown) cac85a78a0a0e790186a9871e94f2f7b8dce1326

fix empty contacts and contactgroups in host overview

fixes #3686

2013-03-03 19:40:57 +00:00 by (unknown) 51d35aeb05ac8c339c4b910c836e91c3d6bac42b

fix empty contacts and contactgroups in host overview

fixes #3686
icinga-migration commented 11 years ago

Updated by tkoeberl on 2013-02-11 08:53:26 +00:00

icinga-migration commented 11 years ago

Updated by mfriedrich on 2013-02-12 19:49:09 +00:00

for discussion and a possible fix, check http://www.monitoring-portal.org/wbb/index.php?page=Thread&postID=184032#post184032

patches as usual welcome!

icinga-migration commented 11 years ago

Updated by mfriedrich on 2013-03-03 17:29:58 +00:00

from the discussion, grepped for the string outputs on the report.

jasperreports/templates/sub/host/contactgroups.jrxml

will test my fix now.

icinga-migration commented 11 years ago

Updated by mfriedrich on 2013-03-03 17:53:59 +00:00

same goes for contacts.jrxml where the join is missing as well. host_id != host_object_id

icinga-migration commented 11 years ago

Updated by mfriedrich on 2013-03-03 18:39:50 +00:00

ok, the contacts query is a bit more broken too. the join of icinga_contacts with icinga_hosts_contacts must be done on the contact_object_id in both cases. the contact_id itsself is just an incremented primary key of the icinga_contacts table, and useless on joins when select objects (select from where is an implicit join).

this query is correct and works in my tests.

select a.name1,
  b.alias,
  b.email_address
from icinga_objects a,
  icinga_contacts b,
  icinga_host_contacts c,
  icinga_hosts d
where a.object_id = b.contact_object_id
and b.contact_object_id  = c.contact_object_id
and c.host_id     = d.host_id
and d.host_object_id = 263;
icinga-migration commented 11 years ago

Updated by mfriedrich on 2013-03-03 18:45:57 +00:00

i'm using this config to the contact - https://git.icinga.org/?p=icinga-core.git;a=blob;f=tests/etc/1502.cfg;hb=HEAD and this one for the contactgroup - https://git.icinga.org/?p=icinga-core.git;a=blob;f=tests/etc/1066.cfg;hb=HEAD

the generic contacts are to be found here - https://git.icinga.org/?p=icinga-core.git;a=blob;f=tests/etc/contacts.cfg;hb=HEAD

fixed host contactgroup

icinga_reporting_1.8_host_contactgroups_fixed.png

fixed host contact

icinga_reporting_1.8_host_contacts_fixed.png

icinga-migration commented 11 years ago

Updated by mfriedrich on 2013-03-03 18:55:14 +00:00

works for me.