mirror of
https://github.com/unpoller/unpoller.git
synced 2026-04-05 08:54:09 -04:00
Add the site_to_site_enabled FlexBool field from the vpn subsystem health entry to both InfluxDB and Prometheus outputs. The field was present in the unifi.Health struct but never exported. - influxunifi: add site_to_site_enabled to subsystems fields map - promunifi: add SiteToSiteEnabled gauge descriptor and emit it in the vpn case of exportSite - Update integration_test_expectations.yaml to include the new field Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -211,6 +211,7 @@ points:
|
||||
rx_bytes-r: int
|
||||
speedtest_lastrun: float
|
||||
speedtest_ping: float
|
||||
site_to_site_enabled: bool
|
||||
tx_bytes-r: int
|
||||
uptime: int
|
||||
wan_ip: string
|
||||
|
||||
@@ -57,6 +57,7 @@ func (u *InfluxUnifi) batchSite(r report, s *unifi.Site) {
|
||||
"remote_user_tx_bytes": h.RemoteUserTxBytes.Val,
|
||||
"remote_user_rx_packets": h.RemoteUserRxPackets.Val,
|
||||
"remote_user_tx_packets": h.RemoteUserTxPackets.Val,
|
||||
"site_to_site_enabled": h.SiteToSiteEnabled.Val,
|
||||
"num_new_alarms": s.NumNewAlarms.Val,
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ type site struct {
|
||||
RemoteUserTxBytes *prometheus.Desc
|
||||
RemoteUserRxPackets *prometheus.Desc
|
||||
RemoteUserTxPackets *prometheus.Desc
|
||||
SiteToSiteEnabled *prometheus.Desc
|
||||
DPITxPackets *prometheus.Desc
|
||||
DPIRxPackets *prometheus.Desc
|
||||
DPITxBytes *prometheus.Desc
|
||||
@@ -68,6 +69,7 @@ func descSite(ns string) *site {
|
||||
RemoteUserTxBytes: nd(ns+"remote_user_transmit_bytes_total", "Remote Users Transmit Bytes", labels, nil),
|
||||
RemoteUserRxPackets: nd(ns+"remote_user_receive_packets_total", "Remote Users Receive Packets", labels, nil),
|
||||
RemoteUserTxPackets: nd(ns+"remote_user_transmit_packets_total", "Remote Users Transmit Packets", labels, nil),
|
||||
SiteToSiteEnabled: nd(ns+"site_to_site_enabled", "Site-to-site VPN enabled (1/0)", labels, nil),
|
||||
DPITxPackets: nd(ns+"dpi_transmit_packets", "Site DPI Transmit Packets", labelDPI, nil),
|
||||
DPIRxPackets: nd(ns+"dpi_receive_packets", "Site DPI Receive Packets", labelDPI, nil),
|
||||
DPITxBytes: nd(ns+"dpi_transmit_bytes", "Site DPI Transmit Bytes", labelDPI, nil),
|
||||
@@ -160,6 +162,7 @@ func (u *promUnifi) exportSite(r report, s *unifi.Site) {
|
||||
{u.Site.RemoteUserTxBytes, counter, h.RemoteUserTxBytes, labels},
|
||||
{u.Site.RemoteUserRxPackets, counter, h.RemoteUserRxPackets, labels},
|
||||
{u.Site.RemoteUserTxPackets, counter, h.RemoteUserTxPackets, labels},
|
||||
{u.Site.SiteToSiteEnabled, gauge, h.SiteToSiteEnabled.Val, labels},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user