- 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.
This commit is contained in:
Aaron Daniels
2016-04-26 07:04:22 +10:00
parent 59428bbe44
commit 4545aea28d
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -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 {
+7 -7
View File
@@ -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']) {
<table class="table table-hover table-condensed table-striped">
<tr>
<td title="Total"><img src='images/16/cog.png'> <?=$services['total']?></td>
<td title="Status - Ok"><img src='images/16/cog_add.png'> <?=$services[1]?></td>
<td title="Status - Critical"><img src='images/16/cog_delete.png'> <?=$services[0]?></td>
<td title="Status - Unknown"><img src='images/16/cog_error.png'> <?=$services[2]?></td>
<td title="Status - Ok"><img src='images/16/cog_add.png'> <?=$services[0]?></td>
<td title="Status - Warning"><img src='images/16/cog_error.png'> <?=$services[1]?></td>
<td title="Status - Critical"><img src='images/16/cog_delete.png'> <?=$services[2]?></td>
</tr>
<tr>
<td colspan='4'><?=$string?></td>