finalizing code
This commit is contained in:
@ -3,18 +3,17 @@
|
||||
<body>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body ">
|
||||
<img src="plugins/Speedtest/speedtest-logo.png" title="Speedtest Logo" class="device-icon-header pull-left" style="height:100%;max-height: 100px;margin-top:5px">
|
||||
<img src="plugins/Speedtest/logos/speedtest-logo.png" title="Speedtest Logo" class="device-icon-header pull-left" style="max-height:25px;height:100%;margin-top:8px">
|
||||
<div class="pull-left" style="margin-top: 5px;">
|
||||
<span style="font-size: 20px;">antnetscaler02.icl-ltd.com</span><br />
|
||||
<span>POP (default)</span>
|
||||
<span style="font-size: 12px;font-weight: bold">Last used Speedtest server:</span><br />
|
||||
<span style="font-size: 12px;"><?php require_once("plugins/Speedtest/tmp/speedtest-server");?></span>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<img src="plugins/Speedtest/ookla-logo.png" title="Ookla Logo" style="height:100%;max-height: 100px;margin-top:5px">
|
||||
<img src="plugins/Speedtest/logos/ookla-logo.png" title="Ookla Logo" style="max-height: 50px">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style='clear: both;'>
|
||||
<div style='margin: 5px;'>
|
||||
<div class="panel panel-default">
|
||||
|
@ -37,14 +37,16 @@ SpeedtestResultDir=$SpeedtestPluginDir/tmp
|
||||
speedtest --accept-license --accept-gdpr -p no > $SpeedtestResultDir/speedtest-results 2>/dev/null
|
||||
|
||||
# Get the Latency
|
||||
Latency=$(cat $SpeedtestResultDir/speedtest-results | grep Latency | sed -r 's/\s+//g'| cut -d":" -f2 | cut -d"m" -f1)
|
||||
Latency=$(cat $SpeedtestResultDir/speedtest-results | grep Latency | sed 's/.*Latency:\s*\([0-9]*.[0-9]*\).*/\1/')
|
||||
|
||||
# Get the Download speed
|
||||
DownloadSpeed=$(cat $SpeedtestResultDir/speedtest-results | grep Download | sed -r 's/\s+//g'| cut -d":" -f2 | cut -d"M" -f1)
|
||||
DownloadSpeed=$(cat $SpeedtestResultDir/speedtest-results | grep Download | sed 's/.*Download:\s*\([0-9]*.[0-9]*\).*/\1/')
|
||||
|
||||
# Get the Upload speed
|
||||
UploadSpeed=$(cat $SpeedtestResultDir/speedtest-results | grep Upload | sed -r 's/\s+//g'| cut -d":" -f2 | cut -d"M" -f1)
|
||||
UploadSpeed=$(cat $SpeedtestResultDir/speedtest-results | grep Upload | sed 's/.*Upload:\s*\([0-9]*.[0-9]*\).*/\1/')
|
||||
|
||||
# Get the server that was used, dump it into a file
|
||||
cat $SpeedtestResultDir/speedtest-results | grep Server | sed 's/.*Server:\s*\(.*\)/\1/' > $SpeedtestResultDir/speedtest-server
|
||||
# Update the RRD graphs
|
||||
rrdtool update $RRDGraphsDir/speedtest-latency.rrd $DATE:$Latency
|
||||
rrdtool update $RRDGraphsDir/speedtest-bandwidth.rrd $DATE:$DownloadSpeed:$UploadSpeed
|
||||
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user