Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: DSLStats and RPi Webserver  (Read 5166 times)

jid

  • Content Team
  • Kitizen
  • *
  • Posts: 1945
DSLStats and RPi Webserver
« on: December 31, 2014, 06:25:31 PM »

DSLStats I notice sometimes doesn't allow its web server to work - it never has worked with my setup from the Pi.

So if anyone is interested, I've made a little workaround where the Pi uploads the files from the \.dslstats\webserver directory to your own FTP server. In my case, I'm uploading to my own website.

First you may need to install ncftp, the following command will do this:
Code: [Select]

sudo apt-get install ncftp


You'll need to create a script file, this works for me:
Code: [Select]
echo "Uploading to FTP..."
ncftpput -mR -t 300 -u ftpuserhere -p ftppasswordhere yourftpserver /webstats /home/pi/.dslstats/webserver
echo "Upload Completed."

An example, would be as follows:
Code: [Select]
echo "Uploading to FTP..."
ncftpput -mR -t 300 -u joebloggs@mywebserver.co.uk -p mypassword ftp.mywebserver.co.uk /public_html/stats /home/pi/.dslstats/webserver
echo "Upload Completed."

The above example would upload to www.mywebserver.co.uk/stats/webserver/

You then need to just add this script to run from cron every 5 mins or whatever interval you want. Add the following line to your cron file:

Code: [Select]

*/5 * * * * /home/pi/bin/ftp_script


I hope Eric doesn't mind me posting this workaround? Happy New Year to all :)
« Last Edit: December 31, 2014, 06:40:57 PM by jid »
Logged
Kind Regards
Jamie

BT FTTP - 75meg | Sky Q |  Bridgend Weather

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43573
  • Penguins CAN fly
    • DSLstats
Re: DSLStats and RPi Webserver
« Reply #1 on: December 31, 2014, 06:35:20 PM »

I don't mind at all Jamie. Thank you for posting that (and happy new year to you :) )
Logged
  Eric

atsw

  • Just arrived
  • *
  • Posts: 5
Re: DSLStats and RPi Webserver
« Reply #2 on: May 22, 2015, 01:36:54 PM »

Hi Jamie,

I experienced a similar issue with DSLStats running on my Raspberry Pi.  My work-around was to install teh basic Apache Webserver (no PHP or anything else needed) and then changed the default file location from \var\www to ~/.dslstats/webserver. I also made a copy of the file called combined.html and renamed it index.html so it acted as the default landing page.  The underlying PNG and TXT files called by index.html update as DSLStats produces new versions.

Regards

Andrew
Logged

jid

  • Content Team
  • Kitizen
  • *
  • Posts: 1945
Re: DSLStats and RPi Webserver
« Reply #3 on: May 25, 2015, 10:16:45 AM »

Hi Jamie,

I experienced a similar issue with DSLStats running on my Raspberry Pi.  My work-around was to install teh basic Apache Webserver (no PHP or anything else needed) and then changed the default file location from \var\www to ~/.dslstats/webserver. I also made a copy of the file called combined.html and renamed it index.html so it acted as the default landing page.  The underlying PNG and TXT files called by index.html update as DSLStats produces new versions.

Regards

Andrew

I too did try this as a solution, Apache isn't the fastest on the Pi though I've found, I may venture to having another go soon, but for the time being the files simply upload via FTP to my hosting provider.

I have a Raspberry Pi 2 here which I'm tempted to set up as a web server, so depending on performance, I may consider running DSL Stats on that new Pi.
Logged
Kind Regards
Jamie

BT FTTP - 75meg | Sky Q |  Bridgend Weather

atsw

  • Just arrived
  • *
  • Posts: 5
Re: DSLStats and RPi Webserver
« Reply #4 on: May 25, 2015, 11:48:14 AM »

Thanks for the follow-up message.  I can confirm I'm running with a Raspberry Pi 2 - Model B (1GB) and Apache seems to be behaving pretty well.  It's only serving a small selection of the  DSLStats outputs, so not exactly under load ::).

Cheers

Andrew
« Last Edit: May 25, 2015, 03:40:06 PM by atsw »
Logged

loonylion

  • Reg Member
  • ***
  • Posts: 723
Re: DSLStats and RPi Webserver
« Reply #5 on: May 25, 2015, 01:01:19 PM »

try using lighttpd or nginx instead of apache, they're much lighter.
Logged

MartinGoose

  • Member
  • **
  • Posts: 93
Re: DSLStats and RPi Webserver
« Reply #6 on: May 25, 2015, 04:17:09 PM »

try using lighttpd or nginx instead of apache, they're much lighter.

Using SimpleHTTPServer is even lighter. See
http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python

as I posted previously
http://forum.kitz.co.uk/index.php/topic,14169.msg265843.html#msg265843
Logged

NewtronStar

  • Kitizen
  • ****
  • Posts: 4898
Re: DSLStats and RPi Webserver
« Reply #7 on: June 14, 2015, 04:26:57 PM »

It's good to see more people using their Raspberry Pi to monitor stats using DSLStats if i remember back when MDWS started there was a only a few users using the Pi and now it's into the twentys  :cool:
Logged

MartinGoose

  • Member
  • **
  • Posts: 93
Re: DSLStats and RPi Webserver
« Reply #8 on: June 14, 2015, 05:23:57 PM »

It's good to see more people using their Raspberry Pi to monitor stats using DSLStats

RPis are very useful. I have 4! One monitors my FFTC connection and downloads iPlayer stuff. A second turns my Sony TV into a smartish TV using software of my choosing (Openelec). A third operates as an OpenVPN server when away from the house and using hotel WiFi. The fourth is a new V2 running Ubuntu MATE quite nicely (not a fan of LXDE) using the more powerful processor.
Logged
 

anything