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 ... 6 7 [8] 9 10 11

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

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #105 on: November 27, 2018, 02:44:43 PM »

Running the v2 release of kitz custom interface on my on line web server, all working fine with the exception of history, the "history" tab just produces a blank browser page.
The web server does support php, I am already running broadstairs, php based custom interface there without any issues.

All the kitz utility program files are in the server "webserver" folder which is also the destination for the stats webserver files as uploaded via DSLStats from my RPI 3B via inbuilt routine.
Noted that the kitz interface stats image & text files must be stored in name as opposed to date format, have renamed to conform and tried storage in name based folders or directly in the webserver folder, no joy, the history browser page does not even get to the stage of reporting "file not found" or indeed produce any form of header or dialogue, just a blank page !

I am obviously doing something wrong as quite a few forum members have the kitz interface or a combination of kitz & broadstairs interface running and available on their profiles, any suggestions as to what appreciated.
Logged
BT FTTP 150/30, BT Smart Hub 2

hacktrix2006

  • Reg Member
  • ***
  • Posts: 305
    • xDSL Stats:
Re: DSLstats webserver - Custom Interface
« Reply #106 on: November 27, 2018, 02:54:56 PM »

@tiffy history.php requires you have PHP installed as well as Apache and an FTP server. From what I have read.

Sent from my LLD-L31 using Tapatalk

Logged

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #107 on: November 27, 2018, 03:51:17 PM »

Thanks for the response.

Yes, appreciate that the history program file is php based, however, as stated, my webserver does support this and broadstairs, php based interface is already running there without any issues.

Have also tried running locally on Windows using xampp (with Apache) which again runs broadstairs interface without any problems, same issue there with the kitz history page.
Logged
BT FTTP 150/30, BT Smart Hub 2

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: DSLstats webserver - Custom Interface
« Reply #108 on: November 27, 2018, 04:21:44 PM »

Hi tiffy

Apologies I did say I would look into this for you

It is now working if you check

Many thanks and sorry for late reply, I had to go out and mobile died.

Many thanks

John
Logged

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #109 on: November 28, 2018, 02:36:39 PM »

Many thanks to John (d2d4j) for a very prompt solution to my issue which I believed involved a slight tweek of the history.php file which he edited on the server, having access to this as his company provide my web hosting.

Strangley, there was a re-occurance of the issue a few hours after John's fix was applied, he very quickly diagnosed and attributed this to the history.php file being overwritten by an old revision from my RPi 3B source which I certainly had not manually applied.
Had been aware at an earlier stage that name changes (Kitz to my ID) edited in the *.htm or history.php files on the server only would at some stage change back to original, carrying out the edit's to the files in the RPi webserver folder gave a permanent result, concluded that all these files must be overwritten on the server during the DSLStats auto upload sequence.

With no other connection other than becoming a recent customer with John's web hosting company I can only repeat that his service and support with any of my issues has been exceptional and with his patronage of this forum/knowledge of *DSL related matters it makes it so much easier explaining any issues that arise, would thoroughly recommend.
Logged
BT FTTP 150/30, BT Smart Hub 2

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33881
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DSLstats webserver - Custom Interface
« Reply #110 on: November 28, 2018, 08:59:29 PM »

Very quick comment from me. 

I think the problem may be that I used php short tags in some of  my code...  which won't work unless the server has specifically got php short tags enabled.    I'd used short tags where I quickly swap out from php to use html forms.

atm I'm not able to repackage and re-upload...  but in the meantime if anyone else is having difficulties then changing
Code: [Select]
<? to
Code: [Select]
<?phpshould do the trick.




   
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

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #111 on: November 29, 2018, 09:43:22 AM »

@kitz

Thanks for the explanation of "short tags", John (d2d4j) had mentioned this was causing the issue on his system with respect to running the history.php file, I did not really understand the logistics which I'am sure John would have explained had I asked.

Your custom interface is now working very well on my system, many thanks for the development and free supply of this utility, much appreciated.
Logged
BT FTTP 150/30, BT Smart Hub 2

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33881
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DSLstats webserver - Custom Interface
« Reply #112 on: November 29, 2018, 09:13:23 PM »

nps.   My bad -  I'd used full tags for the main part of the code, but old habits die hard when it came to quickly dropping back into html for the form, and then back again to php.   With my server supporting short tags and originally having coded it for myself I hadn't realised it would become a problem for others until you brought the topic up.   Fortunately John realised what it was :)
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

jelv

  • Helpful
  • Kitizen
  • *
  • Posts: 2054
Re: DSLstats webserver - Custom Interface
« Reply #113 on: December 13, 2018, 12:08:20 AM »

Kitz's history.php code relies on "Save snapshots in categories" being set. I had "Save snapshots in daily folders" set - it seems more logical to me and allows easier housekeeping to delete older data no longer required. I know at least one other person was running a script to copy the image files from the daily snapshot folders to the category folders so that history.php worked.

I am now using a script which rather than copying the files creates symlinks in the category folders which link to the files in the daily folders. Also if daily snapshot folders or files within them are deleted the symlinks pointing to them are automatically removed. This script can be run by cron (either at regular intervals or set to run a short time after the auto snapshots timing) or run manually after ad-hoc snapshots. It creates links for all possible snapshot graphs depending on what it finds.

Here is the script:
Code: [Select]
#!/bin/sh
# This script creates links in the correct folders to all the DSLstats png images which are in daily snapshot folders
# This is to mimic the structure when "Save snapshots in categories" is selected
# It is required for Kitz's history display

DSLstatspath=/chroot/home/myusername/mydomain/html/DSLstats/

find ${DSLstatspath}snapshots/. -type f -name "Bitloading-*.png" -exec ln -sf -t ${DSLstatspath}Bitloading "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "Bitswap-*.png" -exec ln -sf -t ${DSLstatspath}Bitswaps "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "Speed-*.png" -exec ln -sf -t ${DSLstatspath}ConnSpeed "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "CRC-*.png" -exec ln -sf -t ${DSLstatspath}CRC "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "ES-*.png" -exec ln -sf -t ${DSLstatspath}ErroredSeconds "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "FEC-*.png" -exec ln -sf -t ${DSLstatspath}FEC "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "HLog-*.png" -exec ln -sf -t ${DSLstatspath}HLog "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "QLN-*.png" -exec ln -sf -t ${DSLstatspath}QLN "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "SES-*.png" -exec ln -sf -t ${DSLstatspath}SES "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "SNRM-*.png" -exec ln -sf -t ${DSLstatspath}SNRM "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "SNRMperband*.png" -exec ln -sf -t ${DSLstatspath}SNRMperband "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "SNRpertone-*.png" -exec ln -sf -t ${DSLstatspath}SNRpertone "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "Swapspermin-*.png" -exec ln -sf -t ${DSLstatspath}SwapsPerMinute "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "DailyTraffic-*.png" -exec ln -sf -t ${DSLstatspath}Traffic "{}" \;

# Now delete any dead links where the original file has been removed
find -L ${DSLstatspath} -type l -exec rm -- {} +

The only thing that needs amending is to set DSLstatspath - note the trailing / is required.

I've also amended my copy of history.php as suggest in the comments to add all the possible graph types to the first drop down:

Code: [Select]
<form name="form1" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
  Graph Type<br>
    <select name="graph">
     <option value="SNRM">SNR Margin</option>
      <option value="ErroredSeconds">Errored Seconds</option>
      <option value="CRC">CRCs</option>
      <option value="Bitloading">Bit loading</option>
      <option value="Bitswaps">Bitswaps</option>
      <option value="ConnSpeed">Connection speed</option>
      <option value="FEC">FEC Errors</option>
      <option value="HLog">HLog</option>
      <option value="QLN">QLN</option>
      <option value="SES">SES</option>
      <option value="SNRMperband">SNR Margin per Band</option>
      <option value="SNRpertone">SNR Margin per Tone</option>
      <option value="SwapsPerMinute">Bitswaps per Minute</option>
      <option value="Traffic">Daily Traffic</option>
    </select>
    <input type="submit" value="Select">
  </form>
« Last Edit: December 14, 2018, 03:17:55 PM by jelv »
Logged
Broadband and Line rental: Zen Unlimited Fibre 2, Mobile: Vodaphone
Router: Fritz!Box 7530

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33881
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: DSLstats webserver - Custom Interface
« Reply #114 on: December 13, 2018, 10:11:59 AM »

Thanks jelv.    :thumbs:
I've added a note to the first post in the thread linking people to your post should they wish to use your script to store in daily folders.
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

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #115 on: December 13, 2018, 10:36:17 AM »

@jelv

Many thanks for making your code publically available, as someone running a very similar setup to yours, ie. kitz & broadstairs stats display interfaces running together on a web hosting site and to date running very simple but effective cron job routines engineered by the site manager, John (d2d4j) to enable the kitz interface history function to work, your further development is very much appreciated.
Logged
BT FTTP 150/30, BT Smart Hub 2

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #116 on: December 14, 2018, 12:54:12 PM »

@jelv

Your "cron symlink" script has worked perfectly on my web based, kitz history interface, beyond expectation even converted the existing png & txt files in the associated history folders from full size to symlinks, considerable saving of space on the disk with the avoidance of file duplication, again, many thanks for sharing.

Two quick questions:
Quote
find ${DSLstatspath}snapshots/. -type f -name "SNRM-*.png" -exec ln -sf -t ${DSLstatspath}SNRM "{}" \;
find ${DSLstatspath}snapshots/. -type f -name "SNRM-*.png" -exec ln -sf -t ${DSLstatspath}SNRM "{}" \;
Is there any significance in the two identical SNRM lines in your code ?

Quote
# Now delete any dead links where the original file has been removed
find -L ${DSLstatspath} -type l -exec rm -- {} +
Struggling to understand the format of the last line of code, can you elaborate further or point to reference ?

For anyone like myself who is not familiar the Linux "ln" command concept found a good reference source here that even I can understand:
https://www.computerhope.com/unix/uln.htm
 
Logged
BT FTTP 150/30, BT Smart Hub 2

d2d4j

  • Kitizen
  • ****
  • Posts: 1103
Re: DSLstats webserver - Custom Interface
« Reply #117 on: December 14, 2018, 01:01:23 PM »

Hi tiffy

Sorry the duplication maybe my fault. I think I initially tried deleting lines you did not use so may have deleted argin from SNRMargin but I cannot remember exactly now sorry.

I then just uploaded the original cron and vi edited, simply hashing our the lines not used

The last line simply looks for zombie symlinks and deletes them if no matching file found in snapshot folder

Many thanks

John
Logged

jelv

  • Helpful
  • Kitizen
  • *
  • Posts: 2054
Re: DSLstats webserver - Custom Interface
« Reply #118 on: December 14, 2018, 01:21:08 PM »

-L follows symbolic links so you get information on the target files unless the link is broken when it gives you the information on the symlink.
-type l then filters the result set to only give you files which are links (i.e. where the link is broken)

For all that are found by this execute rm
Logged
Broadband and Line rental: Zen Unlimited Fibre 2, Mobile: Vodaphone
Router: Fritz!Box 7530

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: DSLstats webserver - Custom Interface
« Reply #119 on: December 14, 2018, 02:20:46 PM »

@d2d4j & jelv

John, thanks for the clarification, I was aware that the cron code lines had been edited to suit my particular history preferences but as the duplicate line was also in jelv's published code thought it may be deliberate or significant, will remove or comment out one of the lines in my script.

Thanks to both for the detailed explanation of the code final command line.

Logged
BT FTTP 150/30, BT Smart Hub 2
Pages: 1 ... 6 7 [8] 9 10 11