diff --git a/pkg/probe/managed_switch.go b/pkg/probe/managed_switch.go index d96cda5d..7ed8ccf6 100644 --- a/pkg/probe/managed_switch.go +++ b/pkg/probe/managed_switch.go @@ -160,9 +160,6 @@ func probeManagedSwitch(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Me "Total number of l3 packets", []string{"vdom", "switch_name", "port"}, nil, ) - - // Port - ) type Port struct { @@ -202,7 +199,7 @@ func probeManagedSwitch(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Me } type Results struct { - Name string `json:"name"` + SwitchID string `json:"switch-id"` VDOM string `json:"vdom"` Serial string `json:"serial"` OSVersion string `json:"os_version"` @@ -212,63 +209,99 @@ func probeManagedSwitch(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Me JoinTimeRaw float64 `json:"join_time_raw"` MaxPoeBudget float64 `json:"max_poe_budget"` Ports []Port `json:"ports"` - PortStats map[string]PortStat `json:"port_stats"` } - type managedResponse []struct { - Results []Results `json:"results"` + // Results for /status endpoint + type ResultsStatus struct { + Results + Ports []Port `json:"ports"` + PortStats map[string]PortStat + } + + // Results for /port-stats endpoint + type ResultsPortStats struct { + Results + Ports map[string]PortStat `json:"ports"` + } + + type managedResponseStatus []struct { + Results []ResultsStatus `json:"results"` + } + + type managedResponsePortStats []struct { + Results []ResultsPortStats `json:"results"` } // Consider implementing pagination to remove this limit of 1000 entries - var response managedResponse - if err := c.Get("api/v2/monitor/switch-controller/managed-switch", "vdom=*&start=0&poe=true&port_stats=true&transceiver=true&count=1000", &response); err != nil { + var responseStatus managedResponseStatus + if err := c.Get("api/v2/monitor/switch-controller/managed-switch/status", "vdom=*&start=0&poe=true&port_stats=true&transceiver=true&count=1000", &responseStatus); err != nil { + log.Printf("Error: %v", err) + return nil, false + } + + var responsePortStats managedResponsePortStats + // Fetching Port Stats from a different endpoint /port-stats + if err := c.Get("api/v2/monitor/switch-controller/managed-switch/port-stats", "vdom=*&start=0&poe=true&transceiver=true&count=1000", &responsePortStats); err != nil { log.Printf("Error: %v", err) return nil, false } var m []prometheus.Metric - for _, rs := range response { + for _, rs := range responseStatus { for _, result := range rs.Results { - m = append(m, prometheus.MustNewConstMetric(managedSwitchInfo, prometheus.CounterValue, 1, result.VDOM, result.Name, result.OSVersion, result.Serial, result.State, result.Status)) - m = append(m, prometheus.MustNewConstMetric(managedSwitchMaxPoeBudget, prometheus.CounterValue, result.MaxPoeBudget, result.VDOM, result.Name)) + m = append(m, prometheus.MustNewConstMetric(managedSwitchInfo, prometheus.CounterValue, 1, result.VDOM, result.SwitchID, result.OSVersion, result.Serial, result.State, result.Status)) + m = append(m, prometheus.MustNewConstMetric(managedSwitchMaxPoeBudget, prometheus.CounterValue, result.MaxPoeBudget, result.VDOM, result.SwitchID)) for _, port := range result.Ports { if port.Status == "up" { - m = append(m, prometheus.MustNewConstMetric(portStatus, prometheus.GaugeValue, 1, result.VDOM, result.Name, port.Interface)) + m = append(m, prometheus.MustNewConstMetric(portStatus, prometheus.GaugeValue, 1, result.VDOM, result.SwitchID, port.Interface)) } else { - m = append(m, prometheus.MustNewConstMetric(portStatus, prometheus.GaugeValue, 0, result.VDOM, result.Name, port.Interface)) + m = append(m, prometheus.MustNewConstMetric(portStatus, prometheus.GaugeValue, 0, result.VDOM, result.SwitchID, port.Interface)) } - m = append(m, prometheus.MustNewConstMetric(portInfo, prometheus.GaugeValue, 1, result.VDOM, result.Name, port.Interface, port.Vlan, port.Duplex, port.Status, port.PoeStatus, strconv.FormatBool(port.PoeCapable))) - m = append(m, prometheus.MustNewConstMetric(portPower, prometheus.GaugeValue, port.PortPower, result.VDOM, result.Name, port.Interface)) - m = append(m, prometheus.MustNewConstMetric(portPowerStatus, prometheus.GaugeValue, port.PowerStatus, result.VDOM, result.Name, port.Interface)) + m = append(m, prometheus.MustNewConstMetric(portInfo, prometheus.GaugeValue, 1, result.VDOM, result.SwitchID, port.Interface, port.Vlan, port.Duplex, port.Status, port.PoeStatus, strconv.FormatBool(port.PoeCapable))) + m = append(m, prometheus.MustNewConstMetric(portPower, prometheus.GaugeValue, port.PortPower, result.VDOM, result.SwitchID, port.Interface)) + m = append(m, prometheus.MustNewConstMetric(portPowerStatus, prometheus.GaugeValue, port.PowerStatus, result.VDOM, result.SwitchID, port.Interface)) + + } + // Find port stats from /port-stats response that match this switch + for _, rsp := range responsePortStats { + for _, resultPortStat := range rsp.Results { + // Find matching switch-id + if (resultPortStat.SwitchID == result.SwitchID) { + result.PortStats = resultPortStat.Ports + } + } } + for portName, port := range result.PortStats { - m = append(m, prometheus.MustNewConstMetric(portRxBytes, prometheus.CounterValue, port.BytesRx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portTxBytes, prometheus.CounterValue, port.BytesTx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portRxPackets, prometheus.CounterValue, port.PacketsRx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portTxPackets, prometheus.CounterValue, port.PacketsTx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portRxUcast, prometheus.CounterValue, port.UcastRx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portTxUcast, prometheus.CounterValue, port.UcastTx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portRxMcast, prometheus.CounterValue, port.McastRx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portTxMcast, prometheus.CounterValue, port.McastTx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portRxBcast, prometheus.CounterValue, port.BcastRx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portTxBcast, prometheus.CounterValue, port.BcastTx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portRxErrors, prometheus.CounterValue, port.ErrorsRx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portTxErrors, prometheus.CounterValue, port.ErrorsTx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portRxDrops, prometheus.CounterValue, port.DroppedRx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portTxDrops, prometheus.CounterValue, port.DroppedTx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portRxOversize, prometheus.CounterValue, port.OversizeRx, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portTxOversize, prometheus.CounterValue, port.OversizeTx, result.VDOM, result.Name, portName)) + m = append(m, prometheus.MustNewConstMetric(portRxBytes, prometheus.CounterValue, port.BytesRx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portTxBytes, prometheus.CounterValue, port.BytesTx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portRxPackets, prometheus.CounterValue, port.PacketsRx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portTxPackets, prometheus.CounterValue, port.PacketsTx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portRxUcast, prometheus.CounterValue, port.UcastRx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portTxUcast, prometheus.CounterValue, port.UcastTx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portRxMcast, prometheus.CounterValue, port.McastRx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portTxMcast, prometheus.CounterValue, port.McastTx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portRxBcast, prometheus.CounterValue, port.BcastRx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portTxBcast, prometheus.CounterValue, port.BcastTx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portRxErrors, prometheus.CounterValue, port.ErrorsRx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portTxErrors, prometheus.CounterValue, port.ErrorsTx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portRxDrops, prometheus.CounterValue, port.DroppedRx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portTxDrops, prometheus.CounterValue, port.DroppedTx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portRxOversize, prometheus.CounterValue, port.OversizeRx, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portTxOversize, prometheus.CounterValue, port.OversizeTx, result.VDOM, result.SwitchID, portName)) - m = append(m, prometheus.MustNewConstMetric(portUndersize, prometheus.CounterValue, port.Undersize, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portFragments, prometheus.CounterValue, port.Fragments, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portJabbers, prometheus.CounterValue, port.Jabbers, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portCollisions, prometheus.CounterValue, port.Collisions, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portCrcAlignments, prometheus.CounterValue, port.CrcAlignments, result.VDOM, result.Name, portName)) - m = append(m, prometheus.MustNewConstMetric(portL3Packets, prometheus.CounterValue, port.L3Packets, result.VDOM, result.Name, portName)) + m = append(m, prometheus.MustNewConstMetric(portUndersize, prometheus.CounterValue, port.Undersize, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portFragments, prometheus.CounterValue, port.Fragments, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portJabbers, prometheus.CounterValue, port.Jabbers, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portCollisions, prometheus.CounterValue, port.Collisions, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portCrcAlignments, prometheus.CounterValue, port.CrcAlignments, result.VDOM, result.SwitchID, portName)) + m = append(m, prometheus.MustNewConstMetric(portL3Packets, prometheus.CounterValue, port.L3Packets, result.VDOM, result.SwitchID, portName)) } } } + + return m, true } diff --git a/pkg/probe/managed_switch_test.go b/pkg/probe/managed_switch_test.go index 63377a5f..f7b59a20 100644 --- a/pkg/probe/managed_switch_test.go +++ b/pkg/probe/managed_switch_test.go @@ -3,14 +3,18 @@ package probe import ( "strings" "testing" + "fmt" + "os" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/testutil" + "github.com/prometheus/common/expfmt" ) func TestProbeManagedSwitch(t *testing.T) { c := newFakeClient() - c.prepare("api/v2/monitor/switch-controller/managed-switch", "testdata/managed-switch.jsonnet") + c.prepare("api/v2/monitor/switch-controller/managed-switch/status", "testdata/managed-switch-status.jsonnet") + c.prepare("api/v2/monitor/switch-controller/managed-switch/port-stats", "testdata/managed-switch-port-stats.jsonnet") r := prometheus.NewPedanticRegistry() if !testProbe(probeManagedSwitch, c, r) { t.Errorf("probeManagedSwitchStatus() returned non-success") @@ -147,7 +151,7 @@ func TestProbeManagedSwitch(t *testing.T) { # HELP fortigate_managed_switch_l3_packets_total Total number of l3 packets # TYPE fortigate_managed_switch_l3_packets_total counter fortigate_managed_switch_l3_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_l3_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_l3_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 166728 fortigate_managed_switch_l3_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_l3_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_l3_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 @@ -160,10 +164,10 @@ func TestProbeManagedSwitch(t *testing.T) { fortigate_managed_switch_l3_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_l3_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_l3_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_l3_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_l3_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_l3_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_l3_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_l3_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 3.681687e+06 + fortigate_managed_switch_l3_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 2.451258e+06 + fortigate_managed_switch_l3_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 9 + fortigate_managed_switch_l3_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 5.774658e+06 fortigate_managed_switch_l3_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_l3_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_l3_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 @@ -300,97 +304,97 @@ func TestProbeManagedSwitch(t *testing.T) { fortigate_managed_switch_port_status{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_rx_bcast_packets_total Total number of received broadcast packets # TYPE fortigate_managed_switch_rx_bcast_packets_total counter - fortigate_managed_switch_rx_bcast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 8.9598762e+07 - fortigate_managed_switch_rx_bcast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 79999 - fortigate_managed_switch_rx_bcast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 24635 - fortigate_managed_switch_rx_bcast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 131902 - fortigate_managed_switch_rx_bcast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 157391 - fortigate_managed_switch_rx_bcast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 30 - fortigate_managed_switch_rx_bcast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 25713 + fortigate_managed_switch_rx_bcast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 386468 + fortigate_managed_switch_rx_bcast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 218 + fortigate_managed_switch_rx_bcast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 1 + fortigate_managed_switch_rx_bcast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_bcast_packets_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bcast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 6972 - fortigate_managed_switch_rx_bcast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 21 - fortigate_managed_switch_rx_bcast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bcast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 79872 - fortigate_managed_switch_rx_bcast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 85672 - fortigate_managed_switch_rx_bcast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 28151 - fortigate_managed_switch_rx_bcast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 180123 - fortigate_managed_switch_rx_bcast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 29334 - fortigate_managed_switch_rx_bcast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bcast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 6.012792e+06 + fortigate_managed_switch_rx_bcast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 12 + fortigate_managed_switch_rx_bcast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 18 + fortigate_managed_switch_rx_bcast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 6867 + fortigate_managed_switch_rx_bcast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 6889 + fortigate_managed_switch_rx_bcast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 524 + fortigate_managed_switch_rx_bcast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 400003 + fortigate_managed_switch_rx_bcast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 333423 fortigate_managed_switch_rx_bcast_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_bcast_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bcast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 557 fortigate_managed_switch_rx_bcast_packets_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_bcast_packets_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bcast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 21657 - fortigate_managed_switch_rx_bcast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 21 - fortigate_managed_switch_rx_bcast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 12661 - fortigate_managed_switch_rx_bcast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 67595 - fortigate_managed_switch_rx_bcast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 51230 - fortigate_managed_switch_rx_bcast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 72 + fortigate_managed_switch_rx_bcast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bcast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_rx_bytes_total Total number of received bytes # TYPE fortigate_managed_switch_rx_bytes_total counter - fortigate_managed_switch_rx_bytes_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 1.34930414247e+11 - fortigate_managed_switch_rx_bytes_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 1.33440202045e+11 - fortigate_managed_switch_rx_bytes_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 5.961056557e+09 - fortigate_managed_switch_rx_bytes_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 2.2679215185e+10 - fortigate_managed_switch_rx_bytes_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 3.0008494845e+10 - fortigate_managed_switch_rx_bytes_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 37874 - fortigate_managed_switch_rx_bytes_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 4.3476254701e+10 + fortigate_managed_switch_rx_bytes_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 3.609650574e+09 + fortigate_managed_switch_rx_bytes_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 5.05250508e+08 + fortigate_managed_switch_rx_bytes_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 13952 + fortigate_managed_switch_rx_bytes_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 9.0023496e+07 + fortigate_managed_switch_rx_bytes_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_bytes_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bytes_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 2.06123042e+10 - fortigate_managed_switch_rx_bytes_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 49529 - fortigate_managed_switch_rx_bytes_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bytes_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 8.127628504e+09 - fortigate_managed_switch_rx_bytes_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 7.546860589e+10 - fortigate_managed_switch_rx_bytes_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 3.0651113732e+10 - fortigate_managed_switch_rx_bytes_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 1.553331059e+09 - fortigate_managed_switch_rx_bytes_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 2.21170508e+08 - fortigate_managed_switch_rx_bytes_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bytes_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 1.52616703893e+12 + fortigate_managed_switch_rx_bytes_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 3.3288567e+08 + fortigate_managed_switch_rx_bytes_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 1.164988782e+09 + fortigate_managed_switch_rx_bytes_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 7.844701e+06 + fortigate_managed_switch_rx_bytes_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 9.2797595e+07 + fortigate_managed_switch_rx_bytes_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 1.248215979e+09 + fortigate_managed_switch_rx_bytes_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 1.283515639e+09 + fortigate_managed_switch_rx_bytes_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 1.643049095e+09 + fortigate_managed_switch_rx_bytes_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 1.54309355e+09 fortigate_managed_switch_rx_bytes_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_bytes_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bytes_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 5.56071078e+08 fortigate_managed_switch_rx_bytes_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_bytes_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_bytes_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 1.547577e+08 - fortigate_managed_switch_rx_bytes_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 34237 - fortigate_managed_switch_rx_bytes_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 1.93704991e+09 - fortigate_managed_switch_rx_bytes_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 3.81008558e+08 - fortigate_managed_switch_rx_bytes_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 8.304739935e+09 - fortigate_managed_switch_rx_bytes_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 5.9554837e+07 + fortigate_managed_switch_rx_bytes_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_bytes_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_rx_drops_total Total number of received drops # TYPE fortigate_managed_switch_rx_drops_total counter - fortigate_managed_switch_rx_drops_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 1766 - fortigate_managed_switch_rx_drops_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 13 - fortigate_managed_switch_rx_drops_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 1460 - fortigate_managed_switch_rx_drops_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 5842 - fortigate_managed_switch_rx_drops_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 7949 - fortigate_managed_switch_rx_drops_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 36 - fortigate_managed_switch_rx_drops_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 1918 + fortigate_managed_switch_rx_drops_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 4 + fortigate_managed_switch_rx_drops_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 5 + fortigate_managed_switch_rx_drops_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_drops_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_drops_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 1036 - fortigate_managed_switch_rx_drops_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 46 + fortigate_managed_switch_rx_drops_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_drops_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_drops_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 3274 - fortigate_managed_switch_rx_drops_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 44 - fortigate_managed_switch_rx_drops_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 593 - fortigate_managed_switch_rx_drops_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 7 - fortigate_managed_switch_rx_drops_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 132 - fortigate_managed_switch_rx_drops_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_drops_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 9.502165e+06 + fortigate_managed_switch_rx_drops_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 32 + fortigate_managed_switch_rx_drops_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 1.264621e+06 + fortigate_managed_switch_rx_drops_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 410 fortigate_managed_switch_rx_drops_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_drops_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_drops_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_drops_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_drops_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_drops_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 152 - fortigate_managed_switch_rx_drops_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 45 - fortigate_managed_switch_rx_drops_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 38 - fortigate_managed_switch_rx_drops_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 60 - fortigate_managed_switch_rx_drops_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 3779 - fortigate_managed_switch_rx_drops_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 74 + fortigate_managed_switch_rx_drops_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_drops_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_rx_errors_total Total number of received errors # TYPE fortigate_managed_switch_rx_errors_total counter fortigate_managed_switch_rx_errors_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 @@ -424,35 +428,35 @@ func TestProbeManagedSwitch(t *testing.T) { fortigate_managed_switch_rx_errors_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_rx_mcast_packets_total Total number of received multicast packets # TYPE fortigate_managed_switch_rx_mcast_packets_total counter - fortigate_managed_switch_rx_mcast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 2.0284271e+08 - fortigate_managed_switch_rx_mcast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 3.712478e+06 - fortigate_managed_switch_rx_mcast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 124724 - fortigate_managed_switch_rx_mcast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 552526 - fortigate_managed_switch_rx_mcast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 543593 - fortigate_managed_switch_rx_mcast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 44 - fortigate_managed_switch_rx_mcast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 107638 + fortigate_managed_switch_rx_mcast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 454590 + fortigate_managed_switch_rx_mcast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_mcast_packets_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_mcast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 34664 - fortigate_managed_switch_rx_mcast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 58 - fortigate_managed_switch_rx_mcast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_mcast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 228891 - fortigate_managed_switch_rx_mcast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 2.478241e+06 - fortigate_managed_switch_rx_mcast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 95464 - fortigate_managed_switch_rx_mcast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 93216 - fortigate_managed_switch_rx_mcast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 339331 - fortigate_managed_switch_rx_mcast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_mcast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 3.9493597e+07 + fortigate_managed_switch_rx_mcast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 27961 + fortigate_managed_switch_rx_mcast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 27971 + fortigate_managed_switch_rx_mcast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 27973 + fortigate_managed_switch_rx_mcast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 27973 + fortigate_managed_switch_rx_mcast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 56777 + fortigate_managed_switch_rx_mcast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 56780 + fortigate_managed_switch_rx_mcast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 403979 + fortigate_managed_switch_rx_mcast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 404022 fortigate_managed_switch_rx_mcast_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_mcast_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_mcast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 11494 fortigate_managed_switch_rx_mcast_packets_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_mcast_packets_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_mcast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 238933 - fortigate_managed_switch_rx_mcast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 58 - fortigate_managed_switch_rx_mcast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 91546 - fortigate_managed_switch_rx_mcast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 110379 - fortigate_managed_switch_rx_mcast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 221841 - fortigate_managed_switch_rx_mcast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 88 + fortigate_managed_switch_rx_mcast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_mcast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_rx_oversize_total Total number of received oversize # TYPE fortigate_managed_switch_rx_oversize_total counter fortigate_managed_switch_rx_oversize_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 @@ -486,134 +490,134 @@ func TestProbeManagedSwitch(t *testing.T) { fortigate_managed_switch_rx_oversize_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_rx_packets_total Total number of received packets # TYPE fortigate_managed_switch_rx_packets_total counter - fortigate_managed_switch_rx_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 3.31743835e+08 - fortigate_managed_switch_rx_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 4.33947186e+08 - fortigate_managed_switch_rx_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 3.0300639e+07 - fortigate_managed_switch_rx_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 6.8944093e+07 - fortigate_managed_switch_rx_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 9.8296351e+07 - fortigate_managed_switch_rx_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 235 - fortigate_managed_switch_rx_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 5.572529e+07 + fortigate_managed_switch_rx_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 1.6097764e+07 + fortigate_managed_switch_rx_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 1.612797e+06 + fortigate_managed_switch_rx_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 218 + fortigate_managed_switch_rx_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 789978 + fortigate_managed_switch_rx_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_packets_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 2.4175761e+07 - fortigate_managed_switch_rx_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 262 - fortigate_managed_switch_rx_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 2.8622586e+07 - fortigate_managed_switch_rx_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 1.76679625e+08 - fortigate_managed_switch_rx_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 4.0420467e+07 - fortigate_managed_switch_rx_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 7.760252e+06 - fortigate_managed_switch_rx_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 2.123154e+06 - fortigate_managed_switch_rx_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 1.461469556e+09 + fortigate_managed_switch_rx_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 670380 + fortigate_managed_switch_rx_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 5.099612e+06 + fortigate_managed_switch_rx_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 35671 + fortigate_managed_switch_rx_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 286308 + fortigate_managed_switch_rx_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 7.76534e+06 + fortigate_managed_switch_rx_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 7.888974e+06 + fortigate_managed_switch_rx_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 4.450257e+06 + fortigate_managed_switch_rx_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 9.964549e+06 fortigate_managed_switch_rx_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 2.121701e+06 fortigate_managed_switch_rx_packets_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_packets_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 1.185479e+06 - fortigate_managed_switch_rx_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 257 - fortigate_managed_switch_rx_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 8.844873e+06 - fortigate_managed_switch_rx_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 1.004016e+06 - fortigate_managed_switch_rx_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 3.2368241e+07 - fortigate_managed_switch_rx_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 671591 + fortigate_managed_switch_rx_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_rx_ucast_packets_total Total number of received unicast packets # TYPE fortigate_managed_switch_rx_ucast_packets_total counter - fortigate_managed_switch_rx_ucast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 3.9302363e+07 - fortigate_managed_switch_rx_ucast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 4.30154709e+08 - fortigate_managed_switch_rx_ucast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 3.015128e+07 - fortigate_managed_switch_rx_ucast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 6.8259665e+07 - fortigate_managed_switch_rx_ucast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 9.7595367e+07 - fortigate_managed_switch_rx_ucast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 161 - fortigate_managed_switch_rx_ucast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 5.5591939e+07 + fortigate_managed_switch_rx_ucast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 1.6097764e+07 + fortigate_managed_switch_rx_ucast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 771739 + fortigate_managed_switch_rx_ucast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 789977 + fortigate_managed_switch_rx_ucast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_ucast_packets_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_ucast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 2.4134125e+07 - fortigate_managed_switch_rx_ucast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 183 - fortigate_managed_switch_rx_ucast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_ucast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 2.8313823e+07 - fortigate_managed_switch_rx_ucast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 1.74115712e+08 - fortigate_managed_switch_rx_ucast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 4.0296852e+07 - fortigate_managed_switch_rx_ucast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 7.486913e+06 - fortigate_managed_switch_rx_ucast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 1.754489e+06 - fortigate_managed_switch_rx_ucast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_ucast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 1.415963167e+09 + fortigate_managed_switch_rx_ucast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 642407 + fortigate_managed_switch_rx_ucast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 5.071623e+06 + fortigate_managed_switch_rx_ucast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 831 + fortigate_managed_switch_rx_ucast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 251446 + fortigate_managed_switch_rx_ucast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 7.708039e+06 + fortigate_managed_switch_rx_ucast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 7.832194e+06 + fortigate_managed_switch_rx_ucast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 3.646275e+06 + fortigate_managed_switch_rx_ucast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 9.227104e+06 fortigate_managed_switch_rx_ucast_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_ucast_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_ucast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 2.10965e+06 fortigate_managed_switch_rx_ucast_packets_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_rx_ucast_packets_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_rx_ucast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 924889 - fortigate_managed_switch_rx_ucast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 178 - fortigate_managed_switch_rx_ucast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 8.740666e+06 - fortigate_managed_switch_rx_ucast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 826042 - fortigate_managed_switch_rx_ucast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 3.209517e+07 - fortigate_managed_switch_rx_ucast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 671431 + fortigate_managed_switch_rx_ucast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_rx_ucast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_tx_bcast_packets_total Total number of transmitted broadcast packets # TYPE fortigate_managed_switch_tx_bcast_packets_total counter - fortigate_managed_switch_tx_bcast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 110109 - fortigate_managed_switch_tx_bcast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 2.2913751e+07 - fortigate_managed_switch_tx_bcast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 1.121818e+06 - fortigate_managed_switch_tx_bcast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 1.1829478e+07 - fortigate_managed_switch_tx_bcast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 7.782054e+06 - fortigate_managed_switch_tx_bcast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 5 - fortigate_managed_switch_tx_bcast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 1.086198e+06 + fortigate_managed_switch_tx_bcast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 329887 + fortigate_managed_switch_tx_bcast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 98099 + fortigate_managed_switch_tx_bcast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 218769 + fortigate_managed_switch_tx_bcast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_bcast_packets_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bcast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 242528 - fortigate_managed_switch_tx_bcast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 6 - fortigate_managed_switch_tx_bcast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bcast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 5.629362e+06 - fortigate_managed_switch_tx_bcast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 2.0913412e+07 - fortigate_managed_switch_tx_bcast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 1.206344e+06 - fortigate_managed_switch_tx_bcast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 9.430355e+06 - fortigate_managed_switch_tx_bcast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 1.7169614e+07 - fortigate_managed_switch_tx_bcast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bcast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 1.059981e+06 + fortigate_managed_switch_tx_bcast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 486468 + fortigate_managed_switch_tx_bcast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 567570 + fortigate_managed_switch_tx_bcast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 380235 + fortigate_managed_switch_tx_bcast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 364291 + fortigate_managed_switch_tx_bcast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 401120 + fortigate_managed_switch_tx_bcast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 401615 + fortigate_managed_switch_tx_bcast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 459245 + fortigate_managed_switch_tx_bcast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 11021 fortigate_managed_switch_tx_bcast_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_bcast_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bcast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 252981 fortigate_managed_switch_tx_bcast_packets_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_bcast_packets_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bcast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 1.247639e+07 - fortigate_managed_switch_tx_bcast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 5 - fortigate_managed_switch_tx_bcast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 1.1202087e+07 - fortigate_managed_switch_tx_bcast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 7.154671e+06 - fortigate_managed_switch_tx_bcast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 3.104095e+06 - fortigate_managed_switch_tx_bcast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 8.095255e+06 + fortigate_managed_switch_tx_bcast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bcast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_tx_bytes_total Total number of transmitted bytes # TYPE fortigate_managed_switch_tx_bytes_total counter - fortigate_managed_switch_tx_bytes_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 1.0884719344e+10 - fortigate_managed_switch_tx_bytes_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 8.34905285534e+11 - fortigate_managed_switch_tx_bytes_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 1.18132462128e+11 - fortigate_managed_switch_tx_bytes_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 8.9042475131e+10 - fortigate_managed_switch_tx_bytes_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 1.47636141701e+11 - fortigate_managed_switch_tx_bytes_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 69093 - fortigate_managed_switch_tx_bytes_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 6.0519307071e+10 + fortigate_managed_switch_tx_bytes_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 4.094254483e+09 + fortigate_managed_switch_tx_bytes_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 1.057457469e+09 + fortigate_managed_switch_tx_bytes_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 1.20054895e+08 + fortigate_managed_switch_tx_bytes_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 3.3026203e+08 + fortigate_managed_switch_tx_bytes_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_bytes_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bytes_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 2.1693872232e+10 - fortigate_managed_switch_tx_bytes_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 76804 - fortigate_managed_switch_tx_bytes_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bytes_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 3.5669898069e+10 - fortigate_managed_switch_tx_bytes_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 1.94290370163e+11 - fortigate_managed_switch_tx_bytes_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 3.5080851166e+10 - fortigate_managed_switch_tx_bytes_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 1.2193940704e+10 - fortigate_managed_switch_tx_bytes_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 1.6826662742e+10 - fortigate_managed_switch_tx_bytes_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bytes_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 4.02394112529e+11 + fortigate_managed_switch_tx_bytes_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 9.95087031e+08 + fortigate_managed_switch_tx_bytes_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 4.98405588e+08 + fortigate_managed_switch_tx_bytes_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 3.56603008e+08 + fortigate_managed_switch_tx_bytes_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 5.37463983e+08 + fortigate_managed_switch_tx_bytes_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 8.244358564e+09 + fortigate_managed_switch_tx_bytes_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 5.925235826e+09 + fortigate_managed_switch_tx_bytes_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 2.713564863e+09 + fortigate_managed_switch_tx_bytes_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 3.19096093e+08 fortigate_managed_switch_tx_bytes_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_bytes_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bytes_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 1.695841429e+09 fortigate_managed_switch_tx_bytes_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_bytes_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_bytes_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 1.3117367928e+10 - fortigate_managed_switch_tx_bytes_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 73034 - fortigate_managed_switch_tx_bytes_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 1.3093340484e+10 - fortigate_managed_switch_tx_bytes_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 7.859708084e+09 - fortigate_managed_switch_tx_bytes_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 5.0520676898e+10 - fortigate_managed_switch_tx_bytes_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 8.656136671e+09 + fortigate_managed_switch_tx_bytes_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_bytes_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_tx_drops_total Total number of transmitted drops # TYPE fortigate_managed_switch_tx_drops_total counter fortigate_managed_switch_tx_drops_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_drops_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_drops_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 1 - fortigate_managed_switch_tx_drops_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_drops_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_drops_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 1 fortigate_managed_switch_tx_drops_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_drops_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_drops_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 @@ -630,7 +634,7 @@ func TestProbeManagedSwitch(t *testing.T) { fortigate_managed_switch_tx_drops_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_drops_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_drops_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_drops_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_drops_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 22 fortigate_managed_switch_tx_drops_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_drops_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_drops_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 @@ -672,35 +676,35 @@ func TestProbeManagedSwitch(t *testing.T) { fortigate_managed_switch_tx_errors_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_tx_mcast_packets_total Total number of transmitted multicast packets # TYPE fortigate_managed_switch_tx_mcast_packets_total counter - fortigate_managed_switch_tx_mcast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 2.5744161e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 4.223098e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 3.482425e+06 - fortigate_managed_switch_tx_mcast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 2.0664998e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 1.5550817e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 9 - fortigate_managed_switch_tx_mcast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 2.55728e+06 + fortigate_managed_switch_tx_mcast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 811352 + fortigate_managed_switch_tx_mcast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 270481 + fortigate_managed_switch_tx_mcast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 269219 + fortigate_managed_switch_tx_mcast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_mcast_packets_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_mcast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 628108 - fortigate_managed_switch_tx_mcast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 7 - fortigate_managed_switch_tx_mcast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_mcast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 1.6710185e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 4.2340767e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 3.269723e+06 - fortigate_managed_switch_tx_mcast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 3.0923127e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 3.0690631e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_mcast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 4.4133987e+07 + fortigate_managed_switch_tx_mcast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 657839 + fortigate_managed_switch_tx_mcast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 667598 + fortigate_managed_switch_tx_mcast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 667600 + fortigate_managed_switch_tx_mcast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 667598 + fortigate_managed_switch_tx_mcast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 315334 + fortigate_managed_switch_tx_mcast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 315331 + fortigate_managed_switch_tx_mcast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 402472 + fortigate_managed_switch_tx_mcast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 410227 fortigate_managed_switch_tx_mcast_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_mcast_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_mcast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 114683 fortigate_managed_switch_tx_mcast_packets_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_mcast_packets_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_mcast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 3.0787572e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 7 - fortigate_managed_switch_tx_mcast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 3.0922857e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 2.0645025e+07 - fortigate_managed_switch_tx_mcast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 9.267043e+06 - fortigate_managed_switch_tx_mcast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 2.536097e+07 + fortigate_managed_switch_tx_mcast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_mcast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_tx_oversize_total Total number of transmitted oversize # TYPE fortigate_managed_switch_tx_oversize_total counter fortigate_managed_switch_tx_oversize_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 @@ -734,72 +738,72 @@ func TestProbeManagedSwitch(t *testing.T) { fortigate_managed_switch_tx_oversize_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_tx_packets_total Total number of transmitted packets # TYPE fortigate_managed_switch_tx_packets_total counter - fortigate_managed_switch_tx_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 6.186197e+07 - fortigate_managed_switch_tx_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 6.9038986e+08 - fortigate_managed_switch_tx_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 9.6717251e+07 - fortigate_managed_switch_tx_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 1.34325577e+08 - fortigate_managed_switch_tx_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 1.99318286e+08 - fortigate_managed_switch_tx_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 189 - fortigate_managed_switch_tx_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 7.2474488e+07 + fortigate_managed_switch_tx_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 2.3838574e+07 + fortigate_managed_switch_tx_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 2.352591e+06 + fortigate_managed_switch_tx_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 368615 + fortigate_managed_switch_tx_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 1.283318e+06 + fortigate_managed_switch_tx_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_packets_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 2.6579199e+07 - fortigate_managed_switch_tx_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 195 - fortigate_managed_switch_tx_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 6.114537e+07 - fortigate_managed_switch_tx_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 2.00133854e+08 - fortigate_managed_switch_tx_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 4.9880064e+07 - fortigate_managed_switch_tx_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 4.9132301e+07 - fortigate_managed_switch_tx_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 4.9247686e+07 - fortigate_managed_switch_tx_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 1.060966881e+09 + fortigate_managed_switch_tx_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 5.659466e+06 + fortigate_managed_switch_tx_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 2.626036e+06 + fortigate_managed_switch_tx_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 1.135396e+06 + fortigate_managed_switch_tx_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 1.437148e+06 + fortigate_managed_switch_tx_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 1.0005028e+07 + fortigate_managed_switch_tx_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 8.308575e+06 + fortigate_managed_switch_tx_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 9.317269e+06 + fortigate_managed_switch_tx_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 2.203125e+06 fortigate_managed_switch_tx_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 6.113198e+06 fortigate_managed_switch_tx_packets_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_packets_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 4.4330569e+07 - fortigate_managed_switch_tx_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 203 - fortigate_managed_switch_tx_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 4.9672181e+07 - fortigate_managed_switch_tx_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 2.8807986e+07 - fortigate_managed_switch_tx_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 7.6660806e+07 - fortigate_managed_switch_tx_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 3.3915497e+07 + fortigate_managed_switch_tx_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_tx_ucast_packets_total Total number of transmitted unicast packets # TYPE fortigate_managed_switch_tx_ucast_packets_total counter - fortigate_managed_switch_tx_ucast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 3.60077e+07 - fortigate_managed_switch_tx_ucast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 6.25245129e+08 - fortigate_managed_switch_tx_ucast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 9.2113008e+07 - fortigate_managed_switch_tx_ucast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 1.01831101e+08 - fortigate_managed_switch_tx_ucast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 1.75985415e+08 - fortigate_managed_switch_tx_ucast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 175 - fortigate_managed_switch_tx_ucast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 6.883101e+07 + fortigate_managed_switch_tx_ucast_packets_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 2.3838574e+07 + fortigate_managed_switch_tx_ucast_packets_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 1.211352e+06 + fortigate_managed_switch_tx_ucast_packets_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 35 + fortigate_managed_switch_tx_ucast_packets_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 795330 + fortigate_managed_switch_tx_ucast_packets_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_ucast_packets_total{port="port15",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_ucast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 2.5708563e+07 - fortigate_managed_switch_tx_ucast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 182 - fortigate_managed_switch_tx_ucast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_ucast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 3.8805823e+07 - fortigate_managed_switch_tx_ucast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 1.36879675e+08 - fortigate_managed_switch_tx_ucast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 4.5403997e+07 - fortigate_managed_switch_tx_ucast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 8.778819e+06 - fortigate_managed_switch_tx_ucast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 1.387441e+06 - fortigate_managed_switch_tx_ucast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_ucast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 1.015772913e+09 + fortigate_managed_switch_tx_ucast_packets_total{port="port16",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port17",switch_name="FOO-SW-01",vdom="root"} 4.515159e+06 + fortigate_managed_switch_tx_ucast_packets_total{port="port18",switch_name="FOO-SW-01",vdom="root"} 1.390868e+06 + fortigate_managed_switch_tx_ucast_packets_total{port="port19",switch_name="FOO-SW-01",vdom="root"} 87561 + fortigate_managed_switch_tx_ucast_packets_total{port="port2",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port20",switch_name="FOO-SW-01",vdom="root"} 405259 + fortigate_managed_switch_tx_ucast_packets_total{port="port21",switch_name="FOO-SW-01",vdom="root"} 9.288574e+06 + fortigate_managed_switch_tx_ucast_packets_total{port="port22",switch_name="FOO-SW-01",vdom="root"} 7.591629e+06 + fortigate_managed_switch_tx_ucast_packets_total{port="port23",switch_name="FOO-SW-01",vdom="root"} 8.455552e+06 + fortigate_managed_switch_tx_ucast_packets_total{port="port24",switch_name="FOO-SW-01",vdom="root"} 1.781877e+06 fortigate_managed_switch_tx_ucast_packets_total{port="port25",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_ucast_packets_total{port="port26",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_ucast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port27",switch_name="FOO-SW-01",vdom="root"} 5.745534e+06 fortigate_managed_switch_tx_ucast_packets_total{port="port28",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_tx_ucast_packets_total{port="port3",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_tx_ucast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 1.066607e+06 - fortigate_managed_switch_tx_ucast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 191 - fortigate_managed_switch_tx_ucast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 7.547237e+06 - fortigate_managed_switch_tx_ucast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 1.00829e+06 - fortigate_managed_switch_tx_ucast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 6.4289668e+07 - fortigate_managed_switch_tx_ucast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 459272 + fortigate_managed_switch_tx_ucast_packets_total{port="port4",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port5",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port6",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port7",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port8",switch_name="FOO-SW-01",vdom="root"} 0 + fortigate_managed_switch_tx_ucast_packets_total{port="port9",switch_name="FOO-SW-01",vdom="root"} 0 # HELP fortigate_managed_switch_under_size_total Total number of under size # TYPE fortigate_managed_switch_under_size_total counter fortigate_managed_switch_under_size_total{port="internal",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_under_size_total{port="port1",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_under_size_total{port="port10",switch_name="FOO-SW-01",vdom="root"} 0 - fortigate_managed_switch_under_size_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 1 + fortigate_managed_switch_under_size_total{port="port11",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_under_size_total{port="port12",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_under_size_total{port="port13",switch_name="FOO-SW-01",vdom="root"} 0 fortigate_managed_switch_under_size_total{port="port14",switch_name="FOO-SW-01",vdom="root"} 0 @@ -832,3 +836,24 @@ func TestProbeManagedSwitch(t *testing.T) { } } + +// Use this to get the string output of all the metrics in the registry +func printMetrics(registry *prometheus.Registry) { + // Gather the metrics + metrics, err := registry.Gather() + if err != nil { + fmt.Println("Error gathering metrics:", err) + return + } + + // Create a new encoder + encoder := expfmt.NewEncoder(os.Stdout, expfmt.FmtText) + + // Encode the gathered metrics + for _, metricFamily := range metrics { + if err := encoder.Encode(metricFamily); err != nil { + fmt.Println("Error encoding metric family:", err) + return + } + } +} \ No newline at end of file diff --git a/pkg/probe/testdata/managed-switch-port-stats.jsonnet b/pkg/probe/testdata/managed-switch-port-stats.jsonnet new file mode 100644 index 00000000..f1f14bf4 --- /dev/null +++ b/pkg/probe/testdata/managed-switch-port-stats.jsonnet @@ -0,0 +1,719 @@ +# api/v2/monitor/switch-controller/managed-switch/port-stats?vdom=* + +[ + { + "http_method":"GET", + "results":[ + { + "serial":"S224ENTF220XXXX", + "switch-id":"FOO-SW-01", + "ports":{ + "port1":{ + "tx-bytes":1057457469, + "tx-packets":2352591, + "tx-ucast":1211352, + "tx-mcast":811352, + "tx-bcast":329887, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":505250508, + "rx-packets":1612797, + "rx-ucast":771739, + "rx-mcast":454590, + "rx-bcast":386468, + "rx-errors":0, + "rx-drops":4, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":166728 + }, + "port2":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port3":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port4":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port5":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port6":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port7":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port8":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port9":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":1, + "l3packets":0 + }, + "port10":{ + "tx-bytes":120054895, + "tx-packets":368615, + "tx-ucast":35, + "tx-mcast":270481, + "tx-bcast":98099, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":13952, + "rx-packets":218, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":218, + "rx-errors":0, + "rx-drops":5, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port11":{ + "tx-bytes":330262030, + "tx-packets":1283318, + "tx-ucast":795330, + "tx-mcast":269219, + "tx-bcast":218769, + "tx-errors":0, + "tx-drops":1, + "tx-oversize":0, + "rx-bytes":90023496, + "rx-packets":789978, + "rx-ucast":789977, + "rx-mcast":0, + "rx-bcast":1, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port12":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port13":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port14":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port15":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port16":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port17":{ + "tx-bytes":995087031, + "tx-packets":5659466, + "tx-ucast":4515159, + "tx-mcast":657839, + "tx-bcast":486468, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":332885670, + "rx-packets":670380, + "rx-ucast":642407, + "rx-mcast":27961, + "rx-bcast":12, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port18":{ + "tx-bytes":498405588, + "tx-packets":2626036, + "tx-ucast":1390868, + "tx-mcast":667598, + "tx-bcast":567570, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":1164988782, + "rx-packets":5099612, + "rx-ucast":5071623, + "rx-mcast":27971, + "rx-bcast":18, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port19":{ + "tx-bytes":356603008, + "tx-packets":1135396, + "tx-ucast":87561, + "tx-mcast":667600, + "tx-bcast":380235, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":7844701, + "rx-packets":35671, + "rx-ucast":831, + "rx-mcast":27973, + "rx-bcast":6867, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port20":{ + "tx-bytes":537463983, + "tx-packets":1437148, + "tx-ucast":405259, + "tx-mcast":667598, + "tx-bcast":364291, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":92797595, + "rx-packets":286308, + "rx-ucast":251446, + "rx-mcast":27973, + "rx-bcast":6889, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port21":{ + "tx-bytes":8244358564, + "tx-packets":10005028, + "tx-ucast":9288574, + "tx-mcast":315334, + "tx-bcast":401120, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":1248215979, + "rx-packets":7765340, + "rx-ucast":7708039, + "rx-mcast":56777, + "rx-bcast":524, + "rx-errors":0, + "rx-drops":32, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":3681687 + }, + "port22":{ + "tx-bytes":5925235826, + "tx-packets":8308575, + "tx-ucast":7591629, + "tx-mcast":315331, + "tx-bcast":401615, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":1283515639, + "rx-packets":7888974, + "rx-ucast":7832194, + "rx-mcast":56780, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":2451258 + }, + "port23":{ + "tx-bytes":2713564863, + "tx-packets":9317269, + "tx-ucast":8455552, + "tx-mcast":402472, + "tx-bcast":459245, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":1643049095, + "rx-packets":4450257, + "rx-ucast":3646275, + "rx-mcast":403979, + "rx-bcast":400003, + "rx-errors":0, + "rx-drops":1264621, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":9 + }, + "port24":{ + "tx-bytes":319096093, + "tx-packets":2203125, + "tx-ucast":1781877, + "tx-mcast":410227, + "tx-bcast":11021, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":1543093550, + "rx-packets":9964549, + "rx-ucast":9227104, + "rx-mcast":404022, + "rx-bcast":333423, + "rx-errors":0, + "rx-drops":410, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":5774658 + }, + "port25":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port26":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port27":{ + "tx-bytes":1695841429, + "tx-packets":6113198, + "tx-ucast":5745534, + "tx-mcast":114683, + "tx-bcast":252981, + "tx-errors":0, + "tx-drops":22, + "tx-oversize":0, + "rx-bytes":556071078, + "rx-packets":2121701, + "rx-ucast":2109650, + "rx-mcast":11494, + "rx-bcast":557, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port28":{ + "tx-bytes":0, + "tx-packets":0, + "tx-ucast":0, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":0, + "rx-packets":0, + "rx-ucast":0, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "internal":{ + "tx-bytes":4094254483, + "tx-packets":23838574, + "tx-ucast":23838574, + "tx-mcast":0, + "tx-bcast":0, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":3609650574, + "rx-packets":16097764, + "rx-ucast":16097764, + "rx-mcast":0, + "rx-bcast":0, + "rx-errors":0, + "rx-drops":0, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + } + } + }, + ], + "vdom":"root", + "path":"switch-controller", + "switch-id":"managed-switch", + "action":"port-stats", + "status":"success", + "serial":"FGT40FTK210XXXX", + "version":"v7.4.4", + "build":2662 + } +] \ No newline at end of file diff --git a/pkg/probe/testdata/managed-switch.jsonnet b/pkg/probe/testdata/managed-switch-status.jsonnet similarity index 99% rename from pkg/probe/testdata/managed-switch.jsonnet rename to pkg/probe/testdata/managed-switch-status.jsonnet index f2347dab..51e276a0 100644 --- a/pkg/probe/testdata/managed-switch.jsonnet +++ b/pkg/probe/testdata/managed-switch-status.jsonnet @@ -1,4 +1,4 @@ -# api/v2/monitor/switch-controller/managed-switch?vdom=* +# api/v2/monitor/switch-controller/managed-switch/status?vdom=* [ { "http_method":"GET", @@ -6,7 +6,7 @@ ], "vdom":"dhcp-relay", "path":"switch-controller", - "name":"managed-switch", + "switch-id":"managed-switch", "status":"success", "serial":"FGT40FTK210XXXX", "version":"v6.4.6", @@ -16,7 +16,7 @@ "http_method":"GET", "results":[ { - "name":"FOO-SW-01", + "switch-id":"FOO-SW-01", "serial":"S124EF5920010260", "fgt_peer_intf_name":"fortilink", "state":"Authorized", @@ -1325,7 +1325,7 @@ ], "vdom":"root", "path":"switch-controller", - "name":"managed-switch", + "switch-id":"managed-switch", "status":"success", "serial":"FGT40FTK210XXXX", "version":"v6.4.6",