diff --git a/pkg/datadogunifi/usw.go b/pkg/datadogunifi/usw.go index d9dd5a17..890b4f56 100644 --- a/pkg/datadogunifi/usw.go +++ b/pkg/datadogunifi/usw.go @@ -79,8 +79,8 @@ func (u *DatadogUnifi) batchUSWstat(sw *unifi.Sw) map[string]float64 { //nolint:funlen func (u *DatadogUnifi) batchPortTable(r report, t map[string]string, pt []unifi.Port) { for _, p := range pt { - if !u.DeadPorts && (!p.Up.Val || !p.Enable.Val) { - continue // only record UP ports. + if !u.DeadPorts && (!p.Up.Val || !p.Enable.Val) && p.PoePower.Val == 0 { + continue // only record UP ports, or ports providing PoE power. } tags := cleanTags(map[string]string{ diff --git a/pkg/influxunifi/usw.go b/pkg/influxunifi/usw.go index 78eb47d8..716147ea 100644 --- a/pkg/influxunifi/usw.go +++ b/pkg/influxunifi/usw.go @@ -75,8 +75,8 @@ func (u *InfluxUnifi) batchUSWstat(sw *unifi.Sw) map[string]any { //nolint:funlen func (u *InfluxUnifi) batchPortTable(r report, t map[string]string, pt []unifi.Port) { for _, p := range pt { - if !u.DeadPorts && (!p.Up.Val || !p.Enable.Val) { - continue // only record UP ports. + if !u.DeadPorts && (!p.Up.Val || !p.Enable.Val) && p.PoePower.Val == 0 { + continue // only record UP ports, or ports providing PoE power. } tags := map[string]string{ diff --git a/pkg/promunifi/pdu.go b/pkg/promunifi/pdu.go index 882a786b..a10d7053 100644 --- a/pkg/promunifi/pdu.go +++ b/pkg/promunifi/pdu.go @@ -197,8 +197,8 @@ func (u *promUnifi) exportPDUstats(r report, labels []string, sw *unifi.Sw) { func (u *promUnifi) exportPDUPrtTable(r report, labels []string, pt []unifi.Port) { // Per-port data on a switch for _, p := range pt { - if !u.DeadPorts && (!p.Up.Val || !p.Enable.Val) { - continue + if !u.DeadPorts && (!p.Up.Val || !p.Enable.Val) && p.PoePower.Val == 0 { + continue // skip dead ports unless they're providing PoE power } // Copy labels, and add four new ones. diff --git a/pkg/promunifi/usw.go b/pkg/promunifi/usw.go index 221840fa..b72619ac 100644 --- a/pkg/promunifi/usw.go +++ b/pkg/promunifi/usw.go @@ -176,8 +176,8 @@ func (u *promUnifi) exportUSWstats(r report, labels []string, sw *unifi.Sw) { func (u *promUnifi) exportPRTtable(r report, labels []string, pt []unifi.Port) { // Per-port data on a switch for _, p := range pt { - if !u.DeadPorts && (!p.Up.Val || !p.Enable.Val) { - continue + if !u.DeadPorts && (!p.Up.Val || !p.Enable.Val) && p.PoePower.Val == 0 { + continue // skip dead ports unless they're providing PoE power } // Copy labels, and add four new ones.