From 4545aea28d8f9fbeaf534e823030443f3be65847 Mon Sep 17 00:00:00 2001 From: Aaron Daniels Date: Tue, 26 Apr 2016 07:04:22 +1000 Subject: [PATCH] - Services widget on device overview page was still displaying legacy status while the database has been storing nagios style status. Modified to: 0=Ok, 1=Unknown, 2=Critical. --- html/pages/device/overview.inc.php | 2 +- html/pages/device/overview/services.inc.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/html/pages/device/overview.inc.php b/html/pages/device/overview.inc.php index 278960e76..60bbee561 100644 --- a/html/pages/device/overview.inc.php +++ b/html/pages/device/overview.inc.php @@ -10,7 +10,7 @@ $ports['disabled'] = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE device_id = $services = get_service_status($device['device_id']); $services['total'] = array_sum($services); -if ($services[0]) { +if ($services[2]) { $services_colour = $warn_colour_a; } else { diff --git a/html/pages/device/overview/services.inc.php b/html/pages/device/overview/services.inc.php index ed5b5023b..092b66cff 100644 --- a/html/pages/device/overview/services.inc.php +++ b/html/pages/device/overview/services.inc.php @@ -3,14 +3,14 @@ if ($services['total']) { // Build the string. foreach (service_get ($device['device_id']) as $data) { - if ($data['service_status'] == '1') { + if ($data['service_status'] == '0') { // Ok $status = 'green'; - } elseif ($data['service_status'] == '0') { - // Critical + } elseif ($data['service_status'] == '1') { + // Warning $status = 'red'; } elseif ($data['service_status'] == '2') { - // Warning + // Critical $status = 'red'; } else { // Unknown @@ -29,9 +29,9 @@ if ($services['total']) { - - - + + +