From 3e36563a81378ee6cf0a0d403da025a79203161d Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 18 Dec 2015 15:48:55 +0100 Subject: [PATCH 1/3] Make hosts and services sortable by last state change refs #9957 --- .../controllers/ListController.php | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index c0ae1133f..edd072194 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -90,11 +90,12 @@ class ListController extends Controller $this->setupLimitControl(); $this->setupPaginationControl($this->view->hosts); $this->setupSortControl(array( - 'host_severity' => $this->translate('Severity'), - 'host_state' => $this->translate('Current State'), - 'host_display_name' => $this->translate('Hostname'), - 'host_address' => $this->translate('Address'), - 'host_last_check' => $this->translate('Last Check') + 'host_severity' => $this->translate('Severity'), + 'host_state' => $this->translate('Current State'), + 'host_display_name' => $this->translate('Hostname'), + 'host_address' => $this->translate('Address'), + 'host_last_check' => $this->translate('Last Check'), + 'host_last_state_change' => $this->translate('Last State Change') ), $query); $summary = $query->getQuery()->queryServiceProblemSummary(); @@ -155,15 +156,16 @@ class ListController extends Controller $this->setupLimitControl(); $this->setupPaginationControl($this->view->services); $this->setupSortControl(array( - 'service_severity' => $this->translate('Service Severity'), - 'service_state' => $this->translate('Current Service State'), - 'service_display_name' => $this->translate('Service Name'), - 'service_last_check' => $this->translate('Last Service Check'), - 'host_severity' => $this->translate('Host Severity'), - 'host_state' => $this->translate('Current Host State'), - 'host_display_name' => $this->translate('Hostname'), - 'host_address' => $this->translate('Host Address'), - 'host_last_check' => $this->translate('Last Host Check') + 'service_severity' => $this->translate('Service Severity'), + 'service_state' => $this->translate('Current Service State'), + 'service_display_name' => $this->translate('Service Name'), + 'service_last_check' => $this->translate('Last Service Check'), + 'host_severity' => $this->translate('Host Severity'), + 'host_state' => $this->translate('Current Host State'), + 'host_display_name' => $this->translate('Hostname'), + 'host_address' => $this->translate('Host Address'), + 'host_last_check' => $this->translate('Last Host Check'), + 'service_last_state_change' => $this->translate('Last State Change') ), $query); $stats = $this->backend->select()->from('servicestatussummary', array( From 2624c7f328d379c99965b708fe3a44e2c92d48dc Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 18 Dec 2015 15:48:55 +0100 Subject: [PATCH 2/3] Sort hosts and services descending by last state change refs #9957 --- modules/monitoring/library/Monitoring/DataView/Hoststatus.php | 2 +- .../monitoring/library/Monitoring/DataView/Servicestatus.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/DataView/Hoststatus.php b/modules/monitoring/library/Monitoring/DataView/Hoststatus.php index 220ce2226..c284a76fb 100644 --- a/modules/monitoring/library/Monitoring/DataView/Hoststatus.php +++ b/modules/monitoring/library/Monitoring/DataView/Hoststatus.php @@ -117,7 +117,7 @@ class HostStatus extends DataView 'order' => self::SORT_ASC ), 'host_last_state_change' => array( - 'order' => self::SORT_ASC + 'order' => self::SORT_DESC ) ); } diff --git a/modules/monitoring/library/Monitoring/DataView/Servicestatus.php b/modules/monitoring/library/Monitoring/DataView/Servicestatus.php index 389bc9ae0..a7f0069d5 100644 --- a/modules/monitoring/library/Monitoring/DataView/Servicestatus.php +++ b/modules/monitoring/library/Monitoring/DataView/Servicestatus.php @@ -145,6 +145,9 @@ class ServiceStatus extends DataView 'service_display_name' ), 'order' => self::SORT_ASC + ), + 'service_last_state_change' => array( + 'order' => self::SORT_DESC ) ); } From d7eaa41ab4b16429e57354852e015a2c41bbe116 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 21 Dec 2015 10:33:21 +0100 Subject: [PATCH 3/3] Move sort services by last state change up in the sort by list refs #9957 --- .../monitoring/application/controllers/ListController.php | 4 ++-- .../library/Monitoring/DataView/Servicestatus.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index edd072194..035a7e0ad 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -160,12 +160,12 @@ class ListController extends Controller 'service_state' => $this->translate('Current Service State'), 'service_display_name' => $this->translate('Service Name'), 'service_last_check' => $this->translate('Last Service Check'), + 'service_last_state_change' => $this->translate('Last State Change'), 'host_severity' => $this->translate('Host Severity'), 'host_state' => $this->translate('Current Host State'), 'host_display_name' => $this->translate('Hostname'), 'host_address' => $this->translate('Host Address'), - 'host_last_check' => $this->translate('Last Host Check'), - 'service_last_state_change' => $this->translate('Last State Change') + 'host_last_check' => $this->translate('Last Host Check') ), $query); $stats = $this->backend->select()->from('servicestatussummary', array( diff --git a/modules/monitoring/library/Monitoring/DataView/Servicestatus.php b/modules/monitoring/library/Monitoring/DataView/Servicestatus.php index a7f0069d5..0b03c06ad 100644 --- a/modules/monitoring/library/Monitoring/DataView/Servicestatus.php +++ b/modules/monitoring/library/Monitoring/DataView/Servicestatus.php @@ -123,6 +123,9 @@ class ServiceStatus extends DataView ), 'order' => self::SORT_DESC ), + 'service_last_state_change' => array( + 'order' => self::SORT_DESC + ), 'host_severity' => array( 'columns' => array( 'host_severity', @@ -145,9 +148,6 @@ class ServiceStatus extends DataView 'service_display_name' ), 'order' => self::SORT_ASC - ), - 'service_last_state_change' => array( - 'order' => self::SORT_DESC ) ); }