The "Historical signal record" graphs for the modem are really interesting, and I would like to be able to log them to a time series database like influxdb for later analysis, does anyone know how those are queried from the modem?
Does the GL-Inet firmware already log this in a file somewhere, or would I have to create a separate process to get this information from the modem directly?
Thanks in advance for any help on this!
Following up on this if anyone's interested to try this as well: here is a collectd
script that will gather signal stats. The script monitors two variables, and can be easily extended:
#!/bin/sh
# Collect modem signals and output them to collectd format
# Ed Lafargue 2024
# Version 0.1
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}"
INTERVAL="${COLLECTD_INTERVAL:-10}"
while true; do
SIG=$(sudo ubus call modem.signal get_signals | jq ".signals[0]")
NETWORK_TYPE=$(echo $SIG | jq .network_type)
TS=$(echo $SIG | jq .timestamp)
RSSI=$(echo $SIG | jq .rssi)
RSRQ=$(echo $SIG | jq .rsrq)
echo "PUTVAL $HOSTNAME/exec-modem_signals/signal_quality-rssi interval=$INTERVAL $TS:$RSSI"
echo "PUTVAL $HOSTNAME/exec-modem_signals/signal_quality-rsrq interval=$INTERVAL $TS:$RSRQ"
sleep "$INTERVAL"
done
One annoying thing is that collectd-mod-exec
will - rightfully - refuse to run scripts as root so you will have to add sudoer permission for ubus
for the user you pick to run that script.
The luci interface will not graph those values by default (if anyone knows how to do this I'm interested), but in my case I normally forward collectd
to a remote telegraf/Influxdb
instance and view on Grafana dashboards...
1 Like