Kitz Forum

Broadband Related => Router Monitoring Software => Topic started by: bndwdthseekr on April 12, 2019, 12:08:06 PM

Title: add current numbers to DSLstats http graph
Post by: bndwdthseekr 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.
Title: Re: add current numbers to DSLstats http graph
Post by: kitz 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>";
?>




Title: Re: add current numbers to DSLstats http graph
Post by: bndwdthseekr 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.

(https://forum.kitz.co.uk/proxy.php?request=http%3A%2F%2Foi67.tinypic.com%2Fjh4lqs.jpg&hash=dbf26580c10c72759d8f7c91b48f52c7ce72981d)
(https://forum.kitz.co.uk/proxy.php?request=http%3A%2F%2Foi64.tinypic.com%2Fivwh7t.jpg&hash=fa0b396f4c8025f6be6fd6463c327d46349f4793)