Control Web Panel
Developers => New Modules => Topic started by: MyBuddyBen on January 06, 2016, 08:30:37 PM
-
This quickly and effectly uses the speedtest.net servers to test your server's internet bandwidth connection. Check to see if you're really getting what your provider says you should get!
Features:
- Speed test your server within 30 seconds
- Uses the connection from speedtest.net
- NO buttons to click, auto runs on page and live updates to show the speed
- Detects and uses the server closest to your server's geolocation
Latest Version: 1.1a
Add this line to:
/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php
<li><a href="index.php?module=speedtest"><span class="icon16 icomoon-icon-arrow-right-3"></span>Speed Test</a></li>
Then create a new file called "speedtest.php" on:
/usr/local/cwpsrv/htdocs/resources/admin/modules
with this content:
<center><h3>Speed test your server's internet connection</h3><h2>Verison 1.1a</h2><br>
Python file provided by Speedtest.net<br>
<button type="button" class="btn btn-warning" onclick='window.location.reload(true);'>Restart Test</button>
<a href="http://forum.centos-webpanel.com/new-modules/(module)-speedtest-your-server-in-30-seconds/" target="_blank"><button type="button" class="btn btn-primary">Check for Update</button></a><br><br></center>
<pre>
<?php
$command = "python /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest/speedtest.py 2>&1";
$pid = popen( $command,"r");
while( !feof( $pid ) )
{
echo fread($pid, 256);
flush();
ob_flush();
usleep(100000);
}
pclose($pid);
?>
</pre>
Then run this command from your Terminal/SSH Window (You can copy and paste this; Do the last empty line too ;) )
mkdir /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest
cd /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest
wget -O speedtest.py https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod 755 speedtest-cli.py
chmod +x speedtest-cli.py
echo Complete!
Now just load the page Developer Menu -> Speedtest from the sidebar and you will begin the speed test.
Which will be /index.php?module=speedtest
-
Thanks mate, well done :)
-
thanks bentheman96 , awesome
-
Updated to 1.1a
* Updated github speedtest.py new link.
-
Hi,
This file is not available in newer version
/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php all another files are encryped
-
What a shame. People spend time making modules to share and then files get encrypted and end users cannot use. As a new user (pro) makes me think twice about creating modules...
-
Sadly I can't modify my first post :-\ ???
But for the 3rdparty.php; it still works. You just need to create it ;)
From SSH you can simply CD into /usr/local/cwpsrv/htdocs/resources/admin/include and do "touch 3rdparty.php" command
Then follow the steps above with normal modules. So modules and 3rdparty support still work.
-
Thanks, it works
-
What a shame. People spend time making modules to share and then files get encrypted and end users cannot use. As a new user (pro) makes me think twice about creating modules...
how would you files got encrypted that is not possible???? since encryption can be done only by software developer so any custom script you have can't be encrypted in any way.
-
This still works :D
(https://tb5.chetcrooms.com/file/5tbhdd/Temp-Pictures/Screenshot_2020-07-15.png)