From 361fc2792218c781874a312d000922d1f0accf98 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 15 Jun 2020 13:21:20 +0200 Subject: [PATCH] /monitoring/tactical: don't show negative amounts of monitored objects refs #4174 --- .../controllers/TacticalController.php | 10 ++++++---- .../views/scripts/tactical/index.phtml | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/application/controllers/TacticalController.php b/modules/monitoring/application/controllers/TacticalController.php index 438d019e1..181341865 100644 --- a/modules/monitoring/application/controllers/TacticalController.php +++ b/modules/monitoring/application/controllers/TacticalController.php @@ -37,6 +37,7 @@ class TacticalController extends Controller 'hosts_unreachable_handled', 'hosts_unreachable_unhandled', 'hosts_pending', + 'hosts_pending_not_checked', 'hosts_not_checked', 'services_ok', @@ -47,6 +48,7 @@ class TacticalController extends Controller 'services_unknown_handled', 'services_unknown_unhandled', 'services_pending', + 'services_pending_not_checked', 'services_not_checked', ) ); @@ -63,8 +65,8 @@ class TacticalController extends Controller $summary = $stats->fetchRow(); // Correct pending counts. Done here instead of in the query for compatibility reasons. - $summary->hosts_pending -= $summary->hosts_not_checked; - $summary->services_pending -= $summary->services_not_checked; + $summary->hosts_pending -= $summary->hosts_pending_not_checked; + $summary->services_pending -= $summary->services_pending_not_checked; $hostSummaryChart = new Donut(); $hostSummaryChart @@ -74,7 +76,7 @@ class TacticalController extends Controller ->addSlice($summary->hosts_unreachable_handled, array('class' => 'slice-state-unreachable-handled')) ->addSlice($summary->hosts_unreachable_unhandled, array('class' => 'slice-state-unreachable')) ->addSlice($summary->hosts_pending, array('class' => 'slice-state-pending')) - ->addSlice($summary->hosts_not_checked, array('class' => 'slice-state-not-checked')) + ->addSlice($summary->hosts_pending_not_checked, array('class' => 'slice-state-not-checked')) ->setLabelBig($summary->hosts_down_unhandled) ->setLabelBigEyeCatching($summary->hosts_down_unhandled > 0) ->setLabelSmall($this->translate('Hosts Down')); @@ -89,7 +91,7 @@ class TacticalController extends Controller ->addSlice($summary->services_unknown_handled, array('class' => 'slice-state-unknown-handled')) ->addSlice($summary->services_unknown_unhandled, array('class' => 'slice-state-unknown')) ->addSlice($summary->services_pending, array('class' => 'slice-state-pending')) - ->addSlice($summary->services_not_checked, array('class' => 'slice-state-not-checked')) + ->addSlice($summary->services_pending_not_checked, array('class' => 'slice-state-not-checked')) ->setLabelBig($summary->services_critical_unhandled) ->setLabelBigEyeCatching($summary->services_critical_unhandled > 0) ->setLabelSmall($this->translate('Services Critical')); diff --git a/modules/monitoring/application/views/scripts/tactical/index.phtml b/modules/monitoring/application/views/scripts/tactical/index.phtml index 330aec3c1..12f4bc5c6 100644 --- a/modules/monitoring/application/views/scripts/tactical/index.phtml +++ b/modules/monitoring/application/views/scripts/tactical/index.phtml @@ -1,3 +1,6 @@ + compact): ?>
tabs ?> @@ -53,15 +56,15 @@ hosts_pending): ?>
  • - + hosts_pending ?>translate('Pending') ?>
  • - hosts_not_checked): ?> + hosts_pending_not_checked): ?>
  • - - hosts_not_checked ?>translate('Not Checked') ?> + + hosts_pending_not_checked ?>translate('Not Checked') ?>
  • @@ -124,15 +127,15 @@ services_pending):?>
  • - + services_pending ?>translate('Pending') ?>
  • services_not_checked):?> + if ($statusSummary->services_pending_not_checked):?>
  • - - services_not_checked ?>translate('Not Checked') ?> + + services_pending_not_checked ?>translate('Not Checked') ?>