summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-12-07 21:22:17 +0545
committerPhil Davis <phil.davis@inf.org>2016-12-07 21:22:17 +0545
commitf396d2b715b27312c9bc056b3423db8198f7d52a (patch)
treeb9aeaf7d32857dc8a6179a95975c1e0201501826 /src/usr
parent9f834c4b50b37eab809e815796201c2d2d8342cf (diff)
downloadpfsense-f396d2b715b27312c9bc056b3423db8198f7d52a.zip
pfsense-f396d2b715b27312c9bc056b3423db8198f7d52a.tar.gz
Feature #3151 Disable gateway monitoring actions
without disabling gateway monitoring. This allows the user to continue to monitor the gateway with dpinger, so they can see how it is performing, but for the system not to take any real action if the latency/loss exceeds the given limits. A typical use case for this would be on a single-WAN system. There is no failover option, so there is no point taking any real action when the latency/loss is high. Having stuff try to failover (and stop/start stuff...) is just disruptive. In ths case the use could have disabled monitoring completely, but then they get no feedback abut gateway performance.
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/status_gateways.php6
-rw-r--r--src/usr/local/www/system_gateways_edit.php11
-rw-r--r--src/usr/local/www/widgets/widgets/gateways.widget.php6
3 files changed, 23 insertions, 0 deletions
diff --git a/src/usr/local/www/status_gateways.php b/src/usr/local/www/status_gateways.php
index ab9fe07..d633fab 100644
--- a/src/usr/local/www/status_gateways.php
+++ b/src/usr/local/www/status_gateways.php
@@ -127,9 +127,15 @@ display_top_tabs($tab_array);
} elseif (stristr($status['status'], "down")) {
$online = gettext("Offline");
$bgcolor = "bg-danger";
+ } elseif (stristr($status['status'], "highloss")) {
+ $online = gettext("Danger, Packetloss") . ': ' . $status['loss'];
+ $bgcolor = "bg-danger";
} elseif (stristr($status['status'], "loss")) {
$online = gettext("Warning, Packetloss") . ': ' . $status['loss'];
$bgcolor = "bg-warning";
+ } elseif (stristr($status['status'], "highdelay")) {
+ $online = gettext("Danger, Latency") . ': ' . $status['delay'];
+ $bgcolor = "bg-danger";
} elseif (stristr($status['status'], "delay")) {
$online = gettext("Warning, Latency") . ': ' . $status['delay'];
$bgcolor = "bg-warning";
diff --git a/src/usr/local/www/system_gateways_edit.php b/src/usr/local/www/system_gateways_edit.php
index 0903aea..cbd1e84 100644
--- a/src/usr/local/www/system_gateways_edit.php
+++ b/src/usr/local/www/system_gateways_edit.php
@@ -83,6 +83,7 @@ if (isset($id) && $a_gateways[$id]) {
$pconfig['losshigh'] = $a_gateways[$id]['losshigh'];
$pconfig['monitor'] = $a_gateways[$id]['monitor'];
$pconfig['monitor_disable'] = isset($a_gateways[$id]['monitor_disable']);
+ $pconfig['action_disable'] = isset($a_gateways[$id]['action_disable']);
$pconfig['data_payload'] = $a_gateways[$id]['data_payload'];
$pconfig['nonlocalgateway'] = isset($a_gateways[$id]['nonlocalgateway']);
$pconfig['descr'] = $a_gateways[$id]['descr'];
@@ -428,6 +429,9 @@ if ($_POST) {
if ($_POST['monitor_disable'] == "yes") {
$gateway['monitor_disable'] = true;
}
+ if ($_POST['action_disable'] == "yes") {
+ $gateway['action_disable'] = true;
+ }
if ($_POST['nonlocalgateway'] == "yes") {
$gateway['nonlocalgateway'] = true;
}
@@ -644,6 +648,13 @@ $section->addInput(new Form_Checkbox(
$pconfig['monitor_disable']
))->toggles('.toggle-monitor-ip')->setHelp('This will consider this gateway as always being up.');
+$section->addInput(new Form_Checkbox(
+ 'action_disable',
+ 'Gateway Action',
+ 'Disable Gateway Monitoring Action',
+ $pconfig['action_disable']
+))->setHelp('No action will be taken on gateway events. The gateway is always considered up.');
+
$group = new Form_Group('Monitor IP');
$group->addClass('toggle-monitor-ip', 'collapse');
diff --git a/src/usr/local/www/widgets/widgets/gateways.widget.php b/src/usr/local/www/widgets/widgets/gateways.widget.php
index 28aed43..34f4d2e 100644
--- a/src/usr/local/www/widgets/widgets/gateways.widget.php
+++ b/src/usr/local/www/widgets/widgets/gateways.widget.php
@@ -220,9 +220,15 @@ function compose_table_body_contents() {
} elseif (stristr($gateways_status[$gname]['status'], "down")) {
$online = gettext("Offline");
$bgcolor = "danger"; // lightcoral
+ } elseif (stristr($gateways_status[$gname]['status'], "highloss")) {
+ $online = gettext("Packetloss");
+ $bgcolor = "danger"; // lightcoral
} elseif (stristr($gateways_status[$gname]['status'], "loss")) {
$online = gettext("Packetloss");
$bgcolor = "warning"; // khaki
+ } elseif (stristr($gateways_status[$gname]['status'], "highdelay")) {
+ $online = gettext("Latency");
+ $bgcolor = "danger"; // lightcoral
} elseif (stristr($gateways_status[$gname]['status'], "delay")) {
$online = gettext("Latency");
$bgcolor = "warning"; // khaki
OpenPOWER on IntegriCloud