diff options
author | Abdelouahed Haitoute <ahaitoute@rinis.nl> | 2014-04-29 14:13:49 +0200 |
---|---|---|
committer | Abdelouahed Haitoute <ahaitoute@rinis.nl> | 2014-04-29 14:13:49 +0200 |
commit | 2a583b1bdb0bcb5bb03ff642c4eee819de3bf50a (patch) | |
tree | fb1d8feef4a4cedade9d3e08335c74df67dab2fb | |
parent | 803a08517eef23f085961b046787b785a8832dc9 (diff) | |
download | vyatta-cfg-system-2a583b1bdb0bcb5bb03ff642c4eee819de3bf50a.tar.gz vyatta-cfg-system-2a583b1bdb0bcb5bb03ff642c4eee819de3bf50a.zip |
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.
-rwxr-xr-x | scripts/system/vyatta_update_syslog.pl | 11 | ||||
-rw-r--r-- | templates/system/syslog/host/node.tag/facility/node.tag/protocol/node.def | 6 |
2 files changed, 16 insertions, 1 deletions
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') ) { diff --git a/templates/system/syslog/host/node.tag/facility/node.tag/protocol/node.def b/templates/system/syslog/host/node.tag/facility/node.tag/protocol/node.def new file mode 100644 index 00000000..469d7a79 --- /dev/null +++ b/templates/system/syslog/host/node.tag/facility/node.tag/protocol/node.def @@ -0,0 +1,6 @@ +type: txt +help: Syslog communication protocol +syntax:expression: $VAR(@) in "udp", "tcp"; + "Must be \"udp\", or \"tcp\"" +val_help: udp; Send log messages to remote syslog server over UDP +val_help: tcp; Send log messages to remote syslog server over TCP |