Sign inSign up

tillsteinbach/prosafe_exporter_python

By tillsteinbach

•Updated about 4 years ago

Open metrics exporter for NETGEAR switches of the Smart Managed Plus series to provide data to datab

Image
Networking
Developer tools
Monitoring & observability
1

100K+

tillsteinbach/prosafe_exporter_python repository overview

⁠prosafe_exporter_python

GitHub sourcecode GitHub release (latest by date) GitHub Workflow Status GitHub GitHub issues Docker Image Size (latest semver) Docker Pulls PyPI - Downloads PyPI - Python Version Donate at PayPal Sponsor at Github

Open metrics exporter for NETGEAR switches of the Smart Managed Plus series to provide data to databases such as Prometheus⁠ or InfluxDB⁠.

⁠What is the purpose?

NETGEAR switches of the Smart Managed Plus series⁠ do not provide a standards conform interface for providing statistics of traffic and other information. There is no support for monitoring protocols such as SNMP⁠. Still these switches are deployed in large numbers in professional and private environments where monitoring of the switches is highly desired. A common solution for monitoring is to store the data in a Prometheus⁠ database and visualize and alert with tools such as Grafana⁠. prosafe_exporter_python provides a tool that colelcts the data from the switches webinterface and provides it using the OpenMetrics format⁠ that can be directly used in Prometheus⁠ or Influx scrape jobs⁠.

⁠Exported Metrics

metricdescriptionlabels
prosafe_switch_infoInformation about the switch exposed as labelshostname, product_name, switch_name, serial_number, mac_adresse, bootloader_version, firmware_version, dhcp_mode, ip_adresse, subnetmask, gateway_adresse
prosafe_receive_bytes_totalIncoming transfer in byteshostname, port
prosafe_transmit_bytes_totalOutgoing transfer in byteshostname, port
prosafe_error_packets_totalTransfer error in packetshostname, port
prosafe_link_speedLink speed in Mbpshostname, port
prosafe_max_mtu*Maximum MTUhostname, port

* not available in all firmware versions

⁠Install

Setup a config.yml

global: 
  retrieve_interval: 20.0
  retries: 10
  host: "0.0.0.0"
  port: 9493
switches: 
  - hostname: "192.168.0.100"
    password: "password123"
  - hostname: "192.168.0.200"
    password: "password123"

Mount the config to folder /etc/prosafe_exporter/, e.g. when using docker-compose:

version: '3.3'

services:
  prosafe_exporter:
    build: .
    ports:
      - 9493:9493
    volumes:
            - "./config/prosafe_exporter/:/etc/prosafe_exporter/:ro"

In prometheus configure a scrape job, e.g. like this:

scrape_configs:
 - job_name: 'prosafe_switches'
    static_configs:
      - targets:
        - "prosafe_exporter:9493"
    metrics_path: /probe
    scrape_interval: 60s

In InfluxDB configure a scrape job like this: Influx scrape configuration⁠

⁠Without Docker

If you don't want to use docker you can obtain prosafe_exporter also as a stand-alone application from PyPI⁠. Just install instead using:

pip install prosafe-exporter

⁠Query Example for Grafana

Outgoing data rate of port 1 on 192.168.0.123 is below.

rate(prosafe_transmit_bytes_total{instance="192.168.0.123", port="1"}[1m])
⁠Grafana Screenshot

This is how the data could look like in Grafana with an example configuration⁠: Grafana Screenshot

⁠Tested Switches

The following Switches are continously tested with real hardware:

  • GS108Ev3
  • GS108PEv3

Other Devices can be regression tested with prerecorded datasets. If you want to contribute with data from a switch not listed, please contact me or open an issue⁠.

⁠Tested Firmware

  • V2.06.14GR
  • V2.06.14EN
  • V2.06.03EN

If you want to contribute with data from a switch not listed here , please contact me or open an issue⁠.

⁠Reporting Issues

Please feel free to open an issue at GitHub Issue page⁠ to report problems you found.

⁠Known Issues
  • May not work with older firmware, not all firmware versions are tested
  • Does not work with Japanese firmware

⁠Credits

Inspired by dalance/prosafe_exporter⁠ that is providing the same functionality using the ProSAFE Plus utility instead of the switches webinterface

Tag summary

Content type

Image

Digest

Size

65.2 MB

Last updated

almost 5 years ago

docker pull tillsteinbach/prosafe_exporter_python