diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/rl-system.init | 3 | ||||
-rw-r--r-- | scripts/snmp/vyatta-snmp.pl | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/scripts/rl-system.init b/scripts/rl-system.init index ed26301e..ee113ff6 100755 --- a/scripts/rl-system.init +++ b/scripts/rl-system.init @@ -94,7 +94,8 @@ update_version_info () { clear_or_override_config_files () { - for conf in snmp/snmpd.conf snmp/snmptrapd.conf keepalived/keepalived.conf \ + for conf in snmp/snmpd.conf snmp/snmptrapd.conf snmp/snmp.conf \ + keepalived/keepalived.conf \ ipvsadm.rules default/ipvsadm resolv.conf do if [ -s /etc/$conf ] ; then diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index 9a6a5039..8a26e3dc 100644 --- a/scripts/snmp/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl @@ -35,6 +35,7 @@ use warnings; my $mibdir = '/opt/vyatta/share/snmp/mibs'; my $snmp_init = '/opt/vyatta/sbin/snmpd.init'; my $snmp_conf = '/etc/snmp/snmpd.conf'; +my $snmp_client = '/etc/snmp/snmp.conf'; my $snmp_tmp = "/tmp/snmpd.conf.$$"; my $snmp_snmpv3_user_conf = '/usr/share/snmp/snmpd.conf'; my $snmp_snmpv3_createuser_conf = '/var/lib/snmp/snmpd.conf'; @@ -58,6 +59,8 @@ sub snmp_start { close $fh; select STDOUT; + snmp_client_config(); + move($snmp_tmp, $snmp_conf) or die "Couldn't move $snmp_tmp to $snmp_conf - $!"; @@ -191,6 +194,16 @@ EOF } } +sub snmp_client_config { + my $config = new Vyatta::Config; + my $trap_source = $config->returnValue('trap-source'); + + open (my $cf, '>', $snmp_client) + or die "Couldn't open $snmp_client - $!"; + print {$cf} "clientaddr $trap_source\n" if ($trap_source); + close $cf; +} + sub snmp_create_snmpv3_user { my $vyatta_user = shift; |