Defaults has UTC configured to GMT+8, configure NTP with adminpldt
Management > Device Management > NTP Check Time
time.google.com
time.google.com
Set timezone to (GMT)Gambia, Liberia, Morocco
Download telegraf armel-linux latest release from https://github.com/influxdata/telegraf/releases
tar xvf telegraf-*.*.*_linux_armel.tar.gz
You can yeet the contents to the device /etc, /usr, and /var
For me I'm using a fat32 flash drive which is symlinked from /sda1 -> /dev/shm/usb/media/sda1
vi /etc/telegraf/telegraf.conf
You can set the device hostname and you can also choose to just omit it.
hostname = ""
omit_hostname = true
Output options
[[outputs.influxdb]]
urls = ["http://<rpi>:8086"]
database = "pldt"
HTTP Basic Auth
username = "telegraf"
password = "password"
Input options
[[inputs.net]]
interfaces = ["wan0"]
telegraf --test
Add telegraf to /fh/extend/initialize.sh
[...]
pldc &
telegraf &
We need to collect telegraf stats from our router to somewhere else. I'll use a Raspberry Pi for this guide.
- Raspberry Pi Model B Plus Rev 1.2
- 2020-08-20-raspios-buster-armhf-lite.img
sudo apt install influxdb
sudo systemctl enable influxdb
sudo systemctl start influxdb
create user telegraf with password [REDACTED] with all privileges
create database pldt
You can test out your queries using influxdb-client
influx
> auth
username: telegraf
password:
> use pldt
> show measurements
SELECT last("bytes_recv") FROM "net" WHERE "interface" = 'wan0'
Download Grafana from https://grafana.com/grafana/download?platform=arm
I'm using an older Raspberry Pi so I'm going to use Ubuntu and Debian(ARMv6)
sudo apt-get install -y adduser libfontconfig1
wget https://dl.grafana.com/oss/release/grafana-rpi_7.3.0_armhf.deb
sudo dpkg -i grafana-rpi_7.3.0_armhf.deb
Enable Grafana so that it starts on boot and start it
sudo systemctl enable grafana-server
sudo systemctl start grafana-server
We can now go to http://:3000 and login admin:admin
Configuration > Data Sources > Add data source
Select InfluxDB
enable basic Auth
user
password
db pldt
http method get
Unit Data rate > bytes/sec(SI)
ALIAS BY Download
SELECT derivative("bytes_recv", 10s) FROM "net" WHERE "interface" = 'wan0'
ALIAS BY Upload
SELECT derivative("bytes_sent", 10s) FROM "net" WHERE "interface" = 'wan0'