mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
- 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:
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user