You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a user without any restrictions I get the correct count for unhandled service in host views, but if the user has restrictions the count varies. For example with my account I see 1 unhandled service, for the user with restrictions it is 0 if browsing the host view (so no filter) and 2 if coming from hostgroups (so filtered by a hostgroup value). For 5 unhandled, its 0 and 10.
I am not allowed to post screenshots because of hostnames, but I have the output of format=sql which hopefully helps to reproduce the problem also if it is not showing the service query.
QUERY
=====
SELECT h.icon_image AS host_icon_image, h.icon_image_alt AS
host_icon_image_alt, ho.name1 AS host_name, h.display_name COLLATE
latin1_general_ci AS host_display_name, CASE WHEN hs.has_been_checked = 0
OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END AS
host_state, hs.problem_has_been_acknowledged AS host_acknowledged,
hs.output AS host_output, hs.current_check_attempt || '/' ||
hs.max_check_attempts AS host_attempt, CASE WHEN
(hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END AS host_in_downtime,
hs.is_flapping AS host_is_flapping, hs.state_type AS host_state_type, CASE
WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) > 0
THEN 1 ELSE 0 END AS host_handled, UNIX_TIMESTAMP(hs.last_state_change) AS
host_last_state_change, hs.notifications_enabled AS
host_notifications_enabled, hs.active_checks_enabled AS
host_active_checks_enabled, hs.passive_checks_enabled AS
host_passive_checks_enabled FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND
ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
WHERE ( (TRUE) ) ORDER BY h.display_name COLLATE latin1_general_ci ASC
COUNT
=====
SELECT COUNT(*) AS cnt FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND
ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
WHERE ( (TRUE) )
QUERY
=====
SELECT h.icon_image AS host_icon_image, h.icon_image_alt AS
host_icon_image_alt, ho.name1 AS host_name, h.display_name COLLATE
latin1_general_ci AS host_display_name, CASE WHEN hs.has_been_checked = 0
OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END AS
host_state, hs.problem_has_been_acknowledged AS host_acknowledged,
hs.output AS host_output, hs.current_check_attempt || '/' ||
hs.max_check_attempts AS host_attempt, CASE WHEN
(hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END AS host_in_downtime,
hs.is_flapping AS host_is_flapping, hs.state_type AS host_state_type, CASE
WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) > 0
THEN 1 ELSE 0 END AS host_handled, UNIX_TIMESTAMP(hs.last_state_change) AS
host_last_state_change, hs.notifications_enabled AS
host_notifications_enabled, hs.active_checks_enabled AS
host_active_checks_enabled, hs.passive_checks_enabled AS
host_passive_checks_enabled FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND
ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_hostgroup_members AS hgm ON hgm.host_object_id =
ho.object_id
LEFT JOIN icinga_hostgroups AS hg ON hg.hostgroup_id = hgm.hostgroup_id
LEFT JOIN icinga_objects AS hgo ON hgo.object_id = hg.hostgroup_object_id
AND hgo.is_active = 1 AND hgo.objecttype_id = 3 WHERE ( (TRUE OR
(hgo.name1 = 'Etagen-Switches' OR hgo.name1 = 'Linux-Server' OR hgo.name1 =
'Netzwerk-Geraete' OR hgo.name1 = 'SAP-Server' OR hgo.name1 = 'Storage' OR
hgo.name1 = 'USV') ) ) GROUP BY ho.object_id,
h.host_id ORDER BY h.display_name COLLATE latin1_general_ci ASC
COUNT
=====
SELECT COUNT(*) AS cnt FROM (SELECT h.icon_image AS host_icon_image,
h.icon_image_alt AS host_icon_image_alt, ho.name1 AS host_name,
h.display_name COLLATE latin1_general_ci AS host_display_name, CASE WHEN
hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE
hs.current_state END AS host_state, hs.problem_has_been_acknowledged AS
host_acknowledged, hs.output AS host_output, hs.current_check_attempt ||
'/' || hs.max_check_attempts AS host_attempt, CASE WHEN
(hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END AS host_in_downtime,
hs.is_flapping AS host_is_flapping, hs.state_type AS host_state_type, CASE
WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) > 0
THEN 1 ELSE 0 END AS host_handled, UNIX_TIMESTAMP(hs.last_state_change) AS
host_last_state_change, hs.notifications_enabled AS
host_notifications_enabled, hs.active_checks_enabled AS
host_active_checks_enabled, hs.passive_checks_enabled AS
host_passive_checks_enabled FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND
ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_hostgroup_members AS hgm ON hgm.host_object_id =
ho.object_id
LEFT JOIN icinga_hostgroups AS hg ON hg.hostgroup_id = hgm.hostgroup_id
LEFT JOIN icinga_objects AS hgo ON hgo.object_id = hg.hostgroup_object_id
AND hgo.is_active = 1 AND hgo.objecttype_id = 3 WHERE ( (TRUE OR
(hgo.name1 = 'Etagen-Switches' OR hgo.name1 = 'Linux-Server' OR hgo.name1 =
'Netzwerk-Geraete' OR hgo.name1 = 'SAP-Server' OR hgo.name1 = 'Storage' OR
hgo.name1 = 'USV') ) ) GROUP BY ho.object_id,
h.host_id) AS t
QUERY
=====
SELECT h.icon_image AS host_icon_image, h.icon_image_alt AS
host_icon_image_alt, ho.name1 AS host_name, h.display_name COLLATE
latin1_general_ci AS host_display_name, CASE WHEN hs.has_been_checked = 0
OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END AS
host_state, hs.problem_has_been_acknowledged AS host_acknowledged,
hs.output AS host_output, hs.current_check_attempt || '/' ||
hs.max_check_attempts AS host_attempt, CASE WHEN
(hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END AS host_in_downtime,
hs.is_flapping AS host_is_flapping, hs.state_type AS host_state_type, CASE
WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) > 0
THEN 1 ELSE 0 END AS host_handled, UNIX_TIMESTAMP(hs.last_state_change) AS
host_last_state_change, hs.notifications_enabled AS
host_notifications_enabled, hs.active_checks_enabled AS
host_active_checks_enabled, hs.passive_checks_enabled AS
host_passive_checks_enabled FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND
ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_hostgroup_members AS hgm ON hgm.host_object_id =
ho.object_id
LEFT JOIN icinga_hostgroups AS hg ON hg.hostgroup_id = hgm.hostgroup_id
LEFT JOIN icinga_objects AS hgo ON hgo.object_id = hg.hostgroup_object_id
AND hgo.is_active = 1 AND hgo.objecttype_id = 3 WHERE ( (TRUE) AND
hgo.name1 = 'Toolineo-Systeme lf.net') GROUP BY ho.object_id,
h.host_id ORDER BY h.display_name COLLATE latin1_general_ci ASC
COUNT
=====
SELECT COUNT(*) AS cnt FROM (SELECT h.icon_image AS host_icon_image,
h.icon_image_alt AS host_icon_image_alt, ho.name1 AS host_name,
h.display_name COLLATE latin1_general_ci AS host_display_name, CASE WHEN
hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE
hs.current_state END AS host_state, hs.problem_has_been_acknowledged AS
host_acknowledged, hs.output AS host_output, hs.current_check_attempt ||
'/' || hs.max_check_attempts AS host_attempt, CASE WHEN
(hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END AS host_in_downtime,
hs.is_flapping AS host_is_flapping, hs.state_type AS host_state_type, CASE
WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) > 0
THEN 1 ELSE 0 END AS host_handled, UNIX_TIMESTAMP(hs.last_state_change) AS
host_last_state_change, hs.notifications_enabled AS
host_notifications_enabled, hs.active_checks_enabled AS
host_active_checks_enabled, hs.passive_checks_enabled AS
host_passive_checks_enabled FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND
ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_hostgroup_members AS hgm ON hgm.host_object_id =
ho.object_id
LEFT JOIN icinga_hostgroups AS hg ON hg.hostgroup_id = hgm.hostgroup_id
LEFT JOIN icinga_objects AS hgo ON hgo.object_id = hg.hostgroup_object_id
AND hgo.is_active = 1 AND hgo.objecttype_id = 3 WHERE ( (TRUE) AND
hgo.name1 = 'Toolineo-Systeme lf.net') GROUP BY ho.object_id,
h.host_id) AS t
QUERY
=====
SELECT h.icon_image AS host_icon_image, h.icon_image_alt AS
host_icon_image_alt, ho.name1 AS host_name, h.display_name COLLATE
latin1_general_ci AS host_display_name, CASE WHEN hs.has_been_checked = 0
OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END AS
host_state, hs.problem_has_been_acknowledged AS host_acknowledged,
hs.output AS host_output, hs.current_check_attempt || '/' ||
hs.max_check_attempts AS host_attempt, CASE WHEN
(hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END AS host_in_downtime,
hs.is_flapping AS host_is_flapping, hs.state_type AS host_state_type, CASE
WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) > 0
THEN 1 ELSE 0 END AS host_handled, UNIX_TIMESTAMP(hs.last_state_change) AS
host_last_state_change, hs.notifications_enabled AS
host_notifications_enabled, hs.active_checks_enabled AS
host_active_checks_enabled, hs.passive_checks_enabled AS
host_passive_checks_enabled FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND
ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_hostgroup_members AS hgm ON hgm.host_object_id =
ho.object_id
LEFT JOIN icinga_hostgroups AS hg ON hg.hostgroup_id = hgm.hostgroup_id
LEFT JOIN icinga_objects AS hgo ON hgo.object_id = hg.hostgroup_object_id
AND hgo.is_active = 1 AND hgo.objecttype_id = 3 WHERE ( (TRUE OR
(hgo.name1 = 'Etagen-Switches' OR hgo.name1 = 'Linux-Server' OR hgo.name1 =
'Netzwerk-Geraete' OR hgo.name1 = 'SAP-Server' OR hgo.name1 = 'Storage' OR
hgo.name1 = 'USV') ) AND hgo.name1 = 'Toolineo-Systeme lf.net') GROUP BY
ho.object_id,
h.host_id ORDER BY h.display_name COLLATE latin1_general_ci ASC
COUNT
=====
SELECT COUNT(*) AS cnt FROM (SELECT h.icon_image AS host_icon_image,
h.icon_image_alt AS host_icon_image_alt, ho.name1 AS host_name,
h.display_name COLLATE latin1_general_ci AS host_display_name, CASE WHEN
hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE
hs.current_state END AS host_state, hs.problem_has_been_acknowledged AS
host_acknowledged, hs.output AS host_output, hs.current_check_attempt ||
'/' || hs.max_check_attempts AS host_attempt, CASE WHEN
(hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END AS host_in_downtime,
hs.is_flapping AS host_is_flapping, hs.state_type AS host_state_type, CASE
WHEN (hs.problem_has_been_acknowledged + hs.scheduled_downtime_depth) > 0
THEN 1 ELSE 0 END AS host_handled, UNIX_TIMESTAMP(hs.last_state_change) AS
host_last_state_change, hs.notifications_enabled AS
host_notifications_enabled, hs.active_checks_enabled AS
host_active_checks_enabled, hs.passive_checks_enabled AS
host_passive_checks_enabled FROM icinga_hosts AS h
INNER JOIN icinga_objects AS ho ON ho.object_id = h.host_object_id AND
ho.is_active = 1 AND ho.objecttype_id = 1
INNER JOIN icinga_hoststatus AS hs ON hs.host_object_id = ho.object_id
LEFT JOIN icinga_hostgroup_members AS hgm ON hgm.host_object_id =
ho.object_id
LEFT JOIN icinga_hostgroups AS hg ON hg.hostgroup_id = hgm.hostgroup_id
LEFT JOIN icinga_objects AS hgo ON hgo.object_id = hg.hostgroup_object_id
AND hgo.is_active = 1 AND hgo.objecttype_id = 3 WHERE ( (TRUE OR
(hgo.name1 = 'Etagen-Switches' OR hgo.name1 = 'Linux-Server' OR hgo.name1 =
'Netzwerk-Geraete' OR hgo.name1 = 'SAP-Server' OR hgo.name1 = 'Storage' OR
hgo.name1 = 'USV') ) AND hgo.name1 = 'Toolineo-Systeme lf.net') GROUP BY
ho.object_id,
h.host_id) AS t
Modules and versions in use are:
businessprocess 2.1.0
director 1.3.1
fileshipper 1.0.0
graphite 0.0.0
monitoring 2.4.1
puppetdb 0.0.0
Icinga 2 version is r2.6.3-1
The text was updated successfully, but these errors were encountered:
…e used
The query for fetching the unhandled services count utilises the hosts query as subquery.
Restrictions are applied to both the hosts query and the query for the unhandled services count.
This leads to wrong results since the restrictions are already in place for the unhandled services count because we're using the hosts query as subquery.
refs #2822
With a user without any restrictions I get the correct count for unhandled service in host views, but if the user has restrictions the count varies. For example with my account I see 1 unhandled service, for the user with restrictions it is 0 if browsing the host view (so no filter) and 2 if coming from hostgroups (so filtered by a hostgroup value). For 5 unhandled, its 0 and 10.
I am not allowed to post screenshots because of hostnames, but I have the output of format=sql which hopefully helps to reproduce the problem also if it is not showing the service query.
Unrestricted /icingaweb2/monitoring/list/hosts?page=9&format=sql
Restricted /icingaweb2/monitoring/list/hosts?page=9&format=sql
Unrestricted /icingaweb2/monitoring/list/hosts?hostgroup_name=Toolineo-Systeme lf.net&format=sql
Restricted /icingaweb2/monitoring/list/hosts?hostgroup_name=Toolineo-Systeme lf.net&format=sql
Modules and versions in use are:
businessprocess 2.1.0
director 1.3.1
fileshipper 1.0.0
graphite 0.0.0
monitoring 2.4.1
puppetdb 0.0.0
Icinga 2 version is r2.6.3-1
The text was updated successfully, but these errors were encountered: