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:

Pages: [1] 2 3 ... 11

Author Topic: DSLstats webserver - Custom Interface  (Read 53286 times)

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33879
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
DSLstats webserver - Custom Interface
« on: March 15, 2018, 08:21:14 PM »

A couple of days ago I mentioned in this thread, that I'd been playing with a custom html interface for the dslstats inbuilt webserver display.
The custom interface displays all graphs but just outputs them in to more logical groups, that can be tabbed through.
I've had a request if I could make these files publicly available for use, so I've quickly packaged them together in a zip file attached below.



All the live stats work and update every minute.  Working example can be viewed here.
I'm using WinSCP to automatically FTP graphs from DSLstats to a remote website.

Output is as follows:
  • Summary - Displays telnet stats summary in text format
  • SNR Margin - Displays DSLstats graphs for SNR Margin, Downstream SNRM per band, Upstream SNRM per band
  • Connection - Displays graphs for Connection Speed, Bit Loading
  • Errors - Displays graphs for Errored Seconds, CRC, FEC, SES
  • Telnet - Displays full line stats as text using telnet output from adsl info --stats via dslstats
  • Line Health - Shows TBB BQM monitor,  QLN graph, Hlog graph 
  • History - Currently outputs historic graphs for SNRM, Err Secs & CRCs but could easily be adapted to add other folders

Please note:  The history section requires PHP to run and the output graphs work perfectly well by synchronising with local machine folders, but in time it would require a more robust FTP script to handle file management of older files.
As there has been little interest and zilch feedback in this section I stopped development after I got it to do what I needed (historic SNRM & errors).  My original aim was that it would only upload latest graphs in the relevant local folders and delete older files on the remote server to keep hosting bandwidth to a minimum.

The relevant files are included in the attached zip file if you want to make use of them yourself.

More info about History Section

By default history section expects files to be stored in categories eg SNRM/CRC etc .  This is because it's the way I have my system set up to store on my local machine and it was more logical (for me) to replicate this method on the remote server.

If you prefer to have snapshots in daily folders, then Jelv has written a cron script which creates symlinks to files in daily folders.   His script can be found in this post here.


+++++++++++++++++++++++++++++++
Update 08/06/2018 v2 released

Cosmetic changes to slightly improve layout.   
Added a container in the CSS to segment various sections to make it easier to drop more code into the body <div> 


CONTENTS OF FOLDER
++++++++++++++++++

css.css
connection.htm
errors.htm
fullstats.htm
index.htm
line.htm
snrm.htm
history.php
README.txt


---

+++++++++++++++++++++++++++++++
12/06/2018 - .asp version of the history page for Windows servers

g3uiss has developed an asp version of the history page for anyone running a windows server and is kindly making his aspnet scripts available for download.
These files are attached below as g3uiss_asp_version.   

You will still need the contents of DSLstats adv_web_interface, just replace the php file with the asp ones.

Downloads v1 = 58.  v1.1 = 24
« Last Edit: December 13, 2018, 10:10:03 AM by kitz »
Logged
Please do not PM me with queries for broadband help as I may not be able to respond.
-----
How to get your router line stats :: ADSL Exchange Checker

hacktrix2006

  • Reg Member
  • ***
  • Posts: 305
    • xDSL Stats:
Re: DSLstats webserver - Custom Interface
« Reply #1 on: March 15, 2018, 08:49:24 PM »

Thanks kitz for the package very greatful
Logged

pooclah

  • Reg Member
  • ***
  • Posts: 151
Re: DSLstats webserver - Custom Interface
« Reply #2 on: March 16, 2018, 03:00:16 PM »

Thank you – looks great and far better than anything I could have done.

Kevn
Logged

g3uiss

  • Kitizen
  • ****
  • Posts: 1151
  • You never too old to learn but soon I may be
    • Midas Solutions
Re: DSLstats webserver - Custom Interface
« Reply #3 on: March 16, 2018, 05:02:16 PM »

Great work. Thanks Kitz

Tony
Logged
Cerebus FTTP 500/70 Draytec 2927 VOXI 4G fallback.

vic0239

  • Reg Member
  • ***
  • Posts: 519
Re: DSLstats webserver - Custom Interface
« Reply #4 on: March 16, 2018, 06:28:46 PM »

Many thanks Kitz, a vast improvement on my efforts.

Andy.
Logged
Lothian Broadband 900/900 + AAISP VDSL, Vigor2865Vac, MikroTik rb260gsp, ZyXel NWA50AX WiFi AP.

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #5 on: March 16, 2018, 08:15:41 PM »

Many thanks to kitz for the development work on this project.

For someone not familiar with the Webserver capabilities of DSLStats can I possibly enquire:

1) Will this work in a RPi program environment.

2) What do I need to select in the DSLStats Webserver window to correctly activate the process.

3) Extract from README file.
++++++++++++++++++
INSTALLATION
++++++++++++++++++

Drop files into existing DSLstats webstats folder located at  dslstats>webserver

Q.) I don't have a webserver folder even after enabling Webserver, assuming I have done this correctly !

While these questions probably appear very basic to the more informed forum members I would suspect that many of the less informed members, myself included may be potentially confused.

Edit:
Have now discovered (from the DSLStats Event Log) that the "webserver" folder is created in /home/pi/.dslstats in a RPi program environment, in my case /home/pi/.dslstats/snapshots/webserver as I added a "snapshots" path, was looking in the /home/pi/dslstats (not .dslstats) folder where the program files reside.
With the kitz files now copied to there still none the wiser how to proceed further ?
« Last Edit: March 16, 2018, 08:55:34 PM by tiffy »
Logged
BT FTTP 150/30, BT Smart Hub 2

vic0239

  • Reg Member
  • ***
  • Posts: 519
Re: DSLstats webserver - Custom Interface
« Reply #6 on: March 16, 2018, 09:24:00 PM »

Just point your browser at http://ip.of.pi/dslstats/stats.htm (insert your
Pi’s ip address). That works fine for both of mine.
« Last Edit: March 16, 2018, 09:26:02 PM by vic0239 »
Logged
Lothian Broadband 900/900 + AAISP VDSL, Vigor2865Vac, MikroTik rb260gsp, ZyXel NWA50AX WiFi AP.

hacktrix2006

  • Reg Member
  • ***
  • Posts: 305
    • xDSL Stats:
Re: DSLstats webserver - Custom Interface
« Reply #7 on: March 17, 2018, 05:15:05 AM »

Its running great on my Raspberry Pi 1 B

http://solidus1983.mynetgear.com:65508/index.html

Loving it although I think I need a new Pi to sick my fingers in DSLStats murders my CPU right now.

Sent from my SHIELD Tablet K1 using Tapatalk
Logged

roseway

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 43467
  • Penguins CAN fly
    • DSLstats
Re: DSLstats webserver - Custom Interface
« Reply #8 on: March 17, 2018, 10:33:46 AM »

I've tried this out on my Linux system, and it works perfectly. It's a very nice enhancement.

Just so you know, I'm currently working on the webserver, but what I'm doing won't conflict with this. I'm adding the options for the user to choose where to save the webserver files, and to save them even when the webserver itself isn't running.
Logged
  Eric

krypton

  • Reg Member
  • ***
  • Posts: 128
Re: DSLstats webserver - Custom Interface
« Reply #9 on: March 17, 2018, 10:40:18 AM »

I think I need a new Pi to sick my fingers in DSLStats murders my CPU right now.

To reduce the CPU usage you can disable monitoring "SNR per tone" and "Bitloading". With this options disabled dslstats cpu time gets reduced to a quarter on my Rpi 1 B+.
Logged

hacktrix2006

  • Reg Member
  • ***
  • Posts: 305
    • xDSL Stats:
Re: DSLstats webserver - Custom Interface
« Reply #10 on: March 17, 2018, 12:30:10 PM »

To reduce the CPU usage you can disable monitoring "SNR per tone" and "Bitloading". With this options disabled dslstats cpu time gets reduced to a quarter on my Rpi 1 B+.
Thanks for the info will have a fiddle but SNRM graph I need as well as bitloading however its working great now.

Best of all if anything breaks I scripted the whole install setup for xrdp custom with fuse and xfce4. Then all I have to do is unzip some files for dslstats, set it up config wise then change raspi-config to auto boot GUI + login, boom dslstats runs automatically and rdp is blocked from use.

Sent from my SHIELD Tablet K1 using Tapatalk

edit: @morphium thanks for the tip its working great @roseway can't wait for that addon to dslstats

Also i thought with @kitz sharing his stuff i thought i'd share my script for setup DSL stats with RDP via xrdp.

Just remember that upon first boot and login run
Code: [Select]
sudo raspi-config

Then change password from raspberry to whatever with option (1), followed by going to Advance Options (7) and expanding the volume (A1), the reboot.

Re-log back in then use

Code: [Select]
pico setup.sh

then Copy and paste in

Code: [Select]
#!/bin/bash
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get clean
sudo apt-get -y install --no-install-recommends xserver-xorg
sudo apt-get -y install --no-install-recommends xinit
sudo apt-get -y install xfce4 xfce4-terminal
sudo apt-get -y install rc-gui
sudo apt-get -y install libgl1-mesa-dri
sudo apt-get -y install xserver-xorg-legacy xserver-xorg-core xfonts-base x11-xserver-utils
sudo apt-get -y install libx11-dev libxfixes-dev libssl-dev libpam0g-dev libtool libjpeg-dev flex bison gettext autoconf libxml-parser-perl libfuse-dev xsltproc libxrandr-dev python-libxml2 nasm xserver-xorg-dev fuse git
sudo apt-get -y install git pkg-config gcc g++ make libxrandr-dev libxml2-dev intltool xsltproc xutils-dev python-libxml2 g++ xutils libmp3lame-dev libpixman-1-dev
BD=`pwd`
mkdir -p "${BD}"/git/neutrinolabs
cd "${BD}"/git/neutrinolabs
wget https://github.com/neutrinolabs/xrdp/releases/download/v0.9.5/xrdp-0.9.5.tar.gz
wget https://github.com/neutrinolabs/xorgxrdp/releases/download/v0.2.4/xorgxrdp-0.2.4.tar.gz
cd "${BD}"/git/neutrinolabs
tar xvfz xrdp-0.9.5.tar.gz
cd "${BD}"/git/neutrinolabs/xrdp-0.9.5
./bootstrap
./configure --enable-fuse --enable-mp3lame --enable-pixman
make
sudo make install
sudo ln -s /usr/local/sbin/xrdp{,-sesman} /usr/sbin
cd "${BD}"/git/neutrinolabs
tar xvfz xorgxrdp-0.2.4.tar.gz
cd "${BD}"/git/neutrinolabs/xorgxrdp-0.2.4
./bootstrap
./configure
make
sudo make install
sudo systemctl enable xrdp
sudo sed -i \
    's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config
sudo systemctl restart xrdp.service
sudo sysctl -w vm.swappiness=15
sudo sysctl -w vm.vfs_cache_pressure=50
sudo sysctl -w vm.dirty_background_ratio=15
sudo sysctl -w vm.dirty_ratio=20
sudo reboot

Press CTRL+O (this is to write the file), followed by CTRL+X to close it then issue the following commands
Code: [Select]
chmod +x setup.sh
./setup.sh

This will then setup up your raspi with everything needed to use Microsoft RDP into the Desktop, once its done its reboot simply go back into ssh log back in and then type

Code: [Select]
sudo raspi-config

Then select Boot Options (3) , then Desktop / CLI (B1) , then select Desktop (B3). then exit it the raspi-config and reboot again. You can then dial into RDP and copy and paste files via clip board from your host computer.

Once you have finished you can then block rdp but simply going back into raspi-config and changing the Boot option for Desktop to Desktop Auto Login (B4). This will then kick the RDP out when you try to RDP in.

If you need to RDP back in just change the Boot option back to Desktop option B3 and reboot once more.

Hope this helps.
« Last Edit: March 17, 2018, 01:26:52 PM by hacktrix2006 »
Logged

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #11 on: March 17, 2018, 09:06:07 PM »

Just point your browser at http://ip.of.pi/dslstats/stats.htm (insert your
Pi’s ip address). That works fine for both of mine.

Apologies in advance for my lack of knowledge on this subject, I still can't produce the "kitz" interface on my RPi 1B setup running DSLStats, I think the issue is to do with file locations on my RPi ?

The current DSLStats program files are situated in /home/pi/DSLStats/dslstats32RPi-6.3
The program has created the webserver folder in /home/pi/.dslstats/snapshots/webserver
Note: I previously added the "snapshots" folder path in the "snapshots directory" option of DSLStats configuration just for clarity.
As per the instructions in the kitz "readme.txt" file I have copied the 8 new files to the "webserver" folder.

Quote
Just point your browser at http://ip.of.pi/dslstats/stats.htm

In my case the "stats.htm" file resides in the /home/pi/.dslstats folder.
Opening this with the RPi, Raspbian Jessie default browser, Chromium, produces the new kitz interface but with no data.
(no requirement for provision of RPi's IP address)

Opening the *.html files resident in the /home/pi/.dslstats/snapshots/webserver folder with RPi's Chromium browser just produce graph snapshots, no kitz interface.

As I said, I believe the issue is with file locations, any suggestions welcome.

« Last Edit: March 17, 2018, 09:09:03 PM by tiffy »
Logged
BT FTTP 150/30, BT Smart Hub 2

Westie

  • Kitizen
  • ****
  • Posts: 1596
Re: DSLstats webserver - Custom Interface
« Reply #12 on: March 17, 2018, 09:22:54 PM »

What happens if you move the stats.htm file into the /home/Pi/.dlstats/snapshots/webserver directory?
Logged

pooclah

  • Reg Member
  • ***
  • Posts: 151
Re: DSLstats webserver - Custom Interface
« Reply #13 on: March 17, 2018, 09:34:52 PM »

I have it running by copying the files to /home/pi/.dslstats/webserver


Logged

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #14 on: March 18, 2018, 01:20:57 PM »

@pooclah and Westie:
Thanks to both for your interest.
Yes, as suspected, the issue was with file locations, deleted the "snapshots" folder and changed the snapshots storage path back to default /home/pi/.dslstats.
The kitz webserver interface now opens in Chromium browser and displays the relevent data.

My RPi Mk.1B really struggles with the webserver interface as would be expected, CPU running at 100% usage most of the time, have not tried running on my RPi Zero W's as yet, would likely cope slightly better.
Have changed to running DSLStats on a RPi 3B with Wi-Fi link which is a much faster experience, have ordered a just released RPi 3B+ just to compare the performance and for future project reference.

Many thanks to kitz for the hard work on the project and providing public release also roseway for his continuing development of DSLStats.
Logged
BT FTTP 150/30, BT Smart Hub 2
Pages: [1] 2 3 ... 11