[icinga-checkins] icinga.org: icingaweb2/feature/ show-flapping-events-in-the-history-views-12766: Event history: show also flapping events

git at icinga.org git at icinga.org
Tue Dec 6 16:11:04 CET 2016


Module: icingaweb2
Branch: feature/show-flapping-events-in-the-history-views-12766
Commit: 0f22914fd070acbaa825b731c2166e9b40e25487
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=0f22914fd070acbaa825b731c2166e9b40e25487

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Tue Dec  6 16:09:33 2016 +0100

Event history: show also flapping events

refs #12766

---

 .../application/views/scripts/partials/event-history.phtml         |    3 +++
 .../library/Monitoring/Backend/Ido/Query/EventhistoryQuery.php     |    4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/monitoring/application/views/scripts/partials/event-history.phtml b/modules/monitoring/application/views/scripts/partials/event-history.phtml
index 0d9c648..010fb09 100644
--- a/modules/monitoring/application/views/scripts/partials/event-history.phtml
+++ b/modules/monitoring/application/views/scripts/partials/event-history.phtml
@@ -34,6 +34,7 @@ $history->limit($limit * $page);
 <?php
 $dateFormat = $this->translate('%A, %B %e, %Y', 'date.verbose');
 $lastDate = null;
+$flappingMsg = $this->translate('Flapping with a %.2f%% state change rate');
 ?>
     <table class="state-table" data-base-target="_next"<?php if (isset($tableCssClass)): ?> class="<?=$tableCssClass ?>"<?php endif ?>>
     <tbody>
@@ -92,12 +93,14 @@ $lastDate = null;
                 $icon = 'flapping';
                 $iconTitle = $this->translate('Flapping started', 'tooltip');
                 $label = $this->translate('FLAPPING');
+                $msg = sprintf($flappingMsg, $msg);
                 break;
             case 'flapping_deleted':
                 $icon = 'flapping';
                 $iconCssClass = 'icon-strikethrough';
                 $iconTitle = $this->translate('Flapping stopped', 'tooltip');
                 $label = $this->translate('FLAPPING STOPPED');
+                $msg = sprintf($flappingMsg, $msg);
                 break;
             case 'hard_state':
                 if ((int) $event->state === 0) {
diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventhistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventhistoryQuery.php
index c8ee0b8..956e874 100644
--- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventhistoryQuery.php
+++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/EventhistoryQuery.php
@@ -67,7 +67,9 @@ class EventhistoryQuery extends IdoQuery
             $this->createSubQuery('Downtimeendhistory', $columns),
             $this->createSubQuery('Commenthistory', $columns),
             $this->createSubQuery('Commentdeletionhistory', $columns),
-            $this->createSubQuery('Notificationhistory', $columns)
+            $this->createSubQuery('Notificationhistory', $columns),
+            $this->createSubQuery('Flappingstarthistory', $columns),
+            $this->createSubQuery('Flappingendhistory', $columns)
         );
         $sub = $this->db->select()->union($this->subQueries, Zend_Db_Select::SQL_UNION_ALL);
         $this->select->from(array('eh' => $sub), array());



More information about the icinga-checkins mailing list