Giter VIP home page Giter VIP logo

vnstat-dashboard's Introduction

VnStatDashboard

A DashBoard for vnstat which using chart.js and quasar 简体中文

Notice

  • WebServer such as Nginx must add CORS support: add_header Access-Control-Allow-Origin *;
  • It will auto-load vnstat.json and generate chart if you put a valid vnstat.json at the sibling directory
  • You can do like this if you want to build a traffic monitor site for you server
sudo apt install nginx vnstat -y
git clone https://github.com/IITII/VNSTAT-DASHBOARD /var/www/vnstat
cd /var/www/vnstat && git checkout main
#sed -i "s/root \S\+/root \/var\/www\/vnstat;/g" /etc/nginx/sites-available/default \
#&& nginx -t && nginx -s reload \
echo "59 * * * * /usr/bin/vnstat --json > /var/www/vnstat/vnstat.json" \
>> /var/spool/cron/crontabs/`whoami`
crontab -l
# Now open your browser, type server ip and see the DashBoard

ScreenShot

alt

How to Use ?

For normal use, you must make sure that vnstat had collected enough data.

  • Paste & Click Button.

Fixed! -> For some reason, the interface id which you want to see must be "ens4"!!!

Know issues

  • Fixed! -> Date maybe not correct in Hour Chart, especially in February & March.

vnstat-dashboard's People

Contributors

iitii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vnstat-dashboard's Issues

找不到default文件

centos7的nginx目录格式不一样找不到default,我参考https://www.cnblogs.com/aduner/p/14224858.html 做了修改
可以发下default的文件内容吗

Log:
[root@iZohsgoqg2z7njZ vnstat]# sudo service nginx restart
Redirecting to /bin/systemctl restart nginx.service
[root@iZohsgoqg2z7njZ vnstat]# sed -i "s/root \S+/root /var/www/vnstat;/g" /etc/nginx/sites-available/default \

&& nginx -t && nginx -s reload
echo "1 * * * * /usr/bin/vnstat --json > /var/www/vnstat/vnstat.json" \

/var/spool/cron/crontabs/whoami
sed: can't read /etc/nginx/sites-available/default: No such file or directory
[root@iZohsgoqg2z7njZ vnstat]# crontab -l

指令少打一个字,install输入成了insall

代码栏里的
apt insall nginx vnstat -y
这里的insall的单词错误了,这边复制直接粘贴进去提示
apt insall nginx vnstat -y E: Invalid operation insall
可以改一下改成 install

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.