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

Author Topic: Another custom web interface for DSLStats data (by Broadstairs aka Stuart)  (Read 3255 times)

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

I decided to start my own thread for my scripts which display DSLStats data, two reasons - first it is cluttering up Kitz' thread and taking focus from her efforts, and second it will make it easier for me to keep on track with bugs, comments and suggestions for my scripts.

I have created these scripts to work both locally on a PHP capable webserver (the built in DSLStats webserver does not support PHP) or using an FTP server. Again my intention with the FTP support is primarily for people who use a NAS box locally which supports FTP and allows storing of data away from the likes of an RPi where storage is at a premium. It may well work with a hosted FTP site but as yet I have not been able to test SFTP which should really be used on a hosted service as it is far more secure than normal FTP which is fine on a local lan.

Because of a problem I had recently I have now changed the scripts to work with files stored in daily directories but removed the restriction of having to save them in name order, so now both name and date order work fine. I think the daily folder restriction is worth  keeping as it reduces the amount of graphs being displayed.

I am still working on these scripts and new versions should be available in the next few days. So currently I am not making them downloadable but will send them to those who have requested them via PM with an email address. Once I am reasonably happy with them I will provide a downloadable zip file.

My existing versions can be seen at https://www.stella-maris.org.uk/DSLgraphs.php

Stuart
« Last Edit: May 06, 2018, 10:49:22 AM by broadstairs »
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

Just a quick update on SFTP. I have been testing this now and to support it will need quite a rewrite of the code so that part will now be delayed. So I hope by the end of today or perhaps first thing tomorrow to be in a position to send the scripts to those who have requested them.

Stuart
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

I have just emailed all those (I think) who have asked for a copy of my scripts a zip file. This code does NOT support SFTP only vanilla FTP for now, the SFTP support will have to come later.

Stuart
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220

g3uiss

  • Reg Member
  • ***
  • Posts: 269
  • You never too old to learn
    • Midas Solutions

Stuart

Thanks. I have mine and will be testing later. I will need to manually upload to my server as I only have SFTP access. But I will be able to give feedback.

Tony
Logged
Zen FTTC and Plusnet ADSL HG612 modems with Vigor 2925

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

I thought I had a way to develop SFTP using my hosting site however because I'm on the basic package I do not have shell access, it looks like the next package up is the one I would need which is £80 per year and I currently pay £40. I have gone back to them to ask why their web site shows SFTP as available on my package but obviously does not work.

So for now with no access to an SFTP capable server my testing on this is at a standstill.

Stuart
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220

d2d4j

  • Reg Member
  • ***
  • Posts: 729

Hi broadstairs

Kudos to you for your development

Sorry, why do you need shell access for sftp

Our platforms allow ftp and sftp, which both work from an ftp client

Please donít feel you have to answer as I was just wondering or having a blonde moment

Also, there are various way to implement sftp server side, so what may work on some platforms may not work on others

Many thanks

John
Logged

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

Hi broadstairs

Kudos to you for your development

Sorry, why do you need shell access for sftp

Our platforms allow ftp and sftp, which both work from an ftp client

Please donít feel you have to answer as I was just wondering or having a blonde moment

Also, there are various way to implement sftp server side, so what may work on some platforms may not work on others

Many thanks

John

John I have now had a further update from my hosting company. It seems the person who replied first quote "got their knickers in a  twist". Apparently on their basic package SFTP should work but only with my main account username and password which I had not tried. So now I will test this and see if it works, they said they will help if it still fails. Indeed shell access is not required for SFTP.

Stuart
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 5456

If they cannot provide it, message marjohn56 or myself and we will provide you an sftp account. I probably should extend this invitation to Eric as well to help him add it to dslstats.

Normally a valid sshd account is indeed needed for sftp, but I managed to get it working on virtual ftp accounts with user/pass auth using the sftp plugin on proftpd.
Logged
Sky Fiber Pro - Billion 8800NL bridge & PFSense BOX running PFSense 2.4 - ECI Cab - LINE STATISTICS CLICK HERE

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

I am still having problems with my sftp testing on my hosting company servers. I have made some progress and now can connect using command line and filezilla just fine but using a PHP script simply fails.

Now I suspect the issue is with the key used by the server. When I initially used both command line and filezilla I was prompted to accept the key as it does not correctly represent the server being connect to, once accepted it works. However using the SSH2 additions to PHP I am not prompted and although it works using ssh2_connect and ssh2_auth_password as soon as I try the ssh2_sftp I get kicked off by the server. So currently I am at a loss to know how to progress this.

I do wonder if Eric's code in DSLStats may have an issue when folks start using their hosting companies to sftp because a lot of them use generic keys which do not always correctly identify the server. Anyone any ideas please?

Stuart
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 5456

You may need to configure an auto acceptance of the certificate.

The scripts I made, that skyeci, marjohn56 both use, has a line that auto accepts the certificate so the login process can be completed.  I am pretty sure PHP has something specific that needs to be set to auto accept untrusted certificates.
Logged
Sky Fiber Pro - Billion 8800NL bridge & PFSense BOX running PFSense 2.4 - ECI Cab - LINE STATISTICS CLICK HERE

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

You may need to configure an auto acceptance of the certificate.

The scripts I made, that skyeci, marjohn56 both use, has a line that auto accepts the certificate so the login process can be completed.  I am pretty sure PHP has something specific that needs to be set to auto accept untrusted certificates.

There is an option in ssh_config which allows this but so far I've not found anything in PHP which allows me to bypass the certificate verification. You are also supposed to be able to have a config file in the user space in Linux which should override defaults but no way have I been able to get this working. Also a shell script can be run to issue an ssh command but this is problematic as not all hosting package allow shell scripts.

I am starting to feel that providing SFTP in my scripts is more trouble than it is worth. For folks who have their DSLStats data on a hosted site you do not need SFTP in the scripts if the script is run from the same host. Again if the data is all on a local network then again SFTP is not really needed, nor is it if the data is on a local disk accessible by a local server.

If anyone can come up with something in PHP which will overcome my issue with certificates then I will have another go at this but right now I cannot continue to develop SFTP support.

Stuart
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220

d2d4j

  • Reg Member
  • ***
  • Posts: 729

Hi broadstairs

Kudos to you

Sorry this may help or you could wait a week or so while roseway creates new sftp uploader in curl

Many thanks and sorry if you had already read this

https://stackoverflow.com/questions/28256655/connect-to-sftp-using-php-and-private-key

John
Logged

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

Hi broadstairs

Kudos to you

Sorry this may help or you could wait a week or so while roseway creates new sftp uploader in curl

Many thanks and sorry if you had already read this

https://stackoverflow.com/questions/28256655/connect-to-sftp-using-php-and-private-key

John

No I had not seen that John. I am not using phpseclib but trying to do this in vanilla PHP code and functions on the basis that there are folks here who want a plug and play solution and not a plug - mess around installing stuff - and pray solution. I just wanted it to work without having to run shell scripts, mess with PHP settings or installing stuff like phpseclib, yes I know there are people here who can do all that stuff with their eyes shut but there are also people who either cannot or simply do not want to do all this.

If only hosting companies had certificates which represented the sites correctly none of this wold be needed  :(

Stuart
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220

skyeci

  • Kitizen
  • ****
  • Posts: 1148
    • skyECI line stats

Your script works great Stuart with WinSCP and a couple of scripts  ;)
https://www.team-rebellion.net/Ned/Statstest.php
Logged
Sky Fibre Pro - billion 8800nl V1 (bridge mode) + Opnsense(i5 Qotom) with IPV6 , AC-88U WAP- ECI cab,

click for my ECI line stats


click for  line stats by Pi3/Huawei 

broadstairs

  • Kitizen
  • ****
  • Posts: 3113

Your script works great Stuart with WinSCP and a couple of scripts  ;)
https://www.team-rebellion.net/Ned/Statstest.php

Thanks... that neatly shows why SFTP is not needed because it is accessing the data on the same server the script runs on. Yes we need Eric to get his DSLStats/cURL  solution working in order to upload the data to those servers requiring SFTP.

Stuart
Logged
ISP:TalkTalk Connection:FTTC Cab:ECI Router:Netgear D6220
Pages: [1] 2 3