Git Product home page Git Product logo

sagemcom_fast_exporter's Introduction

Build Docker Build

Sagemcom F@st Prometheus Exporter

A Prometheus exporter for the Sagemcom F@st series of fibre hub/routers. It gathers metrics on demand using the HTTP API.

Much of this was ported from https://github.com/iMicknl/python-sagemcom-api, so thanks to @iMicknl for doing the hard work of figuring out the API!

This was developed with a Bell Gigahub with firmware 1.19.6, untested on other models and releases.

Installation

You can build a binary for your system with go get github.com/hairyhenderson/sagemcom_fast_exporter, or you can use a pre-built Docker image:

$ docker run hairyhenderson/sagemcom_fast_exporter

There are two variants: :latest and :alpine - no difference except the latter is based on Alpine and contains a shell. The former is a FROM scratch image, containing only the binary.

The image is built for multiple platforms and architectures:

  • linux/amd64 (x86_64)
  • linux/arm64 (64-bit ARM/aarch64)
  • linux/arm/v6 (32-bit ARM v6, like Raspberry Pi Zero)
  • linux/arm/v7 (32-bit ARM v7, like Raspbarry Pi 2B)
  • windows/amd64 (Windows, based on Windows Nano Server)

See https://hub.docker.com/r/hairyhenderson/sagemcom_fast_exporter.

Usage

The exporter needs to be given at least the address of the device (with -host), and the credentials (-username and -password). The default username is admin, so you likely only need to provide the password (which is the device's serial number by default).

By default, the exporter listens only on localhost, on port 9780. For metrics to be accessible from a Prometheus server running on a different host from the exporter, set -addr to listen to 0.0.0.0:<port> (or a specific IP address).

$ sagemcom_fast_exporter -addr 0.0.0.0:9780 -host 192.168.2.1 -password ABC123456789

Now you can visit http://localhost:9780/scrape to have the exporter scrape metrics from the device. Note that it will take a few seconds for the device to respond (usually around 5-10s).

To configure Prometheus to scrape from this exporter, use a scrape_config like this one:

  - job_name: 'gigahub'
    metrics_path: /scrape
    static_configs:
      - targets:
        - 'localhost:9780'

Grafana Dashboard

There's a Grafana dashboard published to Grafana.com and also available in this repo which looks like this:

Grafana dashboard

The easiest way to get set up with Grafana is to use Grafana Cloud, which has an excellent free tier.

To use it, you'll need to set up a Prometheus data source in Grafana, and then import the dashboard.

License

The MIT License

Copyright (c) 2023-2024 Dave Henderson

sagemcom_fast_exporter's People

Contributors

dependabot[bot] avatar hairyhenderson avatar hairyhenderson-bot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.