No description
  • Python 60.1%
  • HTML 32.8%
  • Shell 6.4%
  • Dockerfile 0.7%
Find a file
2024-08-14 15:27:20 +02:00
.github/workflows Run QA workflow on updated pull-request 2024-08-14 14:25:21 +02:00
.vscode Initial development of netgear exporter 2024-08-04 11:11:01 +02:00
docs Improve documentation 2024-08-14 14:14:58 +02:00
netgear_exporter Remove 'address' label from metrics 2024-08-14 15:27:20 +02:00
promexp Add empty line between metrics 2024-08-14 14:14:58 +02:00
scripts Initial development of netgear exporter 2024-08-04 11:11:01 +02:00
.dockerignore Initial development of netgear exporter 2024-08-04 11:11:01 +02:00
.editorconfig Initial development of netgear exporter 2024-08-04 11:11:01 +02:00
.gitignore Improve .gitignore file 2024-08-14 14:14:58 +02:00
.pylintrc Initial development of netgear exporter 2024-08-04 11:11:01 +02:00
coveragerc Initial development of netgear exporter 2024-08-04 11:11:01 +02:00
Dockerfile Tidy up Dockerfile 2024-08-14 14:14:58 +02:00
LICENSE.md Add initial readme and license files 2024-08-04 11:07:07 +02:00
notes.md Initial development of netgear exporter 2024-08-04 11:11:01 +02:00
Pipfile Change to Prometheus multi-target pattern 2024-08-12 14:19:41 +02:00
Pipfile.lock Change to Prometheus multi-target pattern 2024-08-12 14:19:41 +02:00
pytest.ini Initial development of netgear exporter 2024-08-04 11:11:01 +02:00
README.md Update readme file 2024-08-14 15:08:30 +02:00
settings.sh Fix name of docker image 2024-08-14 14:14:58 +02:00

Netgear Exporter

License: MIT

A Prometheus exporter for the Netgear GS108Ev3 managed switch. This switch does not have any documented API / automation interface (apart from NSDP), so this exporter retrieves the HTML pages from the switch UI and parses them to extract switch information and port status and statistics and publishes them in Prometheus format.

Here you can find an example of the generated metrics output: metrics example.

Usage

For testing, you can run the exporter as a Docker container like this, replacing MY_PASSWORD with the login password of the switch.

docker run \
  --rm \
  --interactive --tty \
  --env 'NETGEAR_EXPORTER_AUTH_MODULES={"default":"MY_PASSWORD"}' \
  --publish 8177:8177 \
  --name netgear_exporter \
  motlib/netgear_exporter:latest

Then point your browser to the following URL to retrieve the Prometheus metrics:

http://localhost:8177/probe?target=192.168.0.239&auth_module=default

You need to take care to replace the IP address 192.168.0.239 with the actual IP address of your switch.

This URL follows the Prometheus multi-target exporter pattern.

Prometheus Configuration

This is a simple configuration snippet for the Prometheus configuration (usually prometheus.yml):

scrape_configs:
  - job_name: netgear
    scrape_interval: 60s
    metrics_path: /probe
    static_configs:
      - targets:
        # This is the list of switch IP addresses to monitor.
        - '192.168.0.239'
    params:
      # The auth module (i.e. password) configured to connect to the switches
      # listed above.
      auth_module: [default]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        # The netgear exporter's hostname:port
        replacement: npi3:8177