项目作者: Ramhm

项目描述 :
Calculate Bandwidth of server NIC
高级语言: Shell
项目地址: git://github.com/Ramhm/zabbix-total-bw.git
创建时间: 2020-01-11T14:38:33Z
项目社区:https://github.com/Ramhm/zabbix-total-bw

开源协议:Apache License 2.0

下载


Zabbix Total Bandwidth

Download size Download size

This script help you to get server bandwidth Average from zabbix database with API. script result will be Total Month Bandwidth.

just you must enter Start Date, End Date, IP Address and NIC name.

Prerequisites

  • Zabbix Server with API enabled >= 3.x
  • jq Linux Package (sudo apt-get install jq)
  • bc Linux Package (sudo apt-get install bc)
  • curl Linux Package (sudo apt-get install curl)

Tested:

  • Zabbix Server 4.4.2
  • Ubuntu 18.04.3 LTS

Usage

Note: Start and end dates must be 30 days. The calculations of this script are based on 30 days

S_DATE: Enter Start Date

E_DATE: Enter End Date

ZBX_API_URL: Zabbix API URL

ZBX_USER: Zabbix API Username

ZBX_PASS: Zabbix API Password

HOST & NIC: Enter Server IP and NIC name (Example 192.168.1.30|eth0 )

Installation

First, clone the repository using git (recommended):

  1. git clone https://github.com/Ramhm/zabbix-total-bw.git

or download the script manually using this command:

  1. curl "https://github.com/Ramhm/zabbix-total-bw/master/zb_total_bw.sh" -o zb_total_bw.sh

Then give the execution permission to the script and run it:

  1. $chmod +x zb_total_bw.sh
  2. $./zb_total_bw.sh

in this script we run any curl command to get user authentication information, “user.login” method is used in the JSON RPC query. The following shell script is used to get user authentication information. To export avg of the TBW , the “history.get” method is used in the JSPN RPC queries.