net-snmp: monitor ifindex changes
authorStijn Tintel <redacted>
Wed, 18 Feb 2015 05:03:54 +0000 (06:03 +0100)
committerStijn Tintel <redacted>
Wed, 18 Feb 2015 05:19:59 +0000 (06:19 +0100)
When an ifindex for an interface changes, some monitoring tools can no
longer find the interface and send alerts. Monitor all network
interfaces via the procd netdev parameter, so that
/etc/init.d/snmpd reload will restart snmpd if any ifindex changed.

Signed-off-by: Stijn Tintel <redacted>
net/net-snmp/files/snmpd.init

index a261447668178dc1a3246ad7eb102b1600e6e942..3dd8c41dc2f836a7312c8f3de09077c6c3386c76 100644 (file)
@@ -159,6 +159,10 @@ start_service() {
        procd_set_param file $CONFIGFILE
        procd_set_param respawn
 
+       for iface in $(ls /sys/class/net 2>/dev/null); do
+               procd_append_param netdev "$iface"
+       done
+
        procd_close_instance
 }
 
git clone https://git.99rst.org/PROJECT