According to the snmpd.conf man page, the engineID of an snmp agent
should be consistent through time. However, it seems that the engineID
changes every reboot. Add options to configure how the engineID is
generated. The default setting generates it based on the MAC address of
the eth0 interface.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
PKG_NAME:=net-snmp
PKG_VERSION:=5.7.3
PKG_NAME:=net-snmp
PKG_VERSION:=5.7.3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/net-snmp
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/net-snmp
option args /proc/sys/fs/file-nr
# option miboid 1.2.3.4
option args /proc/sys/fs/file-nr
# option miboid 1.2.3.4
+config engineid
+# option engineid 'LEDE'
+ option engineidtype '3'
+ option engineidnic 'eth0'
echo "$disk $partition $size" >> $CONFIGFILE
}
echo "$disk $partition $size" >> $CONFIGFILE
}
+snmpd_engineid_add() {
+ local cfg="$1"
+
+ config_get engineid "$cfg" engineid
+ [ -n "$engineid" ] && echo "engineID $engineid" >> $CONFIGFILE
+ config_get engineidtype "$cfg" engineidtype
+ [ "$engineidtype" -ge 1 -a "$engineidtype" -le 3 ] && \
+ echo "engineIDType $engineidtype" >> $CONFIGFILE
+ config_get engineidnic "$cfg" engineidnic
+ [ -n "$engineidnic" ] && echo "engineIDNic $engineidnic" >> $CONFIGFILE
+}
+
start_service() {
[ -f "$CONFIGFILE" ] && rm -f "$CONFIGFILE"
start_service() {
[ -f "$CONFIGFILE" ] && rm -f "$CONFIGFILE"
config_foreach snmpd_pass_add pass
config_foreach snmpd_exec_add exec
config_foreach snmpd_disk_add disk
config_foreach snmpd_pass_add pass
config_foreach snmpd_exec_add exec
config_foreach snmpd_disk_add disk
+ config_foreach snmpd_engineid_add engineid
procd_set_param command $PROG -Lf /dev/null -f
procd_set_param file $CONFIGFILE
procd_set_param command $PROG -Lf /dev/null -f
procd_set_param file $CONFIGFILE