SELECT 
icinga_instances.instance_id
,icinga_instances.instance_name
,icinga_contactgroups.contactgroup_id
,icinga_contactgroups.contactgroup_object_id
,obj1.name1 AS contactgroup_name
,icinga_contactgroups.alias AS contactgroup_alias
,icinga_contacts.contact_object_id 
,obj2.name1 AS contact_name
FROM `icinga_contactgroups` 
INNER JOIN icinga_contactgroup_members ON icinga_contactgroups.contactgroup_id=icinga_contactgroup_members.contactgroup_id 
INNER JOIN icinga_contacts ON icinga_contactgroup_members.contact_object_id=icinga_contacts.contact_object_id
INNER JOIN icinga_objects as obj1 ON icinga_contactgroups.contactgroup_object_id=obj1.object_id
INNER JOIN icinga_objects as obj2 ON icinga_contactgroup_members.contact_object_id=obj2.object_id
INNER JOIN icinga_instances ON icinga_contactgroups.instance_id=icinga_instances.instance_id
