From 0a4fbd990e6f529d32aed440fb9c806cd25ee06d Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 6 Mar 2015 12:26:21 -0500 Subject: Expand CARP demotion error, add button to reset demotion status. --- usr/local/www/carp_status.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'usr/local/www/carp_status.php') diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index fc8de57..1faebf0 100644 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -112,7 +112,13 @@ if($_POST['disablecarp'] <> "") { } } -$carp_detected_problems = ((get_single_sysctl("net.inet.carp.demotion")) > 0); +$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); + +if (!empty($_POST['resetdemotion'])) { + set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}"); + sleep(1); + $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); +} $pgtitle = array(gettext("Status"),gettext("CARP")); $shortcut_section = "carp"; @@ -125,8 +131,21 @@ include("head.inc");
-" . gettext("Check link status on all interfaces with configured CARP VIPs.")); ?> - + 0) { + print_info_box( + gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "
" . + gettext("Check the link status on all interfaces with configured CARP VIPs.") . "
" . + gettext("Search the") . + " " . + gettext("system log") . + " " . + gettext("for CARP demotion-related events.") . "
" . + "" + ); + +} ?>
@@ -195,6 +214,7 @@ include("head.inc"); $icon = "\"init\""; } else $icon = ""; + } } echo ""; echo ""; -- cgit v1.1
" . convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid}  " . $ipaddress . "