Dashboard not showing graphs & total bandwitch

bandwitch
data
graphs
network
dashboard

#1

Ubuntu 16.04 & no checkers


#2

What is in your /srv/rutorrent/home/db/interface.txt file?

You can check with:

cat /srv/rutorrent/home/db/interface.txt

Also, check your /srv/rutorrent/home/widgets/data.php file to ensure that the network adapter is shown in the designated spots.

Change the value of INETFACE to whatever your network adapter is.

<?php
$interface = INETFACE;
session_start();
$rx[] = @file_get_contents("/sys/class/net/INETFACE/statistics/rx_bytes");
$tx[] = @file_get_contents("/sys/class/net/INETFACE/statistics/tx_bytes");
sleep(1);
$rx[] = @file_get_contents("/sys/class/net/INETFACE/statistics/rx_bytes");
$tx[] = @file_get_contents("/sys/class/net/INETFACE/statistics/tx_bytes");

#3

eth0
tun0
ens4

Changed data.php to:

<?php
$interface = eth0;
session_start();
$rx[] = @file_get_contents("/sys/class/net/eth0/statistics/rx_bytes");
$tx[] = @file_get_contents("/sys/class/net/eth0/statistics/tx_bytes");
sleep(1);
$rx[] = @file_get_contents("/sys/class/net/eth0/statistics/rx_bytes");
$tx[] = @file_get_contents("/sys/class/net/eth0/statistics/tx_bytes");

Now graphs are showing correctly but Bandwidth details tab is still blank, as shown before.
Thanks, for tips how to fix graphs.
I rebooted server before checking it.


#4

These are the locations you can alter that string of text to match your adapter.

https://github.com/QuickBox/quickbox_dashboard/search?utf8=✓&q=INETFACE


#5

Thanks, after updating every file it worked. :grinning::slight_smile:
Finally!


#6

Apologies on the delay getting these answers to you :blush:


#7

NO problem, thats wasnt feature braking thing, just a little bit annoying.


#8

I have made simple script to fix it because It occurred again (maybe after some update ?):
https://gist.github.com/xerrni/09633af5407272104a377b3cd073529c

just download using

wget https://gist.githubusercontent.com/xerrni/09633af5407272104a377b3cd073529c/raw/566b879e0fe982de318172a7dcf7ee5465243003/fixgraphs.sh 
chmod +x fixgraphs.sh 
./fixgraphs 
rm -rf fixgraphs.sh` 

or – to save it for later usage

wget https://gist.githubusercontent.com/xerrni/09633af5407272104a377b3cd073529c/raw/566b879e0fe982de318172a7dcf7ee5465243003/fixgraphs.sh 
chmod +x fixgraphs.sh 
mv fixgraphs.sh /bin
fixgraphs.sh

#9

This shouldn’t really be necessary. Do you have set_interface in /etc/cron.d ? This cron script achieves the same thing, but is already built in to the system. Necessarily any time you run an update, the panel php will be replaced with defaults (with INETFACE instead of your actual adapter). The cron script runs once a minute to ensure that the INETFACE is set properly after any system upgrade.

Contents of cron.d/set_interface:

*/1 * * * * root bash /usr/local/bin/quickbox/system/set_interface

Contents of set_interface:

#!/bin/bash
#
# [Quick Network Interface Input]
#
# GitHub:   https://github.com/QuickBox/QuickBox
# Author:   QuickBox.IO
# URL:      https://quickbox.io
#
# QuickBox Copyright (C) 2016 QuickBox.io
# Licensed under GNU General Public License v3.0 GPL-3 (in short)
#
#   You may copy, distribute and modify the software as long as you track
#   changes/dates in source files. Any modifications to our software
#   including (via compiler) GPL-licensed code must also be made available
#   under the GPL along with build & install instructions.
#

ADAPT=$(cat /srv/rutorrent/home/db/interface.txt);


sed -i "s/INETFACE/${ADAPT}/g" /srv/rutorrent/home/widgets/stat.php;
sed -i "s/INETFACE/${ADAPT}/g" /srv/rutorrent/home/widgets/data.php;
sed -i "s/INETFACE/${ADAPT}/g" /srv/rutorrent/home/widgets/bw_tables.php;
sed -i "s/INETFACE/${ADAPT}/g" /srv/rutorrent/home/inc/config.php;

Edit: If you have 3 interfaces listed in /srv/rutorrent/home/db/interface.txt then remove all the ones that aren’t eth0.