From be5d59d74f6ae394ee267157331ebaa81b7b27a1 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 24 Aug 2009 22:17:45 -0400 Subject: Allow up to 3 remote syslog servers. Resolves #11 --- usr/local/www/diag_logs_settings.php | 74 ++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 11 deletions(-) (limited to 'usr') diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php index b744258..02253c0 100755 --- a/usr/local/www/diag_logs_settings.php +++ b/usr/local/www/diag_logs_settings.php @@ -43,6 +43,8 @@ require("guiconfig.inc"); $pconfig['reverse'] = isset($config['syslog']['reverse']); $pconfig['nentries'] = $config['syslog']['nentries']; $pconfig['remoteserver'] = $config['syslog']['remoteserver']; +$pconfig['remoteserver3'] = $config['syslog']['remoteserver2']; +$pconfig['remoteserver3'] = $config['syslog']['remoteserver3']; $pconfig['filter'] = isset($config['syslog']['filter']); $pconfig['dhcp'] = isset($config['syslog']['dhcp']); $pconfig['portalauth'] = isset($config['syslog']['portalauth']); @@ -66,6 +68,16 @@ if ($_POST) { if ($_POST['enable'] && !is_ipaddr($_POST['remoteserver'])) { $input_errors[] = "A valid IP address must be specified."; } + if ($_POST['enable'] && $_POST['remoteserver2'] && !is_ipaddr($_POST['remoteserver2'])) { + $input_errors[] = "A valid IP address must be specified for remote syslog server #2."; + } + if ($_POST['enable'] && $_POST['remoteserver3'] && !is_ipaddr($_POST['remoteserver3'])) { + $input_errors[] = "A valid IP address must be specified for remote syslog server #3."; + } + if ($_POST['enable'] && !is_ipaddr($_POST['remoteserver'])) { + $input_errors[] = "A valid IP address must be specified."; + } + if (($_POST['nentries'] < 5) || ($_POST['nentries'] > 2000)) { $input_errors[] = "Number of log entries to show must be between 5 and 2000."; } @@ -74,6 +86,8 @@ if ($_POST) { $config['syslog']['reverse'] = $_POST['reverse'] ? true : false; $config['syslog']['nentries'] = (int)$_POST['nentries']; $config['syslog']['remoteserver'] = $_POST['remoteserver']; + $config['syslog']['remoteserver2'] = $_POST['remoteserver2']; + $config['syslog']['remoteserver3'] = $_POST['remoteserver3']; $config['syslog']['filter'] = $_POST['filter'] ? true : false; $config['syslog']['dhcp'] = $_POST['dhcp'] ? true : false; $config['syslog']['portalauth'] = $_POST['portalauth'] ? true : false; @@ -85,8 +99,11 @@ if ($_POST) { $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']); $config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true; $config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false; - if($config['syslog']['enable'] == false) + if($config['syslog']['enable'] == false) { unset($config['syslog']['remoteserver']); + unset($config['syslog']['remoteserver2']); + unset($config['syslog']['remoteserver3']); + } write_config(); @@ -110,6 +127,8 @@ include("head.inc"); function enable_change(enable_over) { if (document.iform.enable.checked || enable_over) { document.iform.remoteserver.disabled = 0; + document.iform.remoteserver2.disabled = 0; + document.iform.remoteserver3.disabled = 0; document.iform.filter.disabled = 0; document.iform.dhcp.disabled = 0; document.iform.portalauth.disabled = 0; @@ -117,6 +136,8 @@ function enable_change(enable_over) { document.iform.system.disabled = 0; } else { document.iform.remoteserver.disabled = 1; + document.iform.remoteserver2.disabled = 1; + document.iform.remoteserver3.disabled = 1; document.iform.filter.disabled = 1; document.iform.dhcp.disabled = 1; document.iform.portalauth.disabled = 1; @@ -181,20 +202,51 @@ function enable_change(enable_over) {   - onClick="enable_change(false)"> - Enable syslog'ing to remote syslog server - - -   onClick="enable_change(false)"> Disable writing log files to the local ram disk - Remote syslog - server - -
- IP address of remote syslog server

> +   + onClick="enable_change(false)"> + Enable syslog'ing to remote syslog server + + + Remote syslog servers + + + + + + + + + + + + + + + + + +
+ Server 1 + + +
+ Server 2 + + +
+ Server 3 + + +
+   + + IP addresses of remote syslog servers +
+ > system events
> firewall events
> DHCP service events
> -- cgit v1.1