Add comprehensive WAN metrics support to unpoller: WAN Configuration Metrics: - wan_failover_priority: WAN failover priority - wan_load_balance_weight: Load balancing weight - wan_provider_download_kbps: Configured ISP download speed - wan_provider_upload_kbps: Configured ISP upload speed - wan_smartq_enabled: SmartQueue QoS status - wan_magic_enabled: Magic WAN status - wan_vlan_enabled: VLAN configuration status WAN Statistics Metrics: - wan_uptime_percentage: WAN uptime percentage - wan_peak_download_percent: Peak download utilization - wan_peak_upload_percent: Peak upload utilization - wan_max_rx_bytes_rate: Maximum receive rate - wan_max_tx_bytes_rate: Maximum transmit rate WAN Service Provider Metrics: - wan_service_provider_asn: ISP autonomous system number Labels include: - wan_id, wan_name, wan_networkgroup - wan_type (dhcp, static, pppoe) - wan_load_balance_type (weighted, failover-only) - isp_name, isp_city (service provider metrics) - site_name, source Changes: - pkg/poller/config.go: Add WANConfigs field to Metrics struct - pkg/poller/inputs.go: Append WAN configs in metric aggregation - pkg/inputunifi/input.go: Add WANConfigs field to Metrics struct - pkg/inputunifi/collector.go: Fetch WAN enriched configuration - pkg/promunifi/wan.go: New WAN metrics exporter - pkg/promunifi/collector.go: Initialize and export WAN metrics Depends on: unpoller/unifi PR (WAN API support) Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|---|---|---|
| .. | ||
| LICENSE | ||
| README.md | ||
| commands.go | ||
| config.go | ||
| inputs.go | ||
| logger.go | ||
| outputs.go | ||
| start.go | ||
| testutil.go | ||
README.md
poller
UniFi Poller Core
This module ties the inputs together with the outputs.
Aggregates metrics on request. Provides CLI app and args parsing.
Ideal
This library has no notion of "UniFi" or controllers, or Influx, or Prometheus.
This library simply provides an input interface and an output interface.
Each interface uses an []any type, so any type of data can be used.
That is to say, you could write input and output plugins that work with, say,
Cisco gear, or any other network (or even non-network) data. The existing plugins
should provide ample example of how to use this library, but at some point the
godoc will improve.
Features
- Automatically unmarshal's plugin config structs from config file and/or env variables.
- Initializes all "imported" plugins on startup.
- Provides input plugins a Logger, requires an interface for Metrics and Events retrieval.
- Provides Output plugins an interface to retrieve Metrics and Events, and a Logger.
- Provides automatic aggregation of Metrics and Events from multiple sources.