Expand CARP demotion error, add button to reset demotion status.

This commit is contained in:
jim-p 2015-03-06 12:26:21 -05:00
parent c17478a649
commit 7ba5aeebef

View File

@ -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");
<form action="carp_status.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?PHP if ($carp_detected_problems) print_info_box(gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br />" . gettext("Check link status on all interfaces with configured CARP VIPs.")); ?>
<?PHP if ($carp_detected_problems > 0) {
print_info_box(
gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br/>" .
gettext("Check the link status on all interfaces with configured CARP VIPs.") . "<br/>" .
gettext("Search the") .
" <a href=\"/diag_logs.php?filtertext=carp%3A+demoted+by\">" .
gettext("system log") .
"</a> " .
gettext("for CARP demotion-related events.") . "<br/>" .
"<input type=\"submit\" name=\"resetdemotion\" id=\"resetdemotion\" value=\"" .
gettext("Reset CARP Demotion Status") .
"\" />"
);
} ?>
<div id="mainlevel">
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="carp status">
@ -199,6 +218,7 @@ include("head.inc");
$icon = "<img {$align} src=\"/themes/".$g['theme']."/images/icons/icon_log.gif\" alt=\"init\" />";
} else
$icon = "";
}
}
echo "<td class=\"listlr\" align=\"center\">" . convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid} &nbsp;</td>";
echo "<td class=\"listlr\" align=\"center\">" . $ipaddress . "&nbsp;</td>";