Hoststatesummary: Count hosts, not their states

This commit is contained in:
Johannes Meyer 2020-02-07 13:16:57 +01:00
parent fa8ab3673b
commit 6fbad0b502

View file

@ -45,7 +45,7 @@ class HoststateSummary extends Host
. ' AND host_state.is_acknowledged = \'n\' THEN 1 ELSE 0 END)'
),
'hosts_total' => new Expression(
'SUM(CASE WHEN host_state.soft_state IS NOT NULL THEN 1 ELSE 0 END)'
'SUM(CASE WHEN host.id IS NOT NULL THEN 1 ELSE 0 END)'
),
'hosts_unreachable' => new Expression(
'SUM(CASE WHEN host_state.soft_state = 2 THEN 1 ELSE 0 END)'