I wanted a script that mailed me the list of stations registering to each one of my APs, so if I needed to know where did a station last register to, I just had to search for it at gmail.
There’s a post telling how to attach a file with registration-table, but a gmail search wouldn’t find stations names on it.
So I came up with this script:
/interface wireless registration-table print file=out.txt
:global texto ""
:foreach i in=[ /int wir reg find ap=no] do={
:set texto ($texto. [/system identity get name] . " AP: " . [int wir reg get $i interface] . " Radio: " . [int wir reg get $i radio]. " Last IP: " . [int wir reg get $i last-ip] )
:set texto ($texto. " SignalStrength: ".[int wir reg get $i signal-strength]." Uptime: ".[int wir reg get $i uptime] ." Comment: ".[int wir reg get $i comment] ." \n")
}
/tool e-mail send to=" user@gmail.com " subject=([/system identity get name] . " " . [/system clock get time] . " " . [/system clock get date] . " Stations ") body=(:put $texto) file=out.txt ;
By Scheduling this daily, I can search my e-mails and know when was the last day a station registered and to which AP.
Oh, by the way, I used http://www.softstack.com/freesmtp.html as mail server, it’s the easiest one I found!!!
Would you like to enhance my script?