0) { set_single_sysctl('net.inet.carp.allow', '0'); if (is_array($config['virtualip']['vip'])) { $viparr = &$config['virtualip']['vip']; foreach ($viparr as $vip) { if ($vip['mode'] != "carp" && $vip['mode'] != "ipalias") continue; if ($vip['mode'] == "ipalias" && substr($vip['interface'], 0, 4) != "_vip") continue; interface_vip_bring_down($vip); } } $savemsg = sprintf(gettext("%s IPs have been disabled. Please note that disabling does not survive a reboot and some configuration changes will re-enable."), $carp_counter); $status = 0; } else { $savemsg = gettext("CARP has been enabled."); if (is_array($config['virtualip']['vip'])) { $viparr = &$config['virtualip']['vip']; foreach ($viparr as $vip) { switch ($vip['mode']) { case "carp": interface_carp_configure($vip); break; case 'ipalias': if (substr($vip['interface'], 0, 4) == "_vip") { interface_ipalias_configure($vip); } break; } } } interfaces_sync_setup(); set_single_sysctl('net.inet.carp.allow', '1'); $status = 1; } } $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); if (!empty($_POST['resetdemotion'])) { set_single_sysctl("net.inet.carp.demotion", 0 - $carp_detected_problems); sleep(1); $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); } $pgtitle = array(gettext("Status"), gettext("CARP")); $shortcut_section = "carp"; include("head.inc"); if ($savemsg) { print_info_box($savemsg, 'success'); } $carpcount = 0; if (is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $carp) { if ($carp['mode'] == "carp") { $carpcount++; break; } } } // If $carpcount > 0 display buttons then display table // otherwise display error box and quit if ($carpcount == 0) { print_info_box(gettext('No CARP interfaces have been defined.') . '
' . '' . gettext("High availability sync settings can be configured here.") . ''); } else { ?>
0) { $carp_enabled = true; } else { $carp_enabled = false; } // Sadly this needs to be here so that it is inside the form if ($carp_detected_problems != 0) { print_info_box( gettext("CARP has detected a problem and this unit has a non-zero demotion status.") . "
" . gettext("Check the link status on all interfaces configured with CARP VIPs and ") . sprintf(gettext('search the %1$sSystem Log%2$s for CARP demotion-related events.'), "", "") . "

" . '', 'danger' ); } ?>

@ {$aliases[$i]}"); } ?>