dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
2703
Ziggy842
join:2012-08-22
Aurora, IL

1 edit

Ziggy842

Member

[Troubleshooting] Logging signal strength levels

Some Powershell code I put together to log signal strength levels in a CSV file.

Example:
Date,BSID,CINR,RSSI,Address
2014-01-11 09:10,00:00:02:33:06:60,15 dB,-72 dBm,6.7.8.9
2014-01-11 09:15,00:00:02:33:06:60,15 dB,-72 dBm,6.7.8.9
2014-01-11 09:30,00:00:02:33:06:60,25 dB,-65 dBm,6.7.8.9
2014-01-11 09:45,00:00:02:33:06:60,25 dB,-64 dBm,6.7.8.9


# Log signal strength levels for the Clear Hub Express WIXFBR-131

if ($host.version.major -lt 3) {
write-warning "Requries Powershell V3 for Invoke-WebRequest cmdlet"
exit 1
}

$log = "c:\temp\clear.csv"
$url = "http://192.168.15.1/cgi-bin/sysconf.cgi?page=ajax.asp&action=status_home"
$timeStamp = get-date -f "yyyy-MM-dd HH:mm"

$body = invoke-webrequest $url
$parts = ($body.tostring()).split("`t")

$ip = $parts[2]
$cinr = $parts[6]
$rssi = $parts[7]
$bsid = $parts[8]

$stats = "$timestamp,$bsid,$cinr,$rssi,$ip"
$stats
$stats | out-file -enc ascii -append $log