Once upon a time it was possible to write quick and dirty tools in shell. You used to just be able to open a port, write a tiny little daemon, and go. And we used to have handy tools like rwho and finger to figure out who was online, ruptime to check uptime, etc, etc.<br>
<br>That's too insecure nowadays...<br>so we have 3 different levels of snmp which you can use (if you can secure it), and<br>run a shell command from that, remotely, then parse... or use ssh, and parse.<br><br>And then we have dhcp, which hands out leases, but is not tied to how wifi goes up<br>
and down.<br><br>This morning I had a need to figure who was actually on a couple cerowrt APs,<br>and a few statistics as to their connected rate... <br><br>I haven't got so as figuring out how to do all that via snmpd yet, but as this uses<br>
an obscure feature of the mac802.11 stack, I thought I'd document this much.<br><br>If there is a better way, a mib, something, let me know....<br clear="all"><br>#!/bin/sh<br># rup: quickly see whos really on the wifi<br>
<br>A=`ls /sys/kernel/debug/ieee80211/phy*/netdev:*/stations | \<br> cut -f8 -d/ | tr '\n' '|'`<br># cut off last |<br>egrep ${A%?} /tmp/dhcp.leases | awk '{print $3 " " $4 }'<br><br><br>
<br><br>-- <br>Dave Täht<br><br>Fixing bufferbloat with cerowrt: <a href="http://www.teklibre.com/cerowrt/subscribe.html" target="_blank">http://www.teklibre.com/cerowrt/subscribe.html</a>