Store ifconfig stats, including RX/TX errors, drops, overruns, packets, in influxdb
Stats are stored in a bucket, the measurement is called ifconfig
- iface: eth0, lo, etc
- stat: errors, dropped, overruns, etc
- dir: tx or tx
- host: the alias tag assigned by
ifconfig.sh
ifconfig.sh
: collect ifconfig output, insert into local docker influxdb- ENVVAR DEBUG: Do not delete mktemp dir if set to
true
, write stdout and stderr to/tmp/ifconfig.$$.log
- Exits non-zero, if influx generates an error file
- ENVVAR DEBUG: Do not delete mktemp dir if set to
parse.py
: extract ifconfig stats, convert to csv- ARG 1: csv output file
- ARG 2: host alias, an influxdb tag
- ARG 3: RFC 3339 date
docker volume create influxdb2_data
docker volume create influxdb2_etc_data
docker create --name influxdb2 \
-v influxdb2_etc_data:/etc/influxdb2 \
-v influxdb2_data:/var/lib/influxdb2 \
-p 8086:8086 \
influxdb:2.0
from(bucket: "home")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "ifconfig" and
r["_field"] == "long" and
(r["dir"] == "rx" or r["dir"] == "tx") and
r["host"] == "router" and
r["iface"] == "eth1" and
(r["stat"] == "dropped" or r["stat"] == "errors" or r["stat"] == "overruns"))
|> aggregateWindow(every: 1m, fn: last, createEmpty: false)
|> yield(name: "last")