From a4731ebbb356710295405755b60d9fe547b4066b Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 13 Mar 2015 00:25:08 +0100 Subject: [PATCH 1/4] Select is_reachable from host and service status refs #6875 --- .../library/Monitoring/Backend/Ido/Query/StatusQuery.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php index 4106fa321..0fb799f48 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php @@ -121,6 +121,7 @@ class StatusQuery extends IdoQuery 'host_retry_check_interval' => 'hs.retry_check_interval', 'host_check_timeperiod_object_id' => 'hs.check_timeperiod_object_id', 'host_status_update_time' => 'hs.status_update_time', + 'host_is_reachable' => 'hs.is_reachable', 'host_severity' => 'CASE WHEN hs.current_state = 0 THEN CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL @@ -259,6 +260,7 @@ class StatusQuery extends IdoQuery 'service_check_timeperiod_object_id' => 'ss.check_timeperiod_object_id', 'service_status_update_time' => 'ss.status_update_time', 'service_problem' => 'CASE WHEN ss.current_state = 0 THEN 0 ELSE 1 END', + 'service_is_reachable' => 'ss.is_reachable', 'service_severity' => 'CASE WHEN ss.current_state = 0 THEN CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL @@ -345,6 +347,10 @@ class StatusQuery extends IdoQuery $this->columnMap['hoststatus']['host_check_source'] = '(NULL)'; $this->columnMap['servicestatus']['service_check_source'] = '(NULL)'; } + if (version_compare($this->getIdoVersion(), '1.13.0', '<')) { + $this->columnMap['hoststatus']['host_is_reachable'] = '(NULL)'; + $this->columnMap['servicestatus']['service_is_reachable'] = '(NULL)'; + } $this->select->from(array('ho' => $this->prefix . 'objects'), array()) ->join( array('hs' => $this->prefix . 'hoststatus'), From 37823f041502d86399b5b53a16e0fccc2aab0b4c Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 13 Mar 2015 00:25:44 +0100 Subject: [PATCH 2/4] Select host_is_reachable in the host detail view refs #6875 --- modules/monitoring/library/Monitoring/Object/Host.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/monitoring/library/Monitoring/Object/Host.php b/modules/monitoring/library/Monitoring/Object/Host.php index 359065e57..342e78812 100644 --- a/modules/monitoring/library/Monitoring/Object/Host.php +++ b/modules/monitoring/library/Monitoring/Object/Host.php @@ -109,6 +109,7 @@ class Host extends MonitoredObject 'host_handled', 'host_in_downtime', 'host_is_flapping', + 'host_is_reachable', 'host_last_check', 'host_last_notification', 'host_last_state_change', From 1c8c49e7322663042db38b954e18450d6821310d Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 13 Mar 2015 00:26:02 +0100 Subject: [PATCH 3/4] Select service_is_reachable in the service detail view refs #6875 --- modules/monitoring/library/Monitoring/Object/Service.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/monitoring/library/Monitoring/Object/Service.php b/modules/monitoring/library/Monitoring/Object/Service.php index 4195b0ff4..7c22ae57d 100644 --- a/modules/monitoring/library/Monitoring/Object/Service.php +++ b/modules/monitoring/library/Monitoring/Object/Service.php @@ -137,6 +137,7 @@ class Service extends MonitoredObject 'service_handled', 'service_in_downtime', 'service_is_flapping', + 'service_is_reachable', 'service_last_check', 'service_last_notification', 'service_last_state_change', From ce3c2507efbecd8977068886f77046883dd23843 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 13 Mar 2015 00:26:45 +0100 Subject: [PATCH 4/4] Show reachability in the host and service detail view refs #6875 --- .../scripts/show/components/checksource.phtml | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/modules/monitoring/application/views/scripts/show/components/checksource.phtml b/modules/monitoring/application/views/scripts/show/components/checksource.phtml index 60bb944f3..07e63e835 100644 --- a/modules/monitoring/application/views/scripts/show/components/checksource.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checksource.phtml @@ -1,7 +1,20 @@ -check_source) return ?> +check_source !== null): ?> - translate('Check Source') ?> - - escape($object->check_source) ?> - + + translate('Check Source') ?> + + + escape($object->check_source) ?> + + +is_reachable !== null): ?> + + + translate('Reachable') ?> + + + is_reachable ? $this->translate('Yes') : $this->translate('No') ?> + + +