- Python 100%
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| ubee-evw32c-dashboard.json | ||
| ubee-evw32c-dashboard.png | ||
| ubee-evw32c-prometheus-exporter.py | ||
ubee-evw32c-prometheus-exporter
A Python script to scrape signal statistics from the Ubee EVW32C-0N cable modem and expose them as Prometheus metrics. Includes a Grafana dashboard for visualisation.
Disclaimer: This code (as well as this README.md) was generated with the assistance of an AI assistant (Kimi K2.5 by Moonshot AI and Claude by Anthropic) and is provided as-is, without warranty of any kind. Use at your own risk.
Attribution: Parts of this code — specifically the authentication approach, model URL structure, and router communication patterns — are based on or inspired by the pyubee project by mzdrale, licensed under the GNU General Public License (GPL). This project is not affiliated with or endorsed by pyubee or its contributors.
Features
- Authenticates with the Ubee EVW32C-0N web interface
- Parses downstream and upstream bonded channel statistics
- Exposes metrics via a Prometheus-compatible HTTP endpoint
- Wall-clock aligned polling with no time drift
- Automatic session re-authentication on expiry
- Grafana dashboard included
Requirements
- Python 3.8+
- The modem web interface accessible at
http://192.168.0.1(orhttp://192.168.100.1in bridge mode)
Installation
# Create install directory and virtualenv
mkdir -p /opt/ubee
python3 -m venv /opt/ubee/venv
# Install dependencies
/opt/ubee/venv/bin/pip install requests beautifulsoup4 prometheus-client
# Copy the script
cp ubee-evw32c-prometheus-exporter.py /opt/ubee/
Usage
One-shot JSON output
Fetches signal data once and prints it as JSON. Useful for testing.
python3 ubee-evw32c-prometheus-exporter.py -p yourpassword
Prometheus exporter
Starts an HTTP server exposing metrics, scraping the modem every 60 seconds.
python3 ubee-evw32c-prometheus-exporter.py --prometheus -p yourpassword
All options
| Argument | Default | Description |
|---|---|---|
--host |
192.168.0.1 |
Modem IP address |
-u, --username |
admin |
Login username |
-p, --password |
(required) | Login password |
--prometheus |
off | Run as Prometheus exporter |
--port |
9100 |
Prometheus metrics port |
-i, --interval |
60 |
Scrape interval in seconds |
Running as a systemd service
Create the user and environment file:
sudo useradd -r -s /sbin/nologin ubee
sudo mkdir -p /etc/ubee
Create /etc/ubee/ubee.env:
UBEE_HOST=192.168.0.1
UBEE_USER=admin
UBEE_PASSWORD=yourpassword
UBEE_PORT=9100
Lock down the env file so only root can read it:
sudo chmod 600 /etc/ubee/ubee.env
sudo chown root:root /etc/ubee/ubee.env
Create /etc/systemd/system/ubee.service:
[Unit]
Description=Ubee EVW32C-0N Prometheus Exporter
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=ubee
Group=ubee
EnvironmentFile=/etc/ubee/ubee.env
ExecStart=/opt/ubee/venv/bin/python /opt/ubee/ubee-evw32c-prometheus-exporter.py \
--prometheus \
--host ${UBEE_HOST} \
--username ${UBEE_USER} \
--password ${UBEE_PASSWORD} \
--port ${UBEE_PORT}
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now ubee
sudo journalctl -u ubee -f
Prometheus metrics
| Metric | Labels | Description |
|---|---|---|
ubee_ds_power_dbmv |
channel, freq_mhz |
Downstream power (dBmV) |
ubee_ds_snr_db |
channel, freq_mhz |
Downstream SNR (dB) |
ubee_ds_correctables |
channel |
Downstream correctable codewords (total) |
ubee_ds_uncorrectables |
channel |
Downstream uncorrectable codewords (total) |
ubee_us_power_dbmv |
channel, freq_mhz |
Upstream power (dBmV) |
ubee_modem_info |
host, model, ds_channels, us_channels |
Modem info |
Signal reference levels (DOCSIS 3.0)
| Good | Marginal | Bad | |
|---|---|---|---|
| DS Power | −5 to +5 dBmV | −7 to +7 dBmV | < −7 or > +10 dBmV |
| DS SNR | ≥ 38 dB | 33–38 dB | < 30 dB |
| DS Uncorrectables | 0, not increasing | Slowly increasing | Actively incrementing |
| US Power | 38–46 dBmV | 35–38 or 46–48 dBmV | < 35 or > 50 dBmV |
Grafana dashboard
A ready-made Grafana 12 dashboard is included in ubee-evw32c-dashboard.json. Import it via Dashboards → Import → Upload JSON file.
Bridge mode
If your modem is in bridge mode, the standard 192.168.0.1 address is unreachable. Access the modem management interface via the DOCSIS fallback address instead:
python3 ubee-evw32c-prometheus-exporter.py --host 192.168.100.1 -p yourpassword
You will need to assign your machine a static IP in the 192.168.100.x subnet on the interface directly connected to the modem. Note that some ISPs restrict management access in bridge mode.
License
This project is derived from pyubee and is therefore subject to the GNU General Public License (GPL).