Skip to content

Commit

Permalink
Merge pull request #31 from charlie-haley/fix/mac-id-position
Browse files Browse the repository at this point in the history
fix: mac and switch-id label order
  • Loading branch information
charlie-haley authored Mar 11, 2022
2 parents 4be3e6c + d1ee817 commit 4027851
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/omada/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ func setPortMetricsByDevice(c *api.Client, device api.Device, site string) error
if client != nil {
vlanId := fmt.Sprintf("%.0f", client.VlanId)

omada_port_power_watts.WithLabelValues(client.HostName, client.Vendor, port, p.SwitchId, p.SwitchMac, vlanId, p.ProfileName, site).Set(p.PortStatus.PoePower)
omada_port_link_status.WithLabelValues(client.HostName, client.Vendor, port, p.SwitchId, p.SwitchMac, vlanId, p.ProfileName, site).Set(p.PortStatus.LinkStatus)
omada_port_power_watts.WithLabelValues(client.HostName, client.Vendor, port, p.SwitchMac, p.SwitchId, vlanId, p.ProfileName, site).Set(p.PortStatus.PoePower)
omada_port_link_status.WithLabelValues(client.HostName, client.Vendor, port, p.SwitchMac, p.SwitchId, vlanId, p.ProfileName, site).Set(p.PortStatus.LinkStatus)
omada_port_link_speed_mbps.WithLabelValues(client.HostName, client.Vendor, port, p.SwitchMac, p.SwitchId, vlanId, p.ProfileName, site).Set(linkSpeed)
} else {
omada_port_power_watts.WithLabelValues("", "", port, p.SwitchId, p.SwitchMac, "", p.ProfileName, site).Set(p.PortStatus.PoePower)
omada_port_link_status.WithLabelValues("", "", port, p.SwitchId, p.SwitchMac, "", p.ProfileName, site).Set(p.PortStatus.LinkStatus)
omada_port_power_watts.WithLabelValues("", "", port, p.SwitchMac, p.SwitchId, "", p.ProfileName, site).Set(p.PortStatus.PoePower)
omada_port_link_status.WithLabelValues("", "", port, p.SwitchMac, p.SwitchId, "", p.ProfileName, site).Set(p.PortStatus.LinkStatus)
omada_port_link_speed_mbps.WithLabelValues("", "", port, p.SwitchMac, p.SwitchId, "", p.ProfileName, site).Set(linkSpeed)
}

Expand Down

0 comments on commit 4027851

Please sign in to comment.