{% extends "base.html.twig" %} {% block title %}Traffic Calculation{% endblock %} {% block body %}

How to use Traffic Calcullation


Calculating Traffic

There are two ways available how the data traffic sent by and received by a device or a group of devices over a period of time can be calculated and visualized.

  • Visualization in Grafana dashboard - allows for interactive overview of daily traffic and sums over period of time.
  • Calculation on server - produces tabular and CSV output based on parameters.

Visualization in Grafana dashboard

Grafana is a software for interactive visualization of data. If Grafana integration has been enabled for your DWARFG_LONG deployment, you should have the free edition of Grafana installed and configured and the Traffic Counter dashboard imported into Grafana. Also, the Traffic Counter page in DWARFG_LONG UI will redirect you on the dashboard automatically.

To login into Grafana use:

  • Username: {{ grafanaLoginUsername }}
  • Password: {{ grafanaLoginPassword }}

Once in Traffic Counter dashboard, you are able to select either of any Monitoring Group or any single device. You can also select the range you are interested in.

The dashboard shows daily traffic of the selected Monitoring Group and single device over a period of time, together with the sums for Received, Transmitted and Total traffic for the selected group and device.

The graphs and sums are provided separately for:

  • Cellular traffic
  • Non-cellular traffic
  • All traffic

If you need to set which interfaces on your device are of cellular nature and which not, please visit Network Interfaces table in Device details. Update the settings by checking (or unchecking) the Cellular checkbox for the network interfaces reported by the device and do not forget to click Update Settings button below the interfaces table. The changes in network interface type are immediately reflected in data though you may want to hit Refresh button to force Grafana to reread the updated data from the database.

If you are interested in reviewing daily traffic or seeing counters for all of your devices, simply select the All devices monitoring group, as that encompasses all devices all the time.

The traffic counters are stored in the database once per day and kept there for around 120 days. If you want to go further in the past, you need to create another Grafana dashboard for that, based around netdevs_monthly_traffic in database (as opposed to the Traffic Counter dashboard that takes the data from the netdevs_daily_traffic). Naturally, the granularity of the data there are one entry per device network interface per month.

Devices are organized into Monitoring groups. You are able to calculate traffic for a monitoring group. To calculate traffic for all devices, use All devices monitoring group.

Enabling Grafana integration

  • Grafana integration can be performed anytime after the DWARFG_LONG deployment completes.
  • The integration must be done by server administrator.
  • If you have On-premise version of DWARFG_LONG and have a single deployment installed, contact your admin to execute the dwarfg_grafint command as root user on the server command line. That's all that is needed. For multi-deployment scenario see below.
  • If you have hosted (SaaS) version, you would be not able to detect if you have single or multi-deployment scenario. You need to contact your SaaS operator to enable the Grafana integration.
  • For multi-deployment scenario:
    • Grafana integration can be enabled only for one DWARFG_LONG deployment on one machine/VM automatically.
    • As Grafana itself is a separate SW, you may opt to perform manual configuration of Grafana, but that is up to you and it is not supported by Dwarf Technologies.
    • For SaaS, it is highly recommended to have separate VM for every DWARFG_LONG deployment for many reasons, primarily security. This way also assures that the Grafana integration can be enabled for every deployment as one VM per deployment means single-deployment scenario from the VM/machine point of view. In this scenario, enabling the Grafana integration for a deployment/VM consist of simply running the dwarfg_grafint command on the particular VM.


Calculation on the server

Calulation of the devices traffic can be done on the server by executing the dwarfg_trafcnt command as server admin.

The dwarfg_trafcnt command shows help if run without parameters. The following description is for reference only.

You need to specify a few options to the command:

  • Traffic type you want to count:
    • -a ... any traffic type. Counts cellular and non-celluar traffic together. If you do not specify traffic type, this option is the default.
    • -c ... count cellular traffic only.
    • -n ... count non-cellular traffic only.
  • Select if you want to count traffic per group or a device and provide that group/device identification:
    • -g "group name" ... e.g. -g "All devices"
    • -d deviceID ... e.g. -g ABAB
  • Choose whether you want table with daily counters, monthly counters or just totals over the selected time period.
    • -D ... show daily traffic couters (this is chosen if you do not provide selection)
    • -M ... show monthly traffic counter
    • -T ... show totals over the selected time period
  • Provide start and end date.
    • -s 2024-06-05 ... choose starting day of a time period
    • -e 2024-11-30 ... choose ending day of a time period
  • -C ... produce CSV format


{% endblock body %}