Skip to content

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔌 Cheap Switch Exporter

Prometheus Exporter for low-cost network switches without SNMP support

📖 Overview

This Prometheus exporter retrieves port statistics from switches that lack SNMP functionality, enabling monitoring through a web-based interface.

🎯 Purpose

Many budget-friendly network switches do not support standard SNMP monitoring. This exporter provides a workaround by scraping port statistics directly from the switch's web interface.

🖥️ Supported Devices

Manufacturer Model Status Contributor
Ampcom WAMJHJ-8125MNG ✅ Verified @askainet
Horaco ZX-SWTGW215AS ✅ Verified @askainet
Horaco ZX-SWTGW218AS ✅ Verified @pvelati
Horaco HC-SWTGW218AS ✅ Verified @arthurbarton
Horaco HC-SWTGW124AS ✅ Verified @arthurbarton
KeepLink KP-9000-9XHPML-X ✅ Verified @jfallot and @adamchabin
Sodola SL-SWTG124AS ✅ Verified @dennyreiter

🚀 Installation

Prerequisites

  • Go 1.23+
  • Docker (optional)

Direct Installation

  1. Clone the repository
  2. Download dependencies
go mod download
  1. Copy configuration template
cp config.yaml.example config.yaml
  1. Edit config.yaml with your switch details and parameters
  2. Run the exporter
go run main.go

Docker Deployment

# Build Docker image
docker build -t cheap-switch-exporter .

# Run container
docker run -v "./config.yaml:/config.yaml" -p 8080:8080 cheap-switch-exporter

📝 Configuration

Create a config.yaml with the following structure:

address: "192.168.1.1"           # IP or hostname of the switch
username: "admin"                # Web interface username
password: "password"             # Web interface password
poll_rate_seconds: 10            # Metrics polling interval
timeout_seconds: 5               # Request timeout
poe: 0                           # Enable PoE page scrape

📊 Exposed Metrics

  • port_state: Port enabled/disabled status
  • port_link_status: Port link up/down status
  • port_tx_good_pkt: Transmitted good packets
  • port_tx_bad_pkt: Transmitted bad packets
  • port_rx_good_pkt: Received good packets
  • port_rx_bad_pkt: Received bad packets

PoE metrics (when enabled in config)

  • poe_port_power_on: PoE port power on/off
  • poe_port_state: State of the PoE port (1=Enable, 0=Disable)
  • poe_port_type: PoE port type class
  • poe_port_voltage: PoE port voltage in volts
  • poe_port_watts: PoE port power consumption in watts
  • poe_port_current_ma: PoE port current in mA
  • poe_system_consumption_watts: Total PoE consumption in watts

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

🚨 Limitations

  • Requires web interface access to the switch
  • Polling-based metrics collection
  • Authentication via web interface credentials
  • No TLS

📄 License

MIT License, see LICENSE file.

🐛 Issues

Report issues on the GitHub repository's issue tracker.

About

Prometheus Exporter for cheap switch boxes without SNMP

Topics

Resources

Stars

58 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages