Giter VIP home page Giter VIP logo

zabbix-monthly-bandwith's Introduction

Zabbix-Monthly-Bandwidth

In this repository you will find information that will help you to set up Zabbix Server to collect information regarding Monthly Bandwidth from your Zabbix Host whith vnstat (it was tested on Ubuntu 12, 14 and 16).

Zabbix Host modifications

  1. On the Zabbix Host install vnstat and bc packages #apt-get -y install vnstal bc

  2. Check if the vnstat start working and is collecting data: :#vnstat -u -i {interface name} :#vnstat -m

Note: Sometimes vnstat needs more time to collect data (on some hosts it has passed ~6 hours before vnstat has started working). On the most of the hosts, vnstat has started to collect data immediately. If you have any issues with that, please check /etc/vnstat.conf file

  1. Add to your zabbix configuration folder the monthly traffic userparameter (In my case it is /etc/zabbix/zabbix_agentd.conf.d/ folder) :#vi /etc/zabbix/zabbix_agentd.conf.d/userparameter_monthly.traffic.conf

Note: Userparameter is called system.monthlybandwidth, you'll need that later on the Zabbix Server Web Interface for Key value and adding a new Item

  1. Add to /usr/local/bin the script (zabbix_total_month_bandwidth.sh) that will provide Statistics for zabbix and make this file executable :#vi /usr/local/bin/zabbix_total_month_bandwidth.sh :#chmod +x /usr/local/bin/zabbix_total_month_bandwidth.sh

  2. Restart Zabbix agent :#service zabbix-agent restart

Zabbix Server modifications

  1. Add a new Item and Graph to your Zabbix Server (I have added it to Template OS Linux ) From your Zabbix Server Web Interface: Configuration->Templates->Template OS Linux->Items->Create item https://ibb.co/fgFYCw Configuration->Templates->Template OS Linux->Graphs->Create graph https://ibb.co/hEG6Xw

  2. After these settings were saved, go to Monitoring->Graphs and select Montlhy bandwidth graph for the host that has this Item saved https://ibb.co/jGGUkG

Final note:

a) vnstat usually resets all traffic on 1st day of each month. b) You may have issues on collecting data with vnstat. I have encountered such issues with interfaces called p1p1, em1, enp0s25, etc.


You can change the interface name and the month start date on which vnstat collects/resets data in /etc/vnstat.conf file

zabbix-monthly-bandwith's People

Contributors

nicolaelapteanu avatar

Stargazers

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

Watchers

 avatar

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.