mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
- Use Nagios alerting: 0 = Ok, 1 = Warning, 2 = Critical
- Update documentation - Moved SQL for upstream changes
This commit is contained in:
@@ -51,13 +51,13 @@ if (count($services) > '0') {
|
||||
<?php
|
||||
foreach ($services as $service) {
|
||||
$service['service_ds'] = htmlspecialchars_decode($service['service_ds']);
|
||||
if ($service['service_status'] == 1) {
|
||||
if ($service['service_status'] == 0) {
|
||||
$status = "<span class='green'>Ok</span>";
|
||||
}
|
||||
elseif ($service['service_status'] == 2) {
|
||||
elseif ($service['service_status'] == 1) {
|
||||
$status = "<span class='red'>Warning</span>";
|
||||
}
|
||||
elseif ($service['service_status'] == 0) {
|
||||
elseif ($service['service_status'] == 2) {
|
||||
$status = "<span class='red'>Critical</span>";
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -74,14 +74,14 @@ print_optionbar_end();
|
||||
$sql_param = array();
|
||||
if (isset($vars['state'])) {
|
||||
if ($vars['state'] == 'ok') {
|
||||
$state = '1';
|
||||
}
|
||||
elseif ($vars['state'] == 'critical') {
|
||||
$state = '0';
|
||||
}
|
||||
elseif ($vars['state'] == 'warning') {
|
||||
elseif ($vars['state'] == 'critical') {
|
||||
$state = '2';
|
||||
}
|
||||
elseif ($vars['state'] == 'warning') {
|
||||
$state = '1';
|
||||
}
|
||||
}
|
||||
if (isset($state)) {
|
||||
$where .= " AND service_status= ? AND service_disabled='0' AND `service_ignore`='0'";
|
||||
@@ -123,10 +123,10 @@ foreach (dbFetchRows($host_sql, $host_par) as $device) {
|
||||
}
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `services` WHERE `device_id` = ? $where", $sql_param) as $service) {
|
||||
if ($service['service_status'] == '0') {
|
||||
if ($service['service_status'] == '2') {
|
||||
$status = "<span class='red'><b>".$service['service_type']."</b></span>";
|
||||
}
|
||||
else if ($service['service_status'] == '1') {
|
||||
else if ($service['service_status'] == '0') {
|
||||
$status = "<span class='green'><b>".$service['service_type']."</b></span>";
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user