summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/status_gateways.php5
-rwxr-xr-xusr/local/www/system_gateways_edit.php11
-rw-r--r--usr/local/www/widgets/widgets/gateways.widget.php5
3 files changed, 19 insertions, 2 deletions
diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php
index e7154a8..ffe1458 100755
--- a/usr/local/www/status_gateways.php
+++ b/usr/local/www/status_gateways.php
@@ -115,7 +115,10 @@ include("head.inc");
<?php
if ($gateways_status[$gname]) {
$status = $gateways_status[$gname];
- if (stristr($status['status'], "down")) {
+ if (stristr($status['status'], "force_down")) {
+ $online = gettext("Offline (forced)");
+ $bgcolor = "#F08080"; // lightcoral
+ } elseif (stristr($status['status'], "down")) {
$online = gettext("Offline");
$bgcolor = "#F08080"; // lightcoral
} elseif (stristr($status['status'], "loss")) {
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 1911921..429e4cc 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -75,6 +75,7 @@ if (isset($id) && $a_gateways[$id]) {
$pconfig['dynamic'] = true;
$pconfig['gateway'] = $a_gateways[$id]['gateway'];
$pconfig['defaultgw'] = isset($a_gateways[$id]['defaultgw']);
+ $pconfig['force_down'] = isset($a_gateways[$id]['force_down']);
$pconfig['latencylow'] = $a_gateways[$id]['latencylow'];
$pconfig['latencyhigh'] = $a_gateways[$id]['latencyhigh'];
$pconfig['losslow'] = $a_gateways[$id]['losslow'];
@@ -388,6 +389,8 @@ if ($_POST) {
$gateway['descr'] = $_POST['descr'];
if ($_POST['monitor_disable'] == "yes")
$gateway['monitor_disable'] = true;
+ if ($_POST['force_down'] == "yes")
+ $gateway['force_down'] = true;
if (is_ipaddr($_POST['monitor']))
$gateway['monitor'] = $_POST['monitor'];
@@ -596,6 +599,14 @@ function monitor_change() {
</td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Mark Gateway as Down"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="force_down" type="checkbox" id="force_down" value="yes" <?php if ($pconfig['force_down'] == true) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Mark Gateway as Down"); ?></strong><br />
+ <?=gettext("This will force this gateway to be considered Down"); ?>
+ </td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Advanced");?></td>
<td width="78%" class="vtable">
<?php $showbutton = (!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || (isset($pconfig['weight']) && $pconfig['weight'] > 1) || (isset($pconfig['interval']) && ($pconfig['interval'] > $apinger_default['interval'])) || (isset($pconfig['down']) && !($pconfig['down'] == $apinger_default['down']))); ?>
diff --git a/usr/local/www/widgets/widgets/gateways.widget.php b/usr/local/www/widgets/widgets/gateways.widget.php
index b5bbe4f..52048a1 100644
--- a/usr/local/www/widgets/widgets/gateways.widget.php
+++ b/usr/local/www/widgets/widgets/gateways.widget.php
@@ -109,7 +109,10 @@ $counter = 1;
<table border="0" cellpadding="0" cellspacing="2" style="table-layout: fixed;" summary="status">
<?php
if ($gateways_status[$gname]) {
- if (stristr($gateways_status[$gname]['status'], "down")) {
+ if (stristr($gateways_status[$gname]['status'], "force_down")) {
+ $online = "Offline (forced)";
+ $bgcolor = "#F08080"; // lightcoral
+ } elseif (stristr($gateways_status[$gname]['status'], "down")) {
$online = "Offline";
$bgcolor = "#F08080"; // lightcoral
} elseif (stristr($gateways_status[$gname]['status'], "loss")) {
OpenPOWER on IntegriCloud