* [PATCH 2/3 v4] allow changing remote syslog protocol to TCP
@ 2017-11-20 18:40 Peter Müller
0 siblings, 0 replies; only message in thread
From: Peter Müller @ 2017-11-20 18:40 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]
Add option to change remote syslog protocol to TCP, which
is more reliable than UDP, but might be unsupported on
older syslog servers.
Signed-off-by: Peter Müller <peter.mueller(a)link38.eu>
---
html/cgi-bin/logs.cgi/config.dat | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/html/cgi-bin/logs.cgi/config.dat b/html/cgi-bin/logs.cgi/config.dat
index 789341dbe..aed0db9cf 100644
--- a/html/cgi-bin/logs.cgi/config.dat
+++ b/html/cgi-bin/logs.cgi/config.dat
@@ -33,6 +33,7 @@ $logsettings{'LOGWATCH_KEEP'} = '56';
my @VS = ('15','50','100','150','250','500');
$logsettings{'ENABLE_REMOTELOG'} = 'off';
$logsettings{'REMOTELOG_ADDR'} = '';
+$logsettings{'REMOTELOG_PROTOCOL'} = 'udp';
$logsettings{'ACTION'} = '';
&Header::getcgihash(\%logsettings);
@@ -45,6 +46,10 @@ if ($logsettings{'ACTION'} eq $Lang::tr{'save'})
{
$errormessage = $Lang::tr{'invalid logserver address'};
}
+ unless ($logsettings{'REMOTELOG_PROTOCOL'} =~ /^udp|tcp$/)
+ {
+ $errormessage = $Lang::tr{'invalid logserver protocol'};
+ }
}
unless ($logsettings{'LOGWATCH_KEEP'} =~ /^\d+$/)
{
@@ -69,6 +74,10 @@ $checked{'ENABLE_REMOTELOG'}{'off'} = '';
$checked{'ENABLE_REMOTELOG'}{'on'} = '';
$checked{'ENABLE_REMOTELOG'}{$logsettings{'ENABLE_REMOTELOG'}} = "checked='checked'";
+$selected{'REMOTELOG_PROTOCOL'}{'udp'} = '';
+$selected{'REMOTELOG_PROTOCOL'}{'tcp'} == '';
+$selected{'REMOTELOG_PROTOCOL'}{$logsettings{'REMOTELOG_PROTOCOL'}} = "selected='selected'";
+
$checked{'LOGVIEW_REVERSE'}{'off'} = '';
$checked{'LOGVIEW_REVERSE'}{'on'} = '';
$checked{'LOGVIEW_REVERSE'}{$logsettings{'LOGVIEW_REVERSE'}} = "checked='checked'";
@@ -139,6 +148,11 @@ print <<END
<tr>
<td class='base'>$Lang::tr{'enabled'}</td><td><input type='checkbox' name='ENABLE_REMOTELOG' $checked{'ENABLE_REMOTELOG'}{'on'} /></td>
<td>$Lang::tr{'log server address'}</td><td><input type='text' name='REMOTELOG_ADDR' value='$logsettings{'REMOTELOG_ADDR'}' /></td>
+ <td>$Lang::tr{'log server protocol'}</td><td>
+ <select name='REMOTELOG_PROTOCOL'>
+ <option value='udp' $selected{'REMOTELOG_PROTOCOL'}{'udp'}>$Lang::tr{'udp less overhead'}</option>
+ <option value='tcp' $selected{'REMOTELOG_PROTOCOL'}{'tcp'}>$Lang::tr{'tcp more reliable'}</option>
+ </select></td>
</tr>
</table>
END
--
2.13.6
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-11-20 18:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-20 18:40 [PATCH 2/3 v4] allow changing remote syslog protocol to TCP Peter Müller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox