I don't understand why the /etc/snmp/snmpd.conf is rewritten with some "defaults" each time the service is restarted
I've created a script
Tried to put it both in /root/bin or /usr/local/bin
Made it executable
From command line is working fine and is returning only the serial
I am editing in console the snmpd.conf and adding the line
I am checking it regularly with cat /etc/snmp/snmpd.conf
All seems ok
UNTIL
When I restart the service ( even through reboot ) , the line "disappears" from the config.
all it remains is
root@NWA1123-NI:~# cat /etc/snmp/snmpd.conf
agentaddress UDP:161,UDP6:161
master agentx
agentXSocket /var/run/agentx.sock
sysLocation ch;bl;town;u
sysContact mymail@gmail.com
sysName NWA1123-NI
com2sec ro default mymyread
com2sec rw localhost mymyrwrw
com2sec6 ro default mymyread
com2sec6 rw localhost mymyrwrw
group public v1 ro
group public v2c ro
group public usm ro
group private v1 rw
group private v2c rw
group private usm rw
view all included .1
access public "" any noauth exact all none none
access private "" any noauth exact all all all
exec filedescriptors /bin/cat /proc/sys/fs/file-nr
engineIDType 3
engineIDNic eth0
tried to put the line to pass the OID last, first,... in the middle
I need to mention that the snmpd.conf is generated by LUCI SNMP module.
Should I try to remove the LUCI SNMP module and do it manually?
Should I try to modify the LUCI in such a way it adds some custom snmpd config file?
I have ended up to use extend on both ZyXEL devices and Raspberry Pi with "serial-number"
In this way all OpenWRT devices I use will have the same OID for serial number.
Easy to create a template for monitoring / inventory.