summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/templates/snmp/etc.snmpd.conf.tmpl4
-rw-r--r--op-mode-definitions/restart-snmp.xml.in13
2 files changed, 17 insertions, 0 deletions
diff --git a/data/templates/snmp/etc.snmpd.conf.tmpl b/data/templates/snmp/etc.snmpd.conf.tmpl
index 278506350..db2114fa1 100644
--- a/data/templates/snmp/etc.snmpd.conf.tmpl
+++ b/data/templates/snmp/etc.snmpd.conf.tmpl
@@ -22,6 +22,10 @@ notificationEvent linkDownTrap linkDown ifIndex ifDescr ifType ifAdminStatus i
monitor -r 10 -e linkUpTrap "Generate linkUp" ifOperStatus != 2
monitor -r 10 -e linkDownTrap "Generate linkDown" ifOperStatus == 2
+# Remove all old ifTable entries with the same ifName as newly appeared
+# interface (with different ifIndex) - this is the case on e.g. ppp interfaces
+interface_replace_old yes
+
########################
# configurable section #
########################
diff --git a/op-mode-definitions/restart-snmp.xml.in b/op-mode-definitions/restart-snmp.xml.in
new file mode 100644
index 000000000..7de27df64
--- /dev/null
+++ b/op-mode-definitions/restart-snmp.xml.in
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="restart">
+ <children>
+ <node name="snmp">
+ <properties>
+ <help>Restart SNMP service</help>
+ </properties>
+ <command>if cli-shell-api existsActive service snmp; then sudo systemctl restart snmpd.service; else echo "Service SNMP not configured"; fi</command>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>