From: Stijn Tintel Date: Sat, 20 Feb 2016 15:29:28 +0000 (+0100) Subject: net-snmp: reload snmpd on interface events X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=5b1e9eefd01f098ad74389c967f1c5c9d1e286b3;p=openwrt-packages.git 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 --- diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init index 000a992d4..ff780975d 100644 --- 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' }