Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #4629] SQL-Statement in Sub-Template "Contacts" doesn't work #62

Open
icinga-migration opened this issue Aug 23, 2013 · 1 comment

Comments

@icinga-migration
Copy link

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

Created by jschanz on 2013-08-23 10:04:48 +00:00

Assignee: (none)
Status: New
Target Version: Backlog
Last Update: 2015-05-18 12:17:47 +00:00 (in Redmine)

Icinga Version: 1.9.2
DB Type: MySQL
DB Version: 1.9.0
Jasper Version: 4.7.0

SQL-Statement from reporting package 1.9 (contacts.jrxml)

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 = $P{p_host_object_id}

Join on icinga_objects and icinga_contacts doesn't work.

Fixed statement is here

select
    a.display_name, c.alias, c.email_address
    from
        icinga_hosts a,
        icinga_host_contacts b,
        icinga_contacts c
    where   a.host_id = b.host_id
    and     b.contact_object_id = c.contact_object_id
    and     a.host_object_id = $P{p_host_object_id}

Attachments

@icinga-migration
Copy link
Author

Updated by berk on 2015-05-18 12:17:47 +00:00

  • Target Version set to Backlog

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant