How vincejv/gpon-stats-exporter works
GPON Parser selects an ONT-specific collector, periodically refreshes its cached data, and serves device, optical, combined, and health responses over HTTP. Telegraf can scrape the JSON endpoints for downstream InfluxDB and Grafana monitoring. Model adapters use different ONT web, JSON, or text interfaces; the sampled code shows several polling and parsing implementations, while README documents the supported models and API capabilities. Adapter internals not shown in excerpts are represented by their source files without inferred internal call chains.
Main entry points: gpon-parser.go Startup and routing · an5506_stock.go AN5506 collector · gpon.go Stats API handlers · zltg202.go ZLT G202 collector
Components 19
Exporter runtime
- Startup and routing
gpon-parser.go - Scheduled polling
core/cron.go - Stats API handlers
svc/gpon.go - Health handler
svc/health.go
ONT collectors
- AN5506 collector
device/an5506_stock.go - HG6245D collector
device/hg6245d_globe.go - ZTE F670 collector
device/zte_f670.go - ZLT G3000A collector
device/zltg3000a.go - ZLT G202 collector
device/zltg202.go - Skyworth collector
device/skyworth_gn.go - Nokia G010S collector
device/g010s.go
Shared data
- Stats structures
model/stats.go - Concurrent cache helpers
util/mutex.go - Parsing utilities
util/utils.go - Telnet utilities
util/telnet.go
Monitoring integrations
- Telegraf scraper
- InfluxDB and Grafana
Other components
- Operator
- ONT device
Connections 28
- Operator → Startup and routing: starts exporter
README.md - Startup and routing → Scheduled polling: starts jobs
gpon-parser.go - Startup and routing → Stats API handlers: registers routes
gpon-parser.go - Startup and routing → Health handler: registers route
gpon-parser.go - Startup and routing → AN5506 collector: selects model
gpon-parser.go - Startup and routing → HG6245D collector: selects model
gpon-parser.go - Startup and routing → ZTE F670 collector: selects model
gpon-parser.go - Startup and routing → ZLT G3000A collector: selects model
gpon-parser.go - Startup and routing → ZLT G202 collector: selects model
gpon-parser.go - Startup and routing → Skyworth collector: selects model
gpon-parser.go - Startup and routing → Nokia G010S collector: selects model
gpon-parser.go - Scheduled polling → ONT device: polls through adapter
core/cron.go - Stats API handlers → Stats structures: returns JSON
svc/gpon.go - Stats API handlers → Telegraf scraper: serves JSON endpoints
README.md - Telegraf scraper → InfluxDB and Grafana: feeds monitoring
README.md - AN5506 collector → ONT device: fetches pages
device/an5506_stock.go - HG6245D collector → ONT device: fetches page
device/hg6245d_globe.go - Nokia G010S collector → ONT device: fetches script output
device/g010s.go - ZLT G202 collector → ONT device: fetches status
device/zltg202.go - ZLT G3000A collector → ONT device: posts request
device/zltg3000a.go - Skyworth collector → Concurrent cache helpers: updates cache
device/skyworth_gn.go - AN5506 collector → Concurrent cache helpers: stores pages
device/an5506_stock.go - Nokia G010S collector → Concurrent cache helpers: stores output
device/g010s.go - ZLT G202 collector → Stats structures: builds statistics
device/zltg202.go - ZTE F670 collector → Telnet utilities: uses telnet helpers
device/zte_f670.go - AN5506 collector → Parsing utilities: parses values
device/an5506_stock.go - Skyworth collector → Parsing utilities: converts values
device/skyworth_gn.go - ONT device → Stats API handlers: provides stats