0% found this document useful (0 votes)
4 views1 page

Wireless Device Log Management Script

The document removes an existing log file, then loops through the wireless registration table, extracting data for each client and appending it line by line to the log file along with a timestamp.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Wireless Device Log Management Script

The document removes an existing log file, then loops through the wireless registration table, extracting data for each client and appending it line by line to the log file along with a timestamp.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

/file remove log.

txt
/file print file=[Link]
:delay 2000ms;
/file set [Link] contents=""

:foreach i in=[/interface wireless registration-table find] do={


:local mac [/interface wireless registration-table get $i mac-address]
:local uptime [/interface wireless registration-table get $i uptime]
:local lastseen [/interface wireless registration-table get $i last-activity]
:local logEntry ("MAC: " . $mac . " Uptime: " . $uptime . " Last seen: " .
$lastseen . "\r\n")

:local contents [/file get [Link] contents]


:set contents ($contents . $logEntry)
/file set [Link] contents=$contents
}

You might also like