How to add snmp to TL-WR740 on 18.06?

Hello,

I have a large (500+) openwrt-based network on my University. Most of the devices have 4MB flash, and I am experimenting to see if it is possible to migrate them to 18.06, as they run a very bare-bone install.
I have been able to make everything work, with exception of SNMP. The package is not available for compilation on the "tiny" subtarget list (the TL-WR740 does not show on the "Generic" subtarget), and trying to install it afterwards runs into many dependencies.

Any tips on how to proceed? I am looking at adding a TL-WR740 profile on the "Generic" subtarget, and see if I can go from there.

I am already doing nfs mounts to supplement any disk (flash) space I may need after boot. I was unable to do extroot on nfs, though. Tips on that are also welcome, but maybe in another thread.

S.

I looked into SNMP not long ago and found that mini-snmp wasn't all that "mini" and that it only supported 32-bit counters (not terribly useful in this era, in my opinion). Both that and snmpd require libnetsnmp which is around 370 kB plus a couple other dependencies.

I'd look into seeing if a custom-built image could bring the installed-flash space down as the ROM uses xz compression, last I checked. You might have to remove other "unneeded" packages in your build, such as LuCI, uhttpd, PPP and PPPoE kernel modules, various DHCP and DNS packages (I'm assuming that those services are supplied elsewhere on your network).

The "tiny" target is the "last gasp" target for flash-constrained devices and removes, as I recall, LuCI and a couple other things to get the image size down.

You should compile your own image:
About the basics of image compilation - you can find

https://openwrt.org/docs/guide-user/additional-software/beginners-build-guide 4
https://openwrt.org/docs/guide-developer/build-system/install-buildsystem 4
https://openwrt.org/docs/guide-developer/build-system/use-buildsystem 3

Read a little bit about optimization - examples:

and the maybe you find enough space for snmp

I was using the latest (snapshot) image, and I think the packages list was broken, so I could not get snmp listed. I reverted to the "stable" tree, and snmp magically reappeared. It did not solve the size issue, though (I need wpad because I use WPA2 enterprise - other than that, everything is either needed or small).

Compiling from scratch was not enough, so I solved the problem by installing NFS and mounting extra space after boot - snmp files now live on the NFS server. I probably will not help smaller installs, but it is a nice trick. I am building an specialized box (using an 842 with a 8MB flash drive) to host the images.

*** UPDATE ***

I was interrupted while writing this message, and I think it has been one month! since I last got to it. I have the image with everything but snmp on the 740. It boots, mounts bin, sbin, lib, var, etc and www from the 842 running the NFS server and starts wifi and SNMP. It can work without NFS, but we lose reporting capabilities. We are doing the same now for the TP-Link WR849, which is a mediatek based router with the same chipset as the WR842v5, which is even harder than the 740 as unlike it, there is no option of keeping an older version because there is no support for it.

I came to see the answers and found this open - sorry for the lack of feedback. I will read the posts and answer them - maybe you figured it out better than I did, and I can kick myself for not reading this earlier.

S.

1 Like

Thank you for your answer. I tried compiling but SNMP and WPAD are both big, and both needed. No way to get both to fit. I cheated by adding "disk" space using NFS, and installing the SNMP modules after boot. I had to do some scripting to add delay or the NFS mount would fail, and we now have three layers - ROM, OVERLAY and NFS - which can make it pretty interesting to tell my students the current filesystem structure.

S.

1 Like