From 2a583b1bdb0bcb5bb03ff642c4eee819de3bf50a Mon Sep 17 00:00:00 2001 From: Abdelouahed Haitoute Date: Tue, 29 Apr 2014 14:13:49 +0200 Subject: Added feature to send log message to remote syslog server over UDP or TCP. See VyOS bug 195 for more information about the feature request. --- scripts/system/vyatta_update_syslog.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts/system') diff --git a/scripts/system/vyatta_update_syslog.pl b/scripts/system/vyatta_update_syslog.pl index 3421d61a..dd834c92 100755 --- a/scripts/system/vyatta_update_syslog.pl +++ b/scripts/system/vyatta_update_syslog.pl @@ -110,7 +110,16 @@ unless (%entries) { read_config( $config, 'console', $CONSOLE ); foreach my $host ( $config->listNodes('host') ) { - read_config( $config, "host $host", '@'. $host ); + my $host_protocol; + foreach my $facility ( $config->listNodes("host $host facility") ) { + my $protocol = $config->returnValue("host $host facility $facility protocol"); + if ($protocol eq "tcp") { + $host_protocol = "@@"; + } else { + $host_protocol = "@"; + } + read_config( $config, "host $host", $host_protocol. $host ); + } } foreach my $file ( $config->listNodes('file') ) { -- cgit v1.2.3