Sign inSign up

msh100/modem-stats

By msh100

•Updated over 2 years ago

Process the channel diagnostics data from a DOCSIS/VDSL modem

Image
0

3.3K

msh100/modem-stats repository overview

⁠Modem Statistics Parser

A utility to read channel diagnostics information from DOCSIS and VDSL modems and output it in the InfluxDB line protocol.

This package is intended to be used within a Telegraf instance.

This package has been written in Go in an attempt to allow it to run on low end hardware (such as a Raspberry Pi Zero) with no issues.

⁠Usage

In its simplest form, you can run this repository directly. The only dependency being Go.

A compiled binary of this repository will require no dependencies.

⁠Within Docker

A Docker image exists for this repository with Telegraf configured to write to InfluxDB at msh100/modem-stats. This image currently only supports X86.

The following environment variables must be set:

NameDescriptionExample
INFLUX_URLThe HTTP API URI for your InfluxDB server.http://influxdb:8086
INFLUX_DBThe InfluxDB database to usemodem-stats
PING_TARGETSA comma seperated string of targets to ping1.1.1.1,8.8.8.8,bbc.co.uk

Environment variables must also be passed in for modem-stats to run. Check the configuration section below⁠.

docker-compose.yaml example:

---
version: "2.1"
services:
  modem-stats:
    image: msh100/modem-stats
    container_name: modem-stats
    environment:
      - INFLUX_URL=http://influxdb:8086
      - INFLUX_DB=modem-stats
      - PING_TARGETS=1.1.1.1,8.8.8.8,bbc.co.uk
      - ROUTER_TYPE=superhub3
      - IP_ADDRESS=192.168.100.1
    restart: unless-stopped
⁠Downloading Binaries

Binaries for this repository can be fetched from:

More architectures can be added on request.

⁠Configuration

The scripts need to know the modem type (ROUTER_TYPE). Additional information depends on the model.

Virgin Superhub 3
Ziggo Connectbox:

  • ROUTER_TYPE=superhub3
  • IP_ADDRESS (defaults to 192.168.100.1)

Virgin Superhub 4:

  • ROUTER_TYPE=superhub4
  • IP_ADDRESS (defaults to 192.168.100.1)

Com Hem WiFi Hub C2: (This is likely to work on any Sagemcom DOCSIS modem)

  • ROUTER_TYPE=comhemc2
  • IP_ADDRESS (defaults to 192.168.10.1)
  • ROUTER_USER (defaults to admin)
  • ROUTER_PASS (defaults to admin)

Sky Hub 2:

  • ROUTER_TYPE=skyhub2
  • IP_ADDRESS (defaults to 192.168.0.1)
  • ROUTER_USER (defaults to admin)
  • ROUTER_PASS (defaults to sky)
⁠Example
$ ROUTER_TYPE=superhub3 IP_ADDRESS=192.168.100.1 go run sh-stats/*.go
downstream,channel=3,id=10,modulation=QAM256,scheme=SC-QAM frequency=211000000,snr=403,power=71,prerserr=300,postrserr=0
downstream,channel=9,id=16,modulation=QAM256,scheme=SC-QAM frequency=259000000,snr=409,power=68,prerserr=72,postrserr=0
...
⁠Within Telegraf

To run within Telegraf, you should build a binary for your architecture, then mount that executable to the container.

go build -o modem-stats sh-stats/*.go

modem-stats should be mounted to the container.

The Telegraf configuration should then use the exec input to call it.

[[inputs.exec]]
  commands = ["/modem-stats"]
  data_format = "influx"

⁠Grafana

You can add the Router Stats dashboard⁠ to your Grafana instance by adding dashboard ID 14209.

Tag summary

Content type

Image

Digest

sha256:5dc017298…

Size

129.4 MB

Last updated

over 2 years ago

docker pull msh100/modem-stats