What's new

Script to auto-manage Clients list in NVRAM?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

AppleBag

Regular Contributor
I posted this an another thread but it was overlooked, so I'll ask here; is there a script or something that I can add that will monitor my clients list for clients that haven't connected in X amount of time, and if so, save it's info (MAC + name and chosen icon) to a file, remove it from NVRAM, and if the MAC is ever seen again, add it back from the backup file?

This way I'd never have to micromanage that portion of NVRAM; it would keep my clients list lean and mean, and if an old client ever crops back up I would immediately know what it is again since I had it's name saved.

Flow as I'm picturing it would be like this:

  • Script checks custom_clientlist variable in NVRAM every (say) hour/day/whatever:
  • Script stores all new clients in a file (name, mac, icon, last seen time)
  • Script compares current clients during check with those in the stored file; those that exist in the file get any new stuff updated (timestamp of last check, and any name or icon changes, updating those as well if necessary)
  • Those MACS that are not in the current list during check get moved to a second file, with last seen timestamp.
  • After X amount of days/weeks/whatever if a MAC in the second file still hasn't shown face, remove it from NVRAM, to save NVRAM space (but keep it "forever" in the second file, in the off chance it may pop up a long way down the road, so at least you know what it is),
  • If an "old" MAC in the second file ever does show back up, remove remove it from the second file and ill be added again to the first file.

Perhaps a config file so the user cna choose how often to do the check, and how often to have it clear NVRAM of "dead" clients. Bonus if added as a Quality of Life tab in settings for the sexy points. :p
 
Last edited:
The custom_clientlist nvram variable isn't used in that way or for that purpose.

I guess you're really talking about the Network Map Offline Client List.
 
The custom_clientlist nvram variable isn't used in that way or for that purpose.

I guess you're really talking about the Network Map Offline Client List.

Do I have the wrong variable? I not super familiar with the inner workings.

What I mean is this:

Code:
nvram show | awk '{print length(), $0 | "sort -n -r"}' | cut -d"=" -f 1 | head -n 20
size: 65301 bytes (235 left)
2102 custom_clientlist
931 nc_setting_conf
734 wl0_maclist_x
733 wl_maclist_x
573 rc_support
410 wl1_maclist_x
237 webdav_smb_pc
171 dnsfilter_rulelist
171 asus_device_list
164 subnet_rulelist
151 wollist
131 wl1_chansps
120 qos_rulelist
117 pptpd_clientlist
112 vlan_rulelist
100 cfg_device_list
92 1:pa5ga2
92 1:pa5ga1
92 1:pa5ga0
89 vpn_server1_ncp_ciphers

custom_clientlist is at the top of the list. And when I do a:

Code:
nvram show 2>/dev/null | grep ^custom
custom_clientlist=<M|Rk2>CC:9D:A9:99:99:99>0>4>><M|Pod>90:96:59:D9:99:99>0>0>>

I see all of the MACs, each's related icon code, and name I've edited in for it (if I edited it).

When I need to trim that down and clean out all the "dead" devices, I export the custom_clientlist, edit it as needed, reimport it, and commit to NVRAM. Which can obviously get tiresome and annoying manually going through these micromanagement steps, especially when only really noticing it after something negative happened, like some forwarded ports suddenly disappearing, etc.
 
Last edited:
I may be understanding what you're saying, it sounds like you think custom_clientlist is automatically updated each time a new client connects. Is that correct or am I missing the point?
 
I may be understanding what you're saying, it sounds like you think custom_clientlist is automatically updated each time a new client connects. Is that correct or am I missing the point?

Pretty much. Or more accurately, every time the router itself does whatever it does to see which clients are connected, whether new or not, (or offline), it updates itself?
 
But now that I think about it, I guess it only keeps track of any clients that I've specifically renamed/changed icon? If that's the case, I think my idea could still work with that in terms of clearing out "old" clients in the variable, to free up NVRAM?
 
Pretty much. Or more accurately, every time the router itself does whatever it does to see which clients are connected, whether new or not, (or offline), it updates itself?
Yeah, that variable doesn't do that. You're talking about the Network Map offline and online client lists. custom_clientlist is a static list that only changes when you change or add to it from the "Client status" list.
 
If an addon doesn't exist like this already, it seems super simple to make, but I don't really know Linux all that well, or the inner workings of the routers, so what would take me a literal month or more to make, would probably take just a day or two for someone super fluent in it, lol
 
Yeah, that variable doesn't do that. You're talking about the Network Map offline and online client lists. custom_clientlist is a static list that only changes when you change or add to it from the "Client status" list.
Yea, I like to label all devices on my network so I can better keep track of things going on, and potentially spot any "intruders", etc.
 
There is a similar built-in function in Asus App with 388 firmware router. It sends you a notification when a new device joins the network.
Handy, but it doesn't solve the problem with my NVRAM getting bloated over time after I've identified the device and given it a recognizable name. :)
 
but it doesn't solve the problem with my NVRAM getting bloated over time

Newer routers don't have the NVRAM size issue like older RT-AC68U and variants:

1670034961020.png


You have no problem to solve here. RT-AC86U running Asuswrt-Merlin 386.5_2 in the example.
 
Newer routers don't have the NVRAM size issue like older RT-AC68U and variants:

View attachment 45908

You have no problem to solve here. RT-AC86U running Asuswrt-Merlin 386.5_2 in the example.
I'm still using an ac68u, and not sure how long it may be until i get that upgrade, so it's still a problem, lol.

But even if/when I do upgrade, you have to admit, it's a good idea! ;)
 
Honestly, I never had to clean the NVRAM on any newer home router. I also know who's connecting to my home network because they got the password from me. Never had uninvited "intruders". On my business networks things are very different with device authentication in place.
 
Honestly, I never had to clean the NVRAM on any newer home router. I also know who's connecting to my home network because they got the password from me. Never had uninvited "intruders". On my business networks things are very different with device authentication in place.
And you only turn on things you know about. And you don't over configure your settings either.
 
ok ok ok, ya'll got me ... I like to play with all the settings. ;)

I'm a geek in that sense. I tinker. I play. I test things out to see if I like them, I test settings out to see what works best, what's faster, and so on.

I figger if I'm paying hundreds of dollars, and getting close-to-state-of-the-art hardware, I'm not gonna shy away from playing with it all, and trying to wring every drop out of it for my money.

I also live in a house where we're always adding new devices, left and right, so my NVRAM does tend to fill up. At lease on this ac68u. I'm most likely going to get the ax6000 soon, and it'll taker longer, but I also still tend to be a bit "anal" for lack of a better word ;) about housekeeping, and keeping things lean and mean as much as I can wherever possible.

I guess I'll just figure out how to whip this script up over time and add it myself; was just asking/hoping to see if there was already one out there, because i had no idea. :)
 
I figger if I'm paying hundreds of dollars, and getting close-to-state-of-the-art hardware

No. You're getting under $100 actual value hardware with planned obsolescence built-in, with somewhat working firmware with bugs and non-working features. You'll be used for beta tester and you'll pay for it. Your data will be send to 3rd party company to improve their commercial products. This is the real state-of-the-art you're getting for $200-300 router, switch and access point in all-in-one device with red design accents and RGB lights.
 
No. You're getting under $100 actual value hardware with planned obsolescence built-in, with somewhat working firmware with bugs and non-working features. You'll be used for beta tester and you'll pay for it. Your data will be send to 3rd party company to improve their commercial products. This is the real state-of-the-art you're getting for $200-300 router, switch and access point in all-in-one device with red design accents and RGB lights.
lol. Well ... I can't really argue with that. But, it's pretty much the best us consumers get to pick from, so it is what it is.

As for the bugs, that's what we have @RMerlin for. :p
 
The major bugs come from Asuswrt and are transferred to Asuswrt-Merlin with the base used to build it on top. Many are closed source code and can't be fixed. Bugs are sometimes fixed faster in Asuswrt, sometimes in Asuswrt-Merlin. You'll be beta testing for the life of the product and some widely advertised features still won't be fixed for you. There was a router case in the past with advertised and non-working MU-MIMO on chip level. This is state-of-the-art situation for this price range and on this specific market. Most consumers will never find their routers can't do what was advertised.
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top