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 ++++++++++- .../syslog/host/node.tag/facility/node.tag/protocol/node.def | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 templates/system/syslog/host/node.tag/facility/node.tag/protocol/node.def 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 -- cgit v1.2.3 From 7b344f5365c9ec2d4d746b14216cd09c0e40b2a6 Mon Sep 17 00:00:00 2001 From: Abdelouahed Haitoute Date: Thu, 1 May 2014 15:16:02 +0200 Subject: Added feature to add smuxpeer entries in file /etc/snmp/snmpd.conf. See VyOS bug 196 for more information about the feature request. --- scripts/snmp/vyatta-snmp.pl | 6 ++++++ templates/service/snmp/smuxpeer/node.def | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 templates/service/snmp/smuxpeer/node.def diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index 09ed84b8..7d00be97 100755 --- a/scripts/snmp/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl @@ -215,6 +215,12 @@ sub snmp_get_values { print_community($config, $community); } + $config->setLevel("service snmp smuxpeer"); + my @smuxpeers = $config->returnValues(); + foreach my $smuxpeer (@smuxpeers) { + print "smuxpeer $smuxpeer \n"; + } + $config->setLevel($snmp_level); my $contact = $config->returnValue("contact"); if (defined $contact) { diff --git a/templates/service/snmp/smuxpeer/node.def b/templates/service/snmp/smuxpeer/node.def new file mode 100644 index 00000000..638e9367 --- /dev/null +++ b/templates/service/snmp/smuxpeer/node.def @@ -0,0 +1,4 @@ +multi: +type: txt +help: Register a subtree for SMUX-based processing +val_help: oid; Object Identifier -- cgit v1.2.3