Project

General

Profile

« Previous | Next » 

Revision 0a4fbd99

Added by Jim Pingle over 10 years ago

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

View differences:

usr/local/www/carp_status.php
112 112
	}
113 113
}
114 114

  
115
$carp_detected_problems = ((get_single_sysctl("net.inet.carp.demotion")) > 0);
115
$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
116

  
117
if (!empty($_POST['resetdemotion'])) {
118
	set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}");
119
	sleep(1);
120
	$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
121
}
116 122

  
117 123
$pgtitle = array(gettext("Status"),gettext("CARP"));
118 124
$shortcut_section = "carp";
......
125 131
<form action="carp_status.php" method="post">
126 132
<?php if ($savemsg) print_info_box($savemsg); ?>
127 133

  
128
<?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.")); ?>
129

  
134
<?PHP if ($carp_detected_problems > 0) {
135
	print_info_box(
136
		gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br/>" .
137
		gettext("Check the link status on all interfaces with configured CARP VIPs.") . "<br/>" .
138
		gettext("Search the") .
139
		" <a href=\"/diag_logs.php?filtertext=carp%3A+demoted+by\">" .
140
		gettext("system log") .
141
		"</a> " .
142
		gettext("for CARP demotion-related events.") . "<br/>" .
143
		"<input type=\"submit\" name=\"resetdemotion\" id=\"resetdemotion\" value=\"" .
144
		gettext("Reset CARP Demotion Status") .
145
		"\" />"
146
	);
147

  
148
} ?>
130 149

  
131 150
<div id="mainlevel">
132 151
	<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="carp status">
......
195 214
								$icon = "<img {$align} src=\"/themes/".$g['theme']."/images/icons/icon_log.gif\" alt=\"init\" />";
196 215
							} else
197 216
								$icon = "";
217
							}
198 218
						}
199 219
						echo "<td class=\"listlr\" align=\"center\">" . convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid} &nbsp;</td>";
200 220
						echo "<td class=\"listlr\" align=\"center\">" . $ipaddress . "&nbsp;</td>";

Also available in: Unified diff