I am currently using a RUT241 router, which is running RUT2M_R_00.07.05.4. I have installed the SNMP package and I’m pulling statistics from the router into Prometheus/Grafana every minute. However, I have noticed that memory usage is slowly increasing over time. After three days, the memory usage has reached 28 MB. But, after restarting the SNMP daemon, it goes back down to around 8MB.
The package contains NET-SNMP version 5.9.1, which is three minor versions behind the current version. Is it possible to run/install a newer version of net-snmp?
Thanks, Brendan
This is a graph of the memory usage over the last three days. The drop at the end is when I restarted the daemon.
Looks like one library leaks when used.
One way to determine which one is to perform a snmpwalk loop while checking the memory footprint of snmpd, and try to narrow the walk to identify the culprit. For example:
while :
do
snmpwalk -v 2c -c public 192.168.1.1 .1.3.6.1.4.1.48690
done
Thanks for the debugging tip. For now, until this is fixed, I limited the scrapping to the deviceGroup and modemGroup as that’s all I needed for my dashboard.
#!/usr/bin/bash
APP=snmpbulkwalk
OIDS=$(cat <<EOF
.1.3.6.1.4.1.48690.1
.1.3.6.1.4.1.48690.2
.1.3.6.1.4.1.48690.6
.1.3.6.1.4.1.48690.7
.1.3.6.1.4.1.48690.8
.1.3.6.1.4.1.48690.10
EOF
)
echo ${OIDS}
while :
do
for OID in ${OIDS}
do
${APP} -v 2c -c public <host> ${OID}
done
done