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: add current numbers to DSLstats http graph  (Read 2689 times)

bndwdthseekr

  • Member
  • **
  • Posts: 26
add current numbers to DSLstats http graph
« on: April 12, 2019, 12:08:06 PM »

I would like to add the current SNR margin, and current rate/attainable rate numbers to the bottom of the http graph snapshot, or maybe to the legend? Has anyone done this, or does someone have a script that can grab a line from fullstats.html so I can put it under each graph? I'm using Kitz's interface.
Logged
My current broadband hardware:
Modem: Cisco EHWIC-VA-DSL-A
Routing device: Raspberry Pi 4 Model B Rev 1.1

Hopefully Starlink soon?

kitz

  • Administrator
  • Senior Kitizen
  • *
  • Posts: 33883
  • Trinity: Most guys do.
    • http://www.kitz.co.uk
Re: add current numbers to DSLstats http graph
« Reply #1 on: April 14, 2019, 12:37:42 AM »

The webpage would need to be .php  but the following should work.

Coded as an array so you can pick and choose what to output

Code: [Select]
<?php

//Set up array
$matched = array();
//Set up items to search 
$search_sync "Bearer: 0, Up";
$search_max "Max";
$search_snr "SNR";

// Open file and search for items
$file = @fopen("fullstats.html""r");
if (
$file)
{
    while (!
feof($file))
    {
        
$buffer fgets($file);
        if(
strpos($buffer$search_sync) !== FALSE)            
$matched['sync'] = $buffer;
if(strpos($buffer$search_max) !== FALSE)            
$matched['max'] = $buffer;
if(strpos($buffer$search_snr) !== FALSE)            
$matched['snr'] = $buffer;
    }
    
fclose($file);
}

?>



Use the following to output in the webpage where you want

Code: [Select]
<?php
echo $matched['sync'] ."<br>";
echo 
$matched['max'] ."<br>";
echo 
$matched['snr'] ."<br>";
?>




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

bndwdthseekr

  • Member
  • **
  • Posts: 26
Re: add current numbers to DSLstats http graph
« Reply #2 on: April 14, 2019, 05:45:42 AM »

Thanks, Ill see if I can make that work... would be nice to have a way to write to another .html in the web server folder every time DSLstats updates. I haven't really had time to look at the source in depth, and see if I can just do it that way... I can pipe the output of the cisco router like this:
Code: [Select]
BFR#show control vdsl 0/0/0 | include Attainable
Attainable Rate:        12212 kbits/s            1348 kbits/s

At the moment I just stuck it on the page manually as you can see below, but I would love to have it update in realtime without using php. If I come up with something I like, Ill be sure to post it.


Logged
My current broadband hardware:
Modem: Cisco EHWIC-VA-DSL-A
Routing device: Raspberry Pi 4 Model B Rev 1.1

Hopefully Starlink soon?