diff --git a/library/Toplevelview/Tree/TLVHostGroupNode.php b/library/Toplevelview/Tree/TLVHostGroupNode.php index 43bf4a6..c682bf5 100644 --- a/library/Toplevelview/Tree/TLVHostGroupNode.php +++ b/library/Toplevelview/Tree/TLVHostGroupNode.php @@ -66,17 +66,29 @@ public function getStatus() $status->set('total', $data->hosts_total + $data->services_total); $status->set('ok', $data->hosts_up + $data->services_ok); - $status->set( - 'critical_handled', - $data->hosts_down_handled - + $data->hosts_unreachable_handled - + $data->services_critical_handled - ); - $status->set('critical_unhandled', - $data->hosts_down_unhandled - + $data->hosts_unreachable_unhandled - + $data->services_critical_unhandled - ); + $status->set('critical_handled', $data->services_critical_handled); + $status->set('critical_unhandled', $data->services_critical_unhandled); + + if ($this->getRoot()->get('host_never_unhandled') === true) { + $status->add( + 'critical_handled', + $data->hosts_down_handled + + $data->hosts_unreachable_handled + + $data->hosts_down_unhandled + + $data->hosts_unreachable_unhandled + ); + } else { + $status->add( + 'critical_handled', + $data->hosts_down_handled + + $data->hosts_unreachable_handled + ); + $status->add( + 'critical_unhandled', + $data->hosts_down_unhandled + + $data->hosts_unreachable_unhandled + ); + } $status->set('warning_handled', $data->services_warning_handled); $status->set('warning_unhandled', $data->services_warning_unhandled); diff --git a/library/Toplevelview/Tree/TLVHostNode.php b/library/Toplevelview/Tree/TLVHostNode.php index e574d44..71e063e 100644 --- a/library/Toplevelview/Tree/TLVHostNode.php +++ b/library/Toplevelview/Tree/TLVHostNode.php @@ -57,7 +57,7 @@ public function getStatus() $status->add('downtime_active'); $state = '10'; $handled = ''; - } elseif ($data->host_handled === '1') { + } elseif ($data->host_handled === '1' || $this->getRoot()->get('host_never_unhandled') === true) { $handled = '_handled'; } else { $handled = '_unhandled';