Checkout modem-exporter and build it:
/tmp
❯ git clone git@github.com:DictumMortuum/modem-exporter.git
Cloning into 'modem-exporter'...
remote: Enumerating objects: 131, done.
remote: Counting objects: 100% (131/131), done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 131 (delta 58), reused 112 (delta 42), pack-reused 0
Receiving objects: 100% (131/131), 42.01 KiB | 531.00 KiB/s, done.
Resolving deltas: 100% (58/58), done.
/tmp
❯ cd modem-exporter
/tmp/modem-exporter master
❯ make build
gofmt -s -w .
go build -trimpath -buildmode=pie -mod=readonly -modcacherw -ldflags="-s -w"
Scp the modem-exporter binary to your server and copy the sample configuration/systemd file:
/tmp/modem-exporter master
❯ scp modem-exporter sol:/tmp
modem-exporter 100% 12MB 93.5MB/s 00:00
/tmp/modem-exporter master
❯ scp assets/modem_exporter.yaml sol:/tmp
modem_exporter.yaml 100% 51 9.0KB/s 00:00
/tmp/modem-exporter master
❯ scp assets/prometheus-modem-exporter.service sol:/tmp
prometheus-modem-exporter.service 100% 273 40.7KB/s 00:00
Copy the files to the appropriate directories on the server:
dimitris@sol ~
❯ sudo cp /tmp/prometheus-modem-exporter.service /usr/lib/systemd/system/prometheus-modem-exporter.service
dimitris@sol ~
❯ sudo cp /tmp/modem-exporter /usr/local/bin
dimitris@sol ~
❯ sudo cp /tmp/modem_exporter.yaml /etc
Configure the modem exporter & enable and start the service:
dimitris@sol ~
❯ cat /etc/modem_exporter.yaml
host: << IP of your modem >>
modem: << one of: TD5130, SpeedportPlus or DG8245V-10 >>
port: << port of the exporter, e.g. 9618 >>
user: << admin username for the modem >>
pass: << admin password for the modem >>
voip: << if your modem is VDSL, then the WAN name of the VOIP >>
Install prometheus & configure it:
dimitris@sol ~
❯ cat /etc/prometheus/prometheus.yml
scrape_configs:
- job_name: "modem"
static_configs:
- targets:
- "sol.dictummortuum.com:9618"
Done! Now you should be able to open your prometheus instance and you should be able to see the metrics.