From ece257304f51da5f3aaabf6e6823add79bbcac92 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 14 Dec 2010 12:06:26 -0500 Subject: Replace the LB status widget completely with one that supports the current LB system. --- .../widgets/load_balancer_status.widget.php | 237 +++++++++++---------- 1 file changed, 121 insertions(+), 116 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/widgets/widgets/load_balancer_status.widget.php b/usr/local/www/widgets/widgets/load_balancer_status.widget.php index c1cf979..5993b67 100644 --- a/usr/local/www/widgets/widgets/load_balancer_status.widget.php +++ b/usr/local/www/widgets/widgets/load_balancer_status.widget.php @@ -1,137 +1,142 @@ . + Copyright (C) 2005-2008 Bill Marquette - Copyright (C) 2004-2005 T. Lechat , Manuel Kasper - and Jonathan Watt . - All rights reserved. + Part of pfSense widgets (www.pfsense.com) + originally based on m0n0wall (http://m0n0.ch/wall) - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Copyright (C) 2004-2005 T. Lechat , Manuel Kasper + and Jonathan Watt . + All rights reserved. - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. */ require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); +require_once("vslb.inc"); + +$now = time(); +$year = date("Y"); - if (!is_array($config['load_balancer']['lbpool'])) { +if (!is_array($config['load_balancer']['lbpool'])) { $config['load_balancer']['lbpool'] = array(); - } - if (!is_array($config['load_balancer']['virtual_server'])) { - $config['load_balancer']['virtual_server'] = array(); - } - $a_vs = &$config['load_balancer']['virtual_server']; - $a_pool = &$config['load_balancer']['lbpool']; - - $slbd_logfile = "{$g['varlog_path']}/slbd.log"; - - $nentries = $config['syslog']['nentries']; - if (!$nentries) - $nentries = 50; - - $now = time(); - $year = date("Y"); - - +} +if (!is_array($config['load_balancer']['virtual_server'])) { + $config['load_balancer']['virtual_server'] = array(); +} +$a_vs = &$config['load_balancer']['virtual_server']; +$a_pool = &$config['load_balancer']['lbpool']; +$rdr_a = get_lb_redirects(); +$relay_hosts = get_lb_summary(); + +$lb_logfile = "{$g['varlog_path']}/relayd.log"; +$nentries = $config['syslog']['nentries']; +if (!$nentries) + $nentries = 50; + ?> - - - - - - - - - - - - -
NamePortServersStatusDescription
- - - -
-
- - "; - } +
{$server}
+ + + + + + + + + + - - - - -
ServerPoolDescription
+
+ +
+
+ + -
-
- - "; - } + echo ""; + echo ""; + } } } - ?> -
$online "; - if($lastchange <> "") { - PRINT "Last change $lastchange"; - } else { - PRINT "No changes found in logfile"; - } - PRINT "
{$server['ip']['addr']}:{$pool['port']} "; + if($server['ip']['avail']) + echo " ({$server['ip']['avail']}) "; + echo "
-
- -
+ } + ?> +
+ + + + + + + -- cgit v1.1