This script retrieves channel information from a cable modem and stores time series data to an InfluxDB as well as Event Logs in Loki. The data can be visualized using tools such as Grafana.
- Hitron Coda56
- Motorola MB8600
- Netgear CM2000
- Technicolor XB7/XB8
- Arris International Touchstone TG3492, configured as Giga Connect Box for UPC.CH Switzerland
- Python3
- An InfluxDB 2.0 database
- Loki for Event Log collection
Build and install with pip
pip3 install -e .
Edit configuration.ini and fill in your information for the InfluxDB and the modem.
Valid strings for ModemType
:
HitronCoda56
MotorolaMB8600
NetgearCM2000
TechnicolorXB7
TouchstoneTG3492UPCCH
Test the script by executing it manually and verify it completes without error messages.
retriever
Install all dev dependencies: pip install .[dev]
.
Run unittests: pytest tests
Create a cron job (executes every 2 minutes):
*/2 * * * * /usr/local/bin/retriever 2>&1 > /dev/null
You can build your own image by running:
docker build -f "Dockerfile" -t cablemodemstatus:latest .
Once built, create a directory on your host for your configuration.ini file, such as /opt/cablemodemstatus
. Then start a container referring to the configuration directory and mapping it to /app/data
:
docker run -d --name cablemodemstatus --restart unless-stopped -v /opt/cablemodemstatus:/app/data cablemodemstatus:latest
You can monitor the container's status by running:
docker logs -f cablemodemstatus
If you are using Docker Compose, building and installation is even easier.
Assuming your configuration file is
/home/pi/config/configuration.ini
then all you need to add to your compose.yaml file is this:
cablemodem_exporter:
build: https://github.com/andresp/cablemodem-status.git
command: retriever
volumes:
- /home/pi/config:/app/data:ro
- Implement modules for additional modems:
- Arris S33
- Arris SB8200
- Provide a Grafana Dashboard to visualize collected data
- Provide turnkey instructions to set up InfluxDB, Grafana and retrieval script
- Create Prometheus storage writer