commit 5b1e9eefd01f098ad74389c967f1c5c9d1e286b3
parent 03c0a3ea31441161b43c6b996ada57e0a63b152b
Author: Stijn Tintel <stijn@linux-ipv6.be>
Date: Sat, 20 Feb 2016 16:29:28 +0100
net-snmp: reload snmpd on interface events
When applying wireless configuration changes, the ifindex of the
wireless interface(s) change. While snmpd picks up the new interfaces
with the correct index, it does not remove the old ones:
IF-MIB::ifName.23 = STRING: wlan0
IF-MIB::ifName.24 = STRING: wlan1
IF-MIB::ifName.25 = STRING: wlan0
IF-MIB::ifName.26 = STRING: wlan1
This causes problems for monitoring tools that use ifName (or ifDesc) as
interface reference. Add a trigger that reloads snmpd on interface
up/down events so that it will no longer have the old interfaces.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init
@@ -230,5 +230,12 @@ stop_service() {
}
service_triggers(){
+ local script=$(readlink "$initscript")
+ local name=$(basename ${script:-$initscript})
+
+ procd_open_trigger
+ procd_add_raw_trigger "interface.*" 2000 /etc/init.d/$name reload
+ procd_close_trigger
+
procd_add_reload_trigger 'snmpd'
}