diff --git a/README.md b/README.md index 2b843beb..19cf6eac 100755 --- a/README.md +++ b/README.md @@ -15,16 +15,16 @@ Prometheus exporter for FortiGate® firewalls. **NOTE:** This is not an official Fortinet product, it is developed fully independently by professionals and hobbyists alike. - * [Supported Metrics](#supported-metrics) - * [Usage](#usage) - + [Dynamic configuration](#dynamic-configuration) - + [Available CLI parameters](#available-cli-parameters) - + [Fortigate Configuration](#fortigate-configuration) - + [Prometheus Configuration](#prometheus-configuration) - + [Docker](#docker) - - [docker-compose](#docker-compose) - * [Known Issues](#known-issues) - * [Missing Metrics?](#missing-metrics) +* [Supported Metrics](#supported-metrics) +* [Usage](#usage) + * [Dynamic configuration](#dynamic-configuration) + * [Available CLI parameters](#available-cli-parameters) + * [Fortigate Configuration](#fortigate-configuration) + * [Prometheus Configuration](#prometheus-configuration) + * [Docker](#docker) + * [docker-compose](#docker-compose) +* [Known Issues](#known-issues) +* [Missing Metrics?](#missing-metrics) ## Supported Metrics @@ -37,207 +37,240 @@ Supported metrics right now as follows. Global: - * _System/SensorInfo_ - * `fortigate_sensor_fan_rpm` - * `fortigate_sensor_temperature_celsius` - * `fortigate_sensor_voltage_volts` - * _System/Status_ - * `fortigate_version_info` - * _System/Time/Clock_ - * `fortigate_time_seconds` - * _System/Resource/Usage_ - * `fortigate_cpu_usage_ratio` - * `fortigate_memory_usage_ratio` - * `fortigate_current_sessions` - * _System/HAChecksums_ - * `fortigate_ha_member_has_role` - * _License/Status_ - * `fortigate_license_vdom_usage` - * `fortigate_license_vdom_max` - * _WebUI/State_ - * `fortigate_last_reboot_seconds` - * `fortigate_last_snapshot_seconds` +* _System/SensorInfo_ + * `fortigate_sensor_fan_rpm` + * `fortigate_sensor_temperature_celsius` + * `fortigate_sensor_voltage_volts` +* _System/Status_ + * `fortigate_version_info` +* _System/Time/Clock_ + * `fortigate_time_seconds` +* _System/Resource/Usage_ + * `fortigate_cpu_usage_ratio` + * `fortigate_memory_usage_ratio` + * `fortigate_current_sessions` +* _System/HAChecksums_ + * `fortigate_ha_member_has_role` +* _License/Status_ + * `fortigate_license_vdom_usage` + * `fortigate_license_vdom_max` +* _WebUI/State_ + * `fortigate_last_reboot_seconds` + * `fortigate_last_snapshot_seconds` +* _SwitchController/ManageSwitch/PortStats_ + * `fortiswitch_status` + * `fortiswitch_port_status` + * `fortiswitch_port_speed_bps` + * `fortiswitch_port_transmit_packets_total` + * `fortiswitch_port_transmit_bytes_total` + * `fortiswitch_port_transmit_unicast_packets_total` + * `fortiswitch_port_transmit_multicast_packets_total` + * `fortiswitch_port_transmit_broadcast_packets_total` + * `fortiswitch_port_transmit_errors_total` + * `fortiswitch_port_transmit_drops_total` + * `fortiswitch_port_transmit_oversized_packets_total` + * `fortiswitch_port_receive_packets_total` + * `fortiswitch_port_receive_bytes_total` + * `fortiswitch_port_receive_unicast_packets_total` + * `fortiswitch_port_receive_multicast_packets_total` + * `fortiswitch_port_receive_broadcast_packets_total` + * `fortiswitch_port_receive_errors_total` + * `fortiswitch_port_receive_drops_total` + * `fortiswitch_port_receive_oversized_packets_total` +* _SwitchController/ManageSwitch/Health_ + * `fortiswitch_health_summary_cpu` + * `fortiswitch_health_summary_memory` + * `fortiswitch_health_summary_uptime` + * `fortiswitch_health_summary_temperature` + * `fortiswitch_health_temperature` + * `fortiswitch_health_performance_stats_cpu_user` + * `fortiswitch_health_performance_stats_cpu_system` + * `fortiswitch_health_performance_stats_cpu_idle` + * `fortiswitch_health_performance_stats_cpu_nice` +* TODO + * GET /switch-controller/managed-switch/port-health - Retrieve port health statistics for managed FortiSwitches. Per-VDOM: - * _System/VDOMResources_ - * `fortigate_vdom_cpu_usage_ratio` - * `fortigate_vdom_memory_usage_ratio` - * `fortigate_vdom_current_sessions` - * _Firewall/Policies_ - * `fortigate_policy_active_sessions` - * `fortigate_policy_bytes_total` - * `fortigate_policy_hit_count_total` - * `fortigate_policy_packets_total` - * _Firewall/IpPool_ - * `fortigate_ippool_available_ratio` - * `fortigate_ippool_used_ips` - * `fortigate_ippool_total_ips` - * `fortigate_ippool_clients` - * `fortigate_ippool_used_items` - * `fortigate_ippool_total_items` - * `fortigate_ippool_pba_per_ip` - * _System/Fortimanager/Status_ - * `fortigate_fortimanager_connection_status` - * `fortigate_fortimanager_registration_status` - * _System/Interface_ - * `fortigate_interface_link_up` - * `fortigate_interface_speed_bps` - * `fortigate_interface_transmit_packets_total` - * `fortigate_interface_receive_packets_total` - * `fortigate_interface_transmit_bytes_total` - * `fortigate_interface_receive_bytes_total` - * `fortigate_interface_transmit_errors_total` - * `fortigate_interface_receive_errors_total` - * _System/SDNConnector_ - * `fortigate_system_sdn_connector_status` - * `fortigate_system_sdn_connector_last_update_seconds` - * _User/Fsso_ - * `fortigate_user_fsso_info` - * _VPN/Ssl/Connections_ - * `fortigate_vpn_connections` - * `fortigate_vpn_users` - * _VPN/Ssl/Stats_ - * `fortigate_vpn_ssl_users` - * `fortigate_vpn_ssl_tunnels` - * `fortigate_vpn_ssl_connections` - * _VPN/IPSec_ - * `fortigate_ipsec_tunnel_receive_bytes_total` - * `fortigate_ipsec_tunnel_transmit_bytes_total` - * `fortigate_ipsec_tunnel_up` - * _Wifi/APStatus_ - * `fortigate_wifi_access_points` - * `fortigate_wifi_fabric_clients` - * `fortigate_wifi_fabric_max_allowed_clients` - * _Log/Fortianalyzer/Status_ - * `fortigate_log_fortianalyzer_registration_info` - * `fortigate_log_fortianalyzer_logs_received` - * _Log/Fortianalyzer/Queue_ - * `fortigate_log_fortianalyzer_queue_connections` - * `fortigate_log_fortianalyzer_queue_logs` - * _Log/DiskUsage_ - * `fortigate_log_disk_used_bytes` - * `fortigate_log_disk_total_bytes` - - Per-HA-Member and VDOM: - * _System/HAStatistics_ - * `fortigate_ha_member_info` - * `fortigate_ha_member_cpu_usage_ratio` - * `fortigate_ha_member_memory_usage_ratio` - * `fortigate_ha_member_network_usage_ratio` - * `fortigate_ha_member_sessions` - * `fortigate_ha_member_packets_total` - * `fortigate_ha_member_virus_events_total` - * `fortigate_ha_member_bytes_total` - * `fortigate_ha_member_ips_events_total` - - Per-Link and VDOM: - * _System/LinkMonitor_ - * `fortigate_link_status` - * `fortigate_link_latency_seconds` - * `fortigate_link_latency_jitter_seconds` - * `fortigate_link_packet_loss_ratio` - * `fortigate_link_packet_sent_total` - * `fortigate_link_packet_received_total` - * `fortigate_link_active_sessions` - * `fortigate_link_bandwidth_tx_byte_per_second` - * `fortigate_link_bandwidth_rx_byte_per_second` - * `fortigate_link_status_change_time_seconds` +* _System/VDOMResources_ + * `fortigate_vdom_cpu_usage_ratio` + * `fortigate_vdom_memory_usage_ratio` + * `fortigate_vdom_current_sessions` +* _Firewall/Policies_ + * `fortigate_policy_active_sessions` + * `fortigate_policy_bytes_total` + * `fortigate_policy_hit_count_total` + * `fortigate_policy_packets_total` +* _System/Fortimanager/Status_ + * `fortigate_fortimanager_connection_status` + * `fortigate_fortimanager_registration_status` +* _System/Interface_ + * `fortigate_interface_link_up` + * `fortigate_interface_speed_bps` + * `fortigate_interface_transmit_packets_total` + * `fortigate_interface_receive_packets_total` + * `fortigate_interface_transmit_bytes_total` + * `fortigate_interface_receive_bytes_total` + * `fortigate_interface_transmit_errors_total` + * `fortigate_interface_receive_errors_total` +* _System/SDNConnector_ + * `fortigate_system_sdn_connector_status` + * `fortigate_system_sdn_connector_last_update_seconds` +* _User/Fsso_ + * `fortigate_user_fsso_info` +* _VPN/Ssl/Connections_ + * `fortigate_vpn_connections` + * `fortigate_vpn_users` +* _VPN/Ssl/Stats_ + * `fortigate_vpn_ssl_users` + * `fortigate_vpn_ssl_tunnels` + * `fortigate_vpn_ssl_connections` +* _VPN/IPSec_ + * `fortigate_ipsec_tunnel_receive_bytes_total` + * `fortigate_ipsec_tunnel_transmit_bytes_total` + * `fortigate_ipsec_tunnel_up` +* _Wifi/APStatus_ + * `fortigate_wifi_access_points` + * `fortigate_wifi_fabric_clients` + * `fortigate_wifi_fabric_max_allowed_clients` +* _Log/Fortianalyzer/Status_ + * `fortigate_log_fortianalyzer_registration_info` + * `fortigate_log_fortianalyzer_logs_received` +* _Log/Fortianalyzer/Queue_ + * `fortigate_log_fortianalyzer_queue_connections` + * `fortigate_log_fortianalyzer_queue_logs` +* _Log/DiskUsage_ + * `fortigate_log_disk_used_bytes` + * `fortigate_log_disk_total_bytes` + +Per-HA-Member and VDOM: + +* _System/HAStatistics_ + * `fortigate_ha_member_info` + * `fortigate_ha_member_cpu_usage_ratio` + * `fortigate_ha_member_memory_usage_ratio` + * `fortigate_ha_member_network_usage_ratio` + * `fortigate_ha_member_sessions` + * `fortigate_ha_member_packets_total` + * `fortigate_ha_member_virus_events_total` + * `fortigate_ha_member_bytes_total` + * `fortigate_ha_member_ips_events_total` + +Per-Link and VDOM: + +* _System/LinkMonitor_ + * `fortigate_link_status` + * `fortigate_link_latency_seconds` + * `fortigate_link_latency_jitter_seconds` + * `fortigate_link_packet_loss_ratio` + * `fortigate_link_packet_sent_total` + * `fortigate_link_packet_received_total` + * `fortigate_link_active_sessions` + * `fortigate_link_bandwidth_tx_byte_per_second` + * `fortigate_link_bandwidth_rx_byte_per_second` + * `fortigate_link_status_change_time_seconds` Per-SDWAN and VDOM: - * _VirtualWAN/HealthCheck_ - * `fortigate_virtual_wan_status` - * `fortigate_virtual_wan_latency_seconds` - * `fortigate_virtual_wan_latency_jitter_seconds` - * `fortigate_virtual_wan_packet_loss_ratio` - * `fortigate_virtual_wan_packet_sent_total` - * `fortigate_virtual_wan_packet_received_total` - * `fortigate_virtual_wan_active_sessions` - * `fortigate_virtual_wan_bandwidth_tx_byte_per_second` - * `fortigate_virtual_wan_bandwidth_rx_byte_per_second` - * `fortigate_virtual_wan_status_change_time_seconds` - - Per-BGP-Neighbor and VDOM: - * _BGP/Neighbors/IPv4_ - * `fortigate_bgp_neighbor_ipv4_info` - * _BGP/Neighbors/IPv6_ - * `fortigate_bgp_neighbor_ipv6_info` - * _BGP/NeighborPaths/IPv4_ - * `fortigate_bgp_neighbor_ipv4_paths` - * `fortigate_bgp_neighbor_ipv4_best_paths` - * _BGP/NeighborPaths/IPv6_ - * `fortigate_bgp_neighbor_ipv6_paths` - * `fortigate_bgp_neighbor_ipv6_best_paths` - - Per-OSPF-Neighbor and VDOM: - * _OSPF/Neighbors_ - * `fortigate_ospf_neighbor_info` - - Per-VirtualServer and VDOM: - * _Firewall/LoadBalance_ - * `fortigate_lb_virtual_server_info` - - Per-RealServer for each VirtualServer and VDOM: - * _Firewall/LoadBalance_ - * `fortigate_lb_real_server_info` - * `fortigate_lb_real_server_mode` - * `fortigate_lb_real_server_status` - * `fortigate_lb_real_server_active_sessions` - * `fortigate_lb_real_server_rtt_seconds` - * `fortigate_lb_real_server_processed_bytes_total` - - Per-Certificate: - * _System/AvailableCertificates_ - * `fortigate_certificate_info` - * `fortigate_certificate_valid_from_seconds` - * `fortigate_certificate_valid_to_seconds` - * `fortigate_certificate_cmdb_references` + +* _VirtualWAN/HealthCheck_ + * `fortigate_virtual_wan_status` + * `fortigate_virtual_wan_latency_seconds` + * `fortigate_virtual_wan_latency_jitter_seconds` + * `fortigate_virtual_wan_packet_loss_ratio` + * `fortigate_virtual_wan_packet_sent_total` + * `fortigate_virtual_wan_packet_received_total` + * `fortigate_virtual_wan_active_sessions` + * `fortigate_virtual_wan_bandwidth_tx_byte_per_second` + * `fortigate_virtual_wan_bandwidth_rx_byte_per_second` + * `fortigate_virtual_wan_status_change_time_seconds` + +Per-BGP-Neighbor and VDOM: + +* _BGP/Neighbors/IPv4_ + * `fortigate_bgp_neighbor_ipv4_info` +* _BGP/Neighbors/IPv6_ + * `fortigate_bgp_neighbor_ipv6_info` +* _BGP/NeighborPaths/IPv4_ + * `fortigate_bgp_neighbor_ipv4_paths` + * `fortigate_bgp_neighbor_ipv4_best_paths` +* _BGP/NeighborPaths/IPv6_ + * `fortigate_bgp_neighbor_ipv6_paths` + * `fortigate_bgp_neighbor_ipv6_best_paths` + +Per-VirtualServer and VDOM: + +* _Firewall/LoadBalance_ + * `fortigate_lb_virtual_server_info` + +Per-RealServer for each VirtualServer and VDOM: + +* _Firewall/LoadBalance_ + * `fortigate_lb_real_server_info` + * `fortigate_lb_real_server_mode` + * `fortigate_lb_real_server_status` + * `fortigate_lb_real_server_active_sessions` + * `fortigate_lb_real_server_rtt_seconds` + * `fortigate_lb_real_server_processed_bytes_total` + +Per-Certificate: + +* _System/AvailableCertificates_ + * `fortigate_certificate_info` + * `fortigate_certificate_valid_from_seconds` + * `fortigate_certificate_valid_to_seconds` + * `fortigate_certificate_cmdb_references` + Per-VDOM and Wifi-Client: - * _Wifi/Clients_ - * `fortigate_wifi_client_info` - * `fortigate_wifi_client_data_rate_bps` - * `fortigate_wifi_client_bandwidth_rx_bps` - * `fortigate_wifi_client_bandwidth_tx_bps` - * `fortigate_wifi_client_signal_strength_dBm` - * `fortigate_wifi_client_signal_noise_dBm` - * `fortigate_wifi_client_tx_discard_ratio` - * `fortigate_wifi_client_tx_retries_ratio` + +* _Wifi/Clients_ + * `fortigate_wifi_client_info` + * `fortigate_wifi_client_data_rate_bps` + * `fortigate_wifi_client_bandwidth_rx_bps` + * `fortigate_wifi_client_bandwidth_tx_bps` + * `fortigate_wifi_client_signal_strength_dBm` + * `fortigate_wifi_client_signal_noise_dBm` + * `fortigate_wifi_client_tx_discard_ratio` + * `fortigate_wifi_client_tx_retries_ratio` Per-VDOM and managed access point: - * _Wifi/ManagedAP_ - * `fortigate_wifi_managed_ap_info` - * `fortigate_wifi_managed_ap_join_time_seconds` - * `fortigate_wifi_managed_ap_cpu_usage_ratio` - * `fortigate_wifi_managed_ap_memory_free_bytes` - * `fortigate_wifi_managed_ap_memory_bytes_total` + +* _Wifi/ManagedAP_ + * `fortigate_wifi_managed_ap_info` + * `fortigate_wifi_managed_ap_join_time_seconds` + * `fortigate_wifi_managed_ap_cpu_usage_ratio` + * `fortigate_wifi_managed_ap_memory_free_bytes` + * `fortigate_wifi_managed_ap_memory_bytes_total` Per-VDOM, managed access point and radio: - * _Wifi/ManagedAP_ - * `fortigate_wifi_managed_ap_radio_info` - * `fortigate_wifi_managed_ap_radio_client_count` - * `fortigate_wifi_managed_ap_radio_operating_tx_power_ratio` - * `fortigate_wifi_managed_ap_radio_operating_channel_utilization_ratio` - * `fortigate_wifi_managed_ap_radio_bandwidth_rx_bps` - * `fortigate_wifi_managed_ap_radio_rx_bytes_total` - * `fortigate_wifi_managed_ap_radio_tx_bytes_total` - * `fortigate_wifi_managed_ap_radio_interfering_aps` - * `fortigate_wifi_managed_ap_radio_tx_power_ratio` - * `fortigate_wifi_managed_ap_radio_tx_discard_ratio` - * `fortigate_wifi_managed_ap_radio_tx_retries_ratio` + +* _Wifi/ManagedAP_ + * `fortigate_wifi_managed_ap_radio_info` + * `fortigate_wifi_managed_ap_radio_client_count` + * `fortigate_wifi_managed_ap_radio_operating_tx_power_ratio` + * `fortigate_wifi_managed_ap_radio_operating_channel_utilization_ratio` + * `fortigate_wifi_managed_ap_radio_bandwidth_rx_bps` + * `fortigate_wifi_managed_ap_radio_rx_bytes_total` + * `fortigate_wifi_managed_ap_radio_tx_bytes_total` + * `fortigate_wifi_managed_ap_radio_interfering_aps` + * `fortigate_wifi_managed_ap_radio_tx_power_ratio` + * `fortigate_wifi_managed_ap_radio_tx_discard_ratio` + * `fortigate_wifi_managed_ap_radio_tx_retries_ratio` Per-VDOM, managed access point and interface: - * _Wifi/ManagedAP_ - * `fortigate_wifi_managed_ap_interface_rx_bytes_total` - * `fortigate_wifi_managed_ap_interface_tx_bytes_total` - * `fortigate_wifi_managed_ap_interface_rx_packets_total` - * `fortigate_wifi_managed_ap_interface_tx_packets_total` - * `fortigate_wifi_managed_ap_interface_rx_errors_total` - * `fortigate_wifi_managed_ap_interface_tx_errors_total` - * `fortigate_wifi_managed_ap_interface_rx_dropped_packets_total` - * `fortigate_wifi_managed_ap_interface_tx_dropped_packets_total` + +* _Wifi/ManagedAP_ + * `fortigate_wifi_managed_ap_interface_rx_bytes_total` + * `fortigate_wifi_managed_ap_interface_tx_bytes_total` + * `fortigate_wifi_managed_ap_interface_rx_packets_total` + * `fortigate_wifi_managed_ap_interface_tx_packets_total` + * `fortigate_wifi_managed_ap_interface_rx_errors_total` + * `fortigate_wifi_managed_ap_interface_tx_errors_total` + * `fortigate_wifi_managed_ap_interface_rx_dropped_packets_total` + * `fortigate_wifi_managed_ap_interface_tx_dropped_packets_total` Per-VDOM, managed switch and interface: + * _Switch/ManagedSwitch_ * `fortigate_managed_switch_collisions_total` * `fortigate_managed_switch_crc_alignments_total` @@ -267,12 +300,12 @@ Per-VDOM, managed switch and interface: * `fortigate_managed_switch_tx_packets_total` * `fortigate_managed_switch_tx_ucast_packets_total` * `fortigate_managed_switch_under_size_total` - + ## Usage Example: -``` +```bash $ ./fortigate_exporter -auth-file ~/fortigate-key.yaml # or $ docker run -d -p 9710:9710 -v /path/to/fortigate-key.yaml:/config/fortigate-key.yaml quay.io/prometheuscommunity/fortigate_exporter:master @@ -280,7 +313,7 @@ $ docker run -d -p 9710:9710 -v /path/to/fortigate-key.yaml:/config/fortigate-ke Where `fortigate-key.yaml` contains pairs of FortiGate targets and API keys in the following format: -``` +```yaml "https://my-fortigate": token: api-key-goes-here # If you have a smaller fortigate unit you might want @@ -298,15 +331,15 @@ which means that currently you need HTTPS to be configured properly. You can select which probes you want to run on a per target basis. -- Probes can be included or excluded under the optional `probes` section by defining `include` and/or `exclude` lists. -- Each probe name, that can be run by the fortigate exporter, is compared to the `include`/`exclude` lists. -- Inclusion/exclusion of a probe is based on a prefix match, therefore lists must contains entries starting with a probe name to be included/excluded. -- Prefix match is case sensitive. -- `include` list is evaluated before `exclude` list, therefore `exclude` list can exclude a previously included probe. +* Probes can be included or excluded under the optional `probes` section by defining `include` and/or `exclude` lists. +* Each probe name, that can be run by the fortigate exporter, is compared to the `include`/`exclude` lists. +* Inclusion/exclusion of a probe is based on a prefix match, therefore lists must contains entries starting with a probe name to be included/excluded. +* Prefix match is case sensitive. +* `include` list is evaluated before `exclude` list, therefore `exclude` list can exclude a previously included probe. Example: -``` +```yaml "https://my-fortigate": token: api-key-goes-here probes: @@ -347,28 +380,34 @@ Special cases: To probe a FortiGate, do something like `curl 'localhost:9710/probe?target=https://my-fortigate'` ### Dynamic configuration + In use cases where the Fortigates that is to be scraped through the fortigate-exporter is configured in Prometheus using some discovery method it becomes problematic that the `fortigate-key.yaml` configuration also has to be updated for each fortigate, and that the fortigate-exporter needs to be restarted on each change. For that scenario the token can be passed as a query parameter, `token`, to the fortigate. Example: + ```bash curl 'localhost:9710/probe?target=https://192.168.2.31&token=ghi6eItWzWewgbrFMsazvBVwDjZzzb' ``` + It is also possible to pass a `profile` query parameter. The value will match an entry in the `fortigate-key.yaml` file, but only to use the `probes` section for include/exclude directives. Example: + ```bash curl 'localhost:9710/probe?target=https://192.168.2.31&token=ghi6eItWzWewgbrFMsazvBVwDjZzzb&profile=fs124e' ``` + The `profile=fs124e` would match the following entry in `fortigate-key.yaml`. Example: + ```yaml fs124e: - # token: not used + # token: not used probes: include: - System @@ -421,6 +460,8 @@ To improve security, limit permissions to required ones only (least privilege pr |System/Status | *any* |api/v2/monitor/system/status | |System/Time/Clock | sysgrp.cfg |api/v2/monitor/system/time | |System/VDOMResources | sysgrp.cfg |api/v2/monitor/system/resource/usage | +|SwitchController/ManageSwitch/PortStats | |api/v2/monitor/switch-controller/managed-switch?port_stats=true replaced from fortiOS 7.0 to api/v2/monitor/switch-controller/managed-switch/status and managed-switch/port-stats| +|SwitchController/ManageSwitch/Health | |api/v2/monitor/switch-controller/managed-switch/health replace from fortiOS 7.6 to api/v2/monitor/switch-controller/managed-switch/health-status | |User/Fsso | authgrp |api/v2/monitor/user/fsso | |VPN/IPSec | vpngrp |api/v2/monitor/vpn/ipsec | |VPN/Ssl/Connections | vpngrp |api/v2/monitor/vpn/ssl | @@ -430,6 +471,7 @@ To improve security, limit permissions to required ones only (least privilege pr |Wifi/Clients | wifi |api/v2/monitor/wifi/client | |Wifi/ManagedAP | wifi |api/v2/monitor/wifi/managed_ap | |Switch/ManagedSwitch | switch |api/v2/monitor/switch-controller/managed-switch| + If you omit to grant some of these permissions you will receive log messages warning about 403 errors and relevant metrics will be unavailable, but other metrics will still work. If you do not need some probes to be run, do not grant permission for them and use `include/exclude` feature (see `Usage` section). @@ -437,7 +479,7 @@ If you do not need some probes to be run, do not grant permission for them and u The following example Admin Profile describes the permissions that needs to be granted to the monitor user in order for all metrics to be available. -``` +```yaml config system accprofile edit "monitor" # global scope will fail on non multi-VDOM firewall @@ -492,8 +534,10 @@ An example configuration for Prometheus looks something like this: - target_label: __address__ replacement: '[::1]:9710' ``` +In above configuration only the targets and the replacement values needs to be changed as per your environment. Where target is URL of the Fortigate firewall and the replacement (at the bottom) will be the FQDN of system where the node exporter is running, example ```replacement: 'YourSystem.public.corp.com:9710'``` If using [Dynamic configuration](#dynamic-configuration): + ```yaml - job_name: 'fortigate_exporter' metrics_path: /probe @@ -516,12 +560,12 @@ If using [Dynamic configuration](#dynamic-configuration): - action: labeldrop regex: token ``` -> Make sure to use the last labeldrop on the `token` label so that the tokens is not be part of your time series. +> Make sure to use the last labeldrop on the `token` label so that the tokens is not be part of your time series. > Since `token` is a label it will be shown in the Prometheus webgui at `http://:9090/targets`. -> +> > **Make sure you protect your Prometheus if you add the token part of your prometheus config** -> +> > Some options to protect Prometheus: > - Only expose UI to localhost --web.listen-address="127.0.0.1:9090" > - Basic authentication access - https://prometheus.io/docs/guides/basic-auth/ @@ -557,7 +601,7 @@ prometheus_fortigate_exporter: This is a collection of known issues that for some reason cannot be fixed, but might be possible to work around. - * Probing causing [httpsd memory leak in FortiOS 6.2.x](https://github.com/prometheus-community/fortigate_exporter/issues/62) ([Workaround](https://github.com/prometheus-community/fortigate_exporter/issues/62#issuecomment-798602061)) +* Probing causing [httpsd memory leak in FortiOS 6.2.x](https://github.com/bluecmd/fortigate_exporter/issues/62) ([Workaround](https://github.com/bluecmd/fortigate_exporter/issues/62#issuecomment-798602061)) ## Missing Metrics? diff --git a/pkg/probe/fortiswitch_health.go b/pkg/probe/fortiswitch_health.go new file mode 100644 index 00000000..e66afb96 --- /dev/null +++ b/pkg/probe/fortiswitch_health.go @@ -0,0 +1,197 @@ +// Copyright 2025 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package probe + +import ( + "fmt" + "log" + + "github.com/prometheus-community/fortigate_exporter/pkg/http" + "github.com/prometheus/client_golang/prometheus" +) + +func probeSwitchHealth(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) { + var ( + mSumCPU = prometheus.NewDesc( + "fortiswitch_health_summary_cpu", + "Boolean indicator if CPU health is good", + []string{"value", "rating", "fortiswitch", "vdom"}, nil, + ) + mSumMem = prometheus.NewDesc( + "fortiswitch_health_summary_memory", + "Boolean indicator if Memory health is good", + []string{"value", "rating", "fortiswitch", "vdom"}, nil, + ) + mSumUpTime = prometheus.NewDesc( + "fortiswitch_health_summary_uptime", + "Boolean indicator if Uptime is good", + []string{"value", "rating", "fortiswitch", "vdom"}, nil, + ) + mSumTemp = prometheus.NewDesc( + "fortiswitch_health_summary_temperature", + "Boolean indicator if Temperature health is good", + []string{"value", "rating", "fortiswitch", "vdom"}, nil, + ) + mTemp = prometheus.NewDesc( + "fortiswitch_health_temperature", + "Temperature per switch sensor", + []string{"unit", "module", "fortiswitch", "vdom"}, nil, + ) + mCpuUser = prometheus.NewDesc( + "fortiswitch_health_performance_stats_cpu_user", + "Fortiswitch CPU user usage", + []string{"unit", "fortiswitch", "vdom"}, nil, + ) + mCpuSystem = prometheus.NewDesc( + "fortiswitch_health_performance_stats_cpu_system", + "Fortiswitch CPU system usage", + []string{"unit", "fortiswitch", "vdom"}, nil, + ) + mCpuIdle = prometheus.NewDesc( + "fortiswitch_health_performance_stats_cpu_idle", + "Fortiswitch CPU idle", + []string{"unit", "fortiswitch", "vdom"}, nil, + ) + mCpuNice = prometheus.NewDesc( + "fortiswitch_health_performance_stats_cpu_nice", + "Fortiswitch CPU nice usage", + []string{"unit", "fortiswitch", "vdom"}, nil, + ) + ) + type Sum struct { + Value float64 `json:"value"` + Rating string `json:"rating"` + } + type Status struct { + Value float64 `json:"value"` + Unit string `json:"unit"` + } + type Uptime struct { + Days Status `json:"days"` + Hours Status `json:"hours"` + Minutes Status `json:"minutes"` + } + type Network struct { + In1Min Status `json:"in-1min"` + In10Min Status `json:"in-10min"` + In30Min Status `json:"in-30min"` + } + type Memory struct { + Used Status `json:"used"` + } + type CPU struct { + User Status `json:"user"` + System Status `json:"system"` + Nice Status `json:"nice"` + Idle Status `json:"idle"` + } + type PerformanceStatus struct { + CPU CPU `json:"cpu"` + Memory Memory `json:"memory"` + Network Network `json:"network"` + Uptime Uptime `json:"uptime"` + } + type Temperature struct { + Module string + Status Status + } + type Summary struct { + Overall string `json:"overall"` + CPU Sum + Memory Sum + Uptime Sum + Temperature Sum + } + type Poe struct { + Value float64 `json:"value"` + MaxValue float64 `json:"max_value"` + Unit string `json:"unit"` + } + type Results struct { + PerformanceStatus PerformanceStatus `json:"performance-status"` + Temperature []Temperature `json:"temperature"` + Summary Summary `json:"summary"` + Poe Poe `json:"poe"` + } + + type swResponse struct { + Results map[string]Results `json:"results"` + Vdom string + } + + var apiPath string + + if meta.VersionMajor > 7 || (meta.VersionMajor == 7 && meta.VersionMinor >= 6) { + apiPath = "api/v2/monitor/switch-controller/managed-switch/health-status" + } else { + apiPath = "api/v2/monitor/switch-controller/managed-switch/health" + } + + var r swResponse + + if err := c.Get(apiPath, "vdom=root", &r); err != nil { + log.Printf("Error: %v", err) + return nil, false + } + + m := []prometheus.Metric{} + + for fswitch, hr := range r.Results { + + var cpuGood float64 + if hr.Summary.CPU.Rating == "good" { + cpuGood = 1 + } else { + cpuGood = 0 + } + m = append(m, prometheus.MustNewConstMetric(mSumCPU, prometheus.GaugeValue, cpuGood, fmt.Sprintf("%.0f", hr.Summary.CPU.Value), hr.Summary.CPU.Rating, fswitch, r.Vdom)) + + var memGood float64 + if hr.Summary.Memory.Rating == "good" { + memGood = 1 + } else { + memGood = 0 + } + m = append(m, prometheus.MustNewConstMetric(mSumMem, prometheus.GaugeValue, memGood, fmt.Sprintf("%0.f", hr.Summary.Memory.Value), hr.Summary.Memory.Rating, fswitch, r.Vdom)) + + var uptimeGood float64 + if hr.Summary.Uptime.Rating == "good" { + uptimeGood = 1 + } else { + uptimeGood = 0 + } + m = append(m, prometheus.MustNewConstMetric(mSumUpTime, prometheus.GaugeValue, uptimeGood, fmt.Sprintf("%0.f", hr.Summary.Uptime.Value), hr.Summary.Uptime.Rating, fswitch, r.Vdom)) + + var tempGood float64 + if hr.Summary.Temperature.Rating == "good" { + tempGood = 1 + } else { + tempGood = 0 + } + m = append(m, prometheus.MustNewConstMetric(mSumTemp, prometheus.GaugeValue, tempGood, fmt.Sprintf("%0.f", hr.Summary.Temperature.Value), hr.Summary.Temperature.Rating, fswitch, r.Vdom)) + + for _, ts := range hr.Temperature { + m = append(m, prometheus.MustNewConstMetric(mTemp, prometheus.GaugeValue, ts.Status.Value, ts.Status.Unit, ts.Module, fswitch, r.Vdom)) + } + + CpuUnit := hr.PerformanceStatus.CPU.System.Unit + + m = append(m, prometheus.MustNewConstMetric(mCpuUser, prometheus.GaugeValue, hr.PerformanceStatus.CPU.User.Value, CpuUnit, fswitch, r.Vdom)) + m = append(m, prometheus.MustNewConstMetric(mCpuNice, prometheus.GaugeValue, hr.PerformanceStatus.CPU.Nice.Value, CpuUnit, fswitch, r.Vdom)) + m = append(m, prometheus.MustNewConstMetric(mCpuSystem, prometheus.GaugeValue, hr.PerformanceStatus.CPU.System.Value, CpuUnit, fswitch, r.Vdom)) + m = append(m, prometheus.MustNewConstMetric(mCpuIdle, prometheus.GaugeValue, hr.PerformanceStatus.CPU.Idle.Value, CpuUnit, fswitch, r.Vdom)) + } + + return m, true +} diff --git a/pkg/probe/fortiswitch_health_test.go b/pkg/probe/fortiswitch_health_test.go new file mode 100644 index 00000000..68f598c2 --- /dev/null +++ b/pkg/probe/fortiswitch_health_test.go @@ -0,0 +1,103 @@ +// Copyright 2025 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package probe + +import ( + "strings" + "testing" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/testutil" +) + +func TestSwitchHealth(t *testing.T) { + c := newFakeClient() + c.prepare("api/v2/monitor/switch-controller/managed-switch/health", "testdata/fsw-health.jsonnet") + r := prometheus.NewPedanticRegistry() + if !testProbe(probeSwitchHealth, c, r) { + t.Errorf("probeSwitchHealth() returned non-success") + } + + em := ` + # HELP fortiswitch_health_performance_stats_cpu_idle Fortiswitch CPU idle + # TYPE fortiswitch_health_performance_stats_cpu_idle gauge + fortiswitch_health_performance_stats_cpu_idle{fortiswitch="FS00000000000024",unit="%%",vdom="root"} 100 + fortiswitch_health_performance_stats_cpu_idle{fortiswitch="FS00000000000027",unit="%%",vdom="root"} 100 + fortiswitch_health_performance_stats_cpu_idle{fortiswitch="FS00000000000030",unit="%%",vdom="root"} 100 + fortiswitch_health_performance_stats_cpu_idle{fortiswitch="FS00000000000038",unit="%%",vdom="root"} 100 + # HELP fortiswitch_health_performance_stats_cpu_nice Fortiswitch CPU nice usage + # TYPE fortiswitch_health_performance_stats_cpu_nice gauge + fortiswitch_health_performance_stats_cpu_nice{fortiswitch="FS00000000000024",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_nice{fortiswitch="FS00000000000027",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_nice{fortiswitch="FS00000000000030",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_nice{fortiswitch="FS00000000000038",unit="%%",vdom="root"} 0 + # HELP fortiswitch_health_performance_stats_cpu_system Fortiswitch CPU system usage + # TYPE fortiswitch_health_performance_stats_cpu_system gauge + fortiswitch_health_performance_stats_cpu_system{fortiswitch="FS00000000000024",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_system{fortiswitch="FS00000000000027",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_system{fortiswitch="FS00000000000030",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_system{fortiswitch="FS00000000000038",unit="%%",vdom="root"} 0 + # HELP fortiswitch_health_performance_stats_cpu_user Fortiswitch CPU user usage + # TYPE fortiswitch_health_performance_stats_cpu_user gauge + fortiswitch_health_performance_stats_cpu_user{fortiswitch="FS00000000000024",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_user{fortiswitch="FS00000000000027",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_user{fortiswitch="FS00000000000030",unit="%%",vdom="root"} 0 + fortiswitch_health_performance_stats_cpu_user{fortiswitch="FS00000000000038",unit="%%",vdom="root"} 0 + # HELP fortiswitch_health_summary_cpu Boolean indicator if CPU health is good + # TYPE fortiswitch_health_summary_cpu gauge + fortiswitch_health_summary_cpu{fortiswitch="FS00000000000024",rating="good",value="0",vdom="root"} 1 + fortiswitch_health_summary_cpu{fortiswitch="FS00000000000027",rating="good",value="0",vdom="root"} 1 + fortiswitch_health_summary_cpu{fortiswitch="FS00000000000030",rating="good",value="0",vdom="root"} 1 + fortiswitch_health_summary_cpu{fortiswitch="FS00000000000038",rating="good",value="0",vdom="root"} 1 + # HELP fortiswitch_health_summary_memory Boolean indicator if Memory health is good + # TYPE fortiswitch_health_summary_memory gauge + fortiswitch_health_summary_memory{fortiswitch="FS00000000000024",rating="good",value="10",vdom="root"} 1 + fortiswitch_health_summary_memory{fortiswitch="FS00000000000027",rating="good",value="15",vdom="root"} 1 + fortiswitch_health_summary_memory{fortiswitch="FS00000000000030",rating="good",value="50",vdom="root"} 1 + fortiswitch_health_summary_memory{fortiswitch="FS00000000000038",rating="good",value="32",vdom="root"} 1 + # HELP fortiswitch_health_summary_temperature Boolean indicator if Temperature health is good + # TYPE fortiswitch_health_summary_temperature gauge + fortiswitch_health_summary_temperature{fortiswitch="FS00000000000024",rating="good",value="49",vdom="root"} 1 + fortiswitch_health_summary_temperature{fortiswitch="FS00000000000027",rating="good",value="46",vdom="root"} 1 + fortiswitch_health_summary_temperature{fortiswitch="FS00000000000030",rating="good",value="40",vdom="root"} 1 + fortiswitch_health_summary_temperature{fortiswitch="FS00000000000038",rating="good",value="42",vdom="root"} 1 + # HELP fortiswitch_health_summary_uptime Boolean indicator if Uptime is good + # TYPE fortiswitch_health_summary_uptime gauge + fortiswitch_health_summary_uptime{fortiswitch="FS00000000000024",rating="good",value="39289680",vdom="root"} 1 + fortiswitch_health_summary_uptime{fortiswitch="FS00000000000027",rating="good",value="39289740",vdom="root"} 1 + fortiswitch_health_summary_uptime{fortiswitch="FS00000000000030",rating="good",value="26612880",vdom="root"} 1 + fortiswitch_health_summary_uptime{fortiswitch="FS00000000000038",rating="good",value="26612580",vdom="root"} 1 + # HELP fortiswitch_health_temperature Temperature per switch sensor + # TYPE fortiswitch_health_temperature gauge + fortiswitch_health_temperature{fortiswitch="FS00000000000024",module="sensor1(CPU Board Temp)",unit="celsius",vdom="root"} 41.937 + fortiswitch_health_temperature{fortiswitch="FS00000000000024",module="sensor2(MAIN Board Temp1)",unit="celsius",vdom="root"} 63.875 + fortiswitch_health_temperature{fortiswitch="FS00000000000024",module="sensor3(MAIN Board Temp2)",unit="celsius",vdom="root"} 51.312 + fortiswitch_health_temperature{fortiswitch="FS00000000000024",module="sensor4(MAIN Board Temp3)",unit="celsius",vdom="root"} 38.687 + fortiswitch_health_temperature{fortiswitch="FS00000000000027",module="sensor1(CPU Board Temp)",unit="celsius",vdom="root"} 39 + fortiswitch_health_temperature{fortiswitch="FS00000000000027",module="sensor2(MAIN Board Temp1)",unit="celsius",vdom="root"} 60.625 + fortiswitch_health_temperature{fortiswitch="FS00000000000027",module="sensor3(MAIN Board Temp2)",unit="celsius",vdom="root"} 48.937 + fortiswitch_health_temperature{fortiswitch="FS00000000000027",module="sensor4(MAIN Board Temp3)",unit="celsius",vdom="root"} 36.062 + fortiswitch_health_temperature{fortiswitch="FS00000000000030",module="sensor1(CPU Board Temp)",unit="celsius",vdom="root"} 33.875 + fortiswitch_health_temperature{fortiswitch="FS00000000000030",module="sensor2(MAIN Board Temp1)",unit="celsius",vdom="root"} 53.75 + fortiswitch_health_temperature{fortiswitch="FS00000000000030",module="sensor3(MAIN Board Temp2)",unit="celsius",vdom="root"} 41 + fortiswitch_health_temperature{fortiswitch="FS00000000000030",module="sensor4(MAIN Board Temp3)",unit="celsius",vdom="root"} 30.25 + fortiswitch_health_temperature{fortiswitch="FS00000000000038",module="sensor1(CPU Board Temp)",unit="celsius",vdom="root"} 35.437 + fortiswitch_health_temperature{fortiswitch="FS00000000000038",module="sensor2(MAIN Board Temp1)",unit="celsius",vdom="root"} 55.625 + fortiswitch_health_temperature{fortiswitch="FS00000000000038",module="sensor3(MAIN Board Temp2)",unit="celsius",vdom="root"} 43.125 + fortiswitch_health_temperature{fortiswitch="FS00000000000038",module="sensor4(MAIN Board Temp3)",unit="celsius",vdom="root"} 32.312 + ` + if err := testutil.GatherAndCompare(r, strings.NewReader(em)); err != nil { + t.Fatalf("metric compare: err %v", err) + } +} diff --git a/pkg/probe/fortiswitch_port_stats.go b/pkg/probe/fortiswitch_port_stats.go new file mode 100644 index 00000000..1054e25d --- /dev/null +++ b/pkg/probe/fortiswitch_port_stats.go @@ -0,0 +1,299 @@ +// Copyright 2025 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package probe + +import ( + "fmt" + "github.com/prometheus-community/fortigate_exporter/pkg/http" + "github.com/prometheus/client_golang/prometheus" + "log" +) + +func probeSwitchPortStats(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) { + var ( + mSwitchStatus = prometheus.NewDesc( + "fortiswitch_status", + `Whether the switch is connected or not +# fgt_peer_intf_name = FortiLink interface that the FortiSwitch is connected to +# connection_from = FortiSwitch port that is connected to the FortiLink interface`, + []string{"vdom", "name", "serial_number", "fgt_peer_intf_name", "connection_from", "state"}, nil, + ) + mPortStatus = prometheus.NewDesc( + "fortiswitch_port_status", + "Whether the switch port is up or not", + []string{"vdom", "name", "serial_number", "interface", "vlan", "duplex"}, nil, + ) + mPortSpeed = prometheus.NewDesc( + "fortiswitch_port_speed_bps", + "Speed negotiated on the interface in bits/s", + []string{"vdom", "name", "serial_number", "interface", "vlan", "duplex"}, nil, + ) + mPortDuplex = prometheus.NewDesc( + "fortiswitch_port_duplex_status", + "Duplex status of the FortiSwitch port", + []string{"vdom", "name", "serial_number", "interface", "vlan", "duplex"}, nil, + ) + mTxPkts = prometheus.NewDesc( + "fortiswitch_port_transmit_packets_total", + "Number of packets transmitted on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mTxB = prometheus.NewDesc( + "fortiswitch_port_transmit_bytes_total", + "Number of bytes transmitted on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mTxUcast = prometheus.NewDesc( + "fortiswitch_port_transmit_unicast_packets_total", + "Number of unicast packets transmitted on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mTxMcast = prometheus.NewDesc( + "fortiswitch_port_transmit_multicast_packets_total", + "Number of multicast packets transmitted on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mTxBcast = prometheus.NewDesc( + "fortiswitch_port_transmit_broadcast_packets_total", + "Number of broadcast packets transmitted on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mTxErr = prometheus.NewDesc( + "fortiswitch_port_transmit_errors_total", + "Number of transmission errors detected on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mTxDrops = prometheus.NewDesc( + "fortiswitch_port_transmit_drops_total", + "Number of dropped packets detected during transmission on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mTxOverS = prometheus.NewDesc( + "fortiswitch_port_transmit_oversized_packets_total", + "Number of oversized packets transmitted on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mRxPkts = prometheus.NewDesc( + "fortiswitch_port_receive_packets_total", + "Number of packets received on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mRxB = prometheus.NewDesc( + "fortiswitch_port_receive_bytes_total", + "Number of bytes received on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mRxUcast = prometheus.NewDesc( + "fortiswitch_port_receive_unicast_packets_total", + "Number of unicast packets received on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mRxMcast = prometheus.NewDesc( + "fortiswitch_port_receive_multicast_packets_total", + "Number of multicast packets received on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mRxBcast = prometheus.NewDesc( + "fortiswitch_port_receive_broadcast_packets_total", + "Number of broadcast packets received on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mRxErr = prometheus.NewDesc( + "fortiswitch_port_receive_errors_total", + "Number of transmission errors detected on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mRxDrops = prometheus.NewDesc( + "fortiswitch_port_receive_drops_total", + "Number of dropped packets detected during transmission on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + mRxOverS = prometheus.NewDesc( + "fortiswitch_port_receive_oversized_packets_total", + "Number of oversized packets received on the interface", + []string{"vdom", "name", "serial_number", "interface"}, nil, + ) + ) + + type portStats struct { + TxPackets float64 `json:"tx-packets"` + TxBytes float64 `json:"tx-bytes"` + TxErrors float64 `json:"tx-errors"` + TxMcast float64 `json:"tx-mcast"` + TxUcast float64 `json:"tx-ucast"` + TxBcast float64 `json:"tx-bcast"` + TxDrops float64 `json:"tx-drops"` + TxOversize float64 `json:"tx-oversize"` + RxPackets float64 `json:"rx-packets"` + RxBytes float64 `json:"rx-bytes"` + RxErrors float64 `json:"rx-errors"` + RxMcast float64 `json:"rx-mcast"` + RxUcast float64 `json:"rx-ucast"` + RxBcast float64 `json:"rx-bcast"` + RxDrops float64 `json:"rx-drops"` + RxOversize float64 `json:"rx-oversize"` + } + type portsInfo struct { + Interface string + Status string + Duplex string + Speed float64 + Vlan string + } + type swResult struct { + Name string + Serial string + FgPeerIntfName string `json:"fgt_peer_intf_name"` + Status string + State string + Connecting_from string `json:"connecting_from"` + Vdom string + Ports []portsInfo + PortStats map[string]portStats `json:"port_stats"` + } + + type swPortStats struct { + Serial string `json:"serial"` + Ports map[string]portStats `json:"ports"` + } + + type swResponse struct { + Results []swResult `json:"results"` + } + + type swPortsNew struct { + Results []swPortStats `json:"results"` + } + + var apiPath string + var portStatsPath string + + if meta.VersionMajor > 7 || (meta.VersionMajor == 7 && meta.VersionMinor >= 0) { + apiPath = "api/v2/monitor/switch-controller/managed-switch/status" + portStatsPath = "api/v2/monitor/switch-controller/managed-switch/port-stats" + } else { + apiPath = "api/v2/monitor/switch-controller/managed-switch" + portStatsPath = "" + } + + var r swResponse + + if portStatsPath == "" { + // Old API format (FortiOS < 7.0.1) + if err := c.Get(apiPath, "port_stats=true", &r); err != nil { + log.Printf("Error: %v", err) + return nil, false + } + + } else { + // New API format (FortiOS 7.0.1+) + var rPorts swPortsNew + + // Fetch switch status (to get name, vdom, interfaces) + if err := c.Get(apiPath, "", &r); err != nil { + log.Printf("Error fetching switch status: %v", err) + return nil, false + } + + // Fetch port stats (to get traffic metrics) + if err := c.Get(portStatsPath, "", &rPorts); err != nil { + log.Printf("Error fetching switch port stats: %v", err) + return nil, false + } + + // Merge `/port-stats` into `/status` response + for i, sw := range r.Results { + matched := false + swr := &r.Results[i] + + // Ensure PortStats is always initialized to prevent nil pointer errors + if swr.PortStats == nil { + swr.PortStats = make(map[string]portStats) + } + + // Match serial numbers and add port stats + for _, ps := range rPorts.Results { + if ps.Serial == sw.Serial { + swr.PortStats = ps.Ports + matched = true + break + } + } + + // Log if no port stats were found for a switch + if !matched { + log.Printf("Warning: No port stats found for switch %s (serial: %s)", swr.Name, swr.Serial) + } + } + } + + m := []prometheus.Metric{} + + for _, swr := range r.Results { + swStatus := 0.0 + if swr.Status == "Connected" { + swStatus = 1.0 + } + + var swState float64 + if swr.State == "Authorized" { + swState = 1.0 + } else if swr.State == "DeAuthorized" { + swState = 0.0 + } else if swr.State == "Discovered" { + swState = 2.0 + } + + m = append(m, prometheus.MustNewConstMetric(mSwitchStatus, prometheus.GaugeValue, swStatus, swr.Vdom, swr.Name, swr.Serial, swr.FgPeerIntfName, swr.Connecting_from, fmt.Sprintf("%0.f", swState))) + + for _, pi := range swr.Ports { + pStatus := 0.0 + if pi.Status == "up" { + pStatus = 1.0 + } + + pDuplex := 0.0 + if pi.Duplex == "full" { + pDuplex = 1.0 + } else if pi.Duplex == "half" { + pDuplex = 0.5 + } + m = append(m, prometheus.MustNewConstMetric(mPortStatus, prometheus.GaugeValue, pStatus, swr.Vdom, swr.Name, swr.Serial, pi.Interface, pi.Vlan, pi.Duplex)) + m = append(m, prometheus.MustNewConstMetric(mPortSpeed, prometheus.GaugeValue, pi.Speed*1000*1000, swr.Vdom, swr.Name, swr.Serial, pi.Interface, pi.Vlan, pi.Duplex)) + m = append(m, prometheus.MustNewConstMetric(mPortDuplex, prometheus.GaugeValue, pDuplex, swr.Vdom, swr.Name, swr.Serial, pi.Interface, pi.Vlan, pi.Duplex)) + + } + + for port, ps := range swr.PortStats { + m = append(m, prometheus.MustNewConstMetric(mTxPkts, prometheus.CounterValue, ps.TxPackets, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mTxB, prometheus.CounterValue, ps.TxBytes, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mTxUcast, prometheus.CounterValue, ps.TxUcast, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mTxBcast, prometheus.CounterValue, ps.TxBcast, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mTxMcast, prometheus.CounterValue, ps.TxMcast, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mTxErr, prometheus.CounterValue, ps.TxErrors, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mTxDrops, prometheus.CounterValue, ps.TxDrops, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mTxOverS, prometheus.CounterValue, ps.TxOversize, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mRxPkts, prometheus.CounterValue, ps.RxPackets, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mRxB, prometheus.CounterValue, ps.RxBytes, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mRxUcast, prometheus.CounterValue, ps.RxUcast, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mRxBcast, prometheus.CounterValue, ps.RxBcast, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mRxMcast, prometheus.CounterValue, ps.RxMcast, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mRxErr, prometheus.CounterValue, ps.RxErrors, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mRxDrops, prometheus.CounterValue, ps.RxDrops, swr.Vdom, swr.Name, swr.Serial, port)) + m = append(m, prometheus.MustNewConstMetric(mRxOverS, prometheus.CounterValue, ps.RxOversize, swr.Vdom, swr.Name, swr.Serial, port)) + } + } + + return m, true +} diff --git a/pkg/probe/fortiswitch_port_stats_test.go b/pkg/probe/fortiswitch_port_stats_test.go new file mode 100644 index 00000000..3484f990 --- /dev/null +++ b/pkg/probe/fortiswitch_port_stats_test.go @@ -0,0 +1,532 @@ +// Copyright 2025 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package probe + +import ( + "strings" + "testing" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/testutil" +) + +func TestSwitchPortStats(t *testing.T) { + c := newFakeClient() + + // Old API (FortiOS < 7.0.1) + c.prepare("api/v2/monitor/switch-controller/managed-switch", "testdata/fsw-interface.jsonnet") + + // ✅ New API (FortiOS 7.0.1+) + c.prepare("api/v2/monitor/switch-controller/managed-switch/status", "testdata/fsw-status7.jsonnet") // <-- Add this + c.prepare("api/v2/monitor/switch-controller/managed-switch/port-stats", "testdata/fsw-port-stats7.jsonnet") // <-- Add this + + r := prometheus.NewPedanticRegistry() + if !testProbe(probeSwitchPortStats, c, r) { + t.Errorf("probeSwitchPortStats() returned non-success") + } + + // Metric comparison + if err := testutil.GatherAndCompare(r, strings.NewReader(expectedMetrics)); err != nil { + t.Fatalf("metric compare failed: %v", err) + } +} + +// func TestSwitchPortStatsOldAPI(t *testing.T) { +// c := newFakeClient() +// // Load Old API data (FortiOS < 7.0.1) +// c.prepare("api/v2/monitor/switch-controller/managed-switch", "testdata/fsw-interface.jsonnet") + +// r := prometheus.NewPedanticRegistry() +// if !testProbe(probeSwitchPortStats, c, r) { +// t.Errorf("probeSwitchPortStats() for Old API returned non-success") +// } + +// if err := testutil.GatherAndCompare(r, strings.NewReader(expectedMetrics)); err != nil { +// t.Fatalf("metric compare failed for Old API: %v", err) +// } +// } + +// func TestSwitchPortStatsNewAPI(t *testing.T) { +// c := newFakeClient() + +// // Ensure both API endpoints are prepared +// c.prepare("api/v2/monitor/switch-controller/managed-switch/status", "testdata/fsw-status7.jsonnet") +// c.prepare("api/v2/monitor/switch-controller/managed-switch/port-stats", "testdata/fsw-port-stats7.jsonnet") + +// r := prometheus.NewPedanticRegistry() +// if !testProbe(probeSwitchPortStats, c, r) { +// t.Errorf("probeSwitchPortStats() for New API returned non-success") +// } + +// if err := testutil.GatherAndCompare(r, strings.NewReader(expectedMetrics)); err != nil { +// t.Fatalf("metric compare failed for New API: %v", err) +// } +// } + +const expectedMetrics = ` +# HELP fortiswitch_status Whether the switch is connected or not\n# fgt_peer_intf_name = FortiLink interface that the FortiSwitch is connected to\n# connection_from = FortiSwitch port that is connected to the FortiLink interface +# TYPE fortiswitch_status gauge +fortiswitch_status{connection_from="169.254.2.2",fgt_peer_intf_name="fortilink",name="S108EN0000000000",serial_number="S108EN0000000000",state="1",vdom="root"} 1 +fortiswitch_status{connection_from="169.254.2.3",fgt_peer_intf_name="fortilink",name="S108EP4N00000000",serial_number="S108EP4N00000000",state="1",vdom="root"} 1 +# HELP fortiswitch_port_status Whether the switch port is up or not +# TYPE fortiswitch_port_status gauge +fortiswitch_port_status{duplex="",interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_status{duplex="",interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_status{duplex="full",interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_status{duplex="full",interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="fortiap"} 1 +fortiswitch_port_status{duplex="full",interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_status{duplex="full",interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_status{duplex="full",interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_status{duplex="full",interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1 +fortiswitch_port_status{duplex="full",interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_status{duplex="full",interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1 +fortiswitch_port_status{duplex="full",interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="vsw.fortilink"} 1 +fortiswitch_port_status{duplex="full",interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1 +# HELP fortiswitch_port_speed_bps Speed negotiated on the interface in bits/s +# TYPE fortiswitch_port_speed_bps gauge +fortiswitch_port_speed_bps{duplex="",interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="",interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_speed_bps{duplex="full",interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="fortiap"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="vsw.fortilink"} 1e+09 +fortiswitch_port_speed_bps{duplex="full",interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1e+09 +# HELP fortiswitch_port_duplex_status Duplex status of the FortiSwitch port +# TYPE fortiswitch_port_duplex_status gauge +fortiswitch_port_duplex_status{duplex="",interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="snf.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="",interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 0 +fortiswitch_port_duplex_status{duplex="full",interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="fortiap"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="proxmox"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root",vlan="vsw.fortilink"} 1 +fortiswitch_port_duplex_status{duplex="full",interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root",vlan="vsw.fortilink"} 1 +# HELP fortiswitch_port_transmit_packets_total Number of packets transmitted on the interface +# TYPE fortiswitch_port_transmit_packets_total counter +fortiswitch_port_transmit_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.784539e+07 +fortiswitch_port_transmit_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.9953237e+07 +fortiswitch_port_transmit_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.585012238e+09 +fortiswitch_port_transmit_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 2.8127054e+08 +fortiswitch_port_transmit_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 2.538240956e+09 +fortiswitch_port_transmit_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 4.04470704e+09 +fortiswitch_port_transmit_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.315834415e+09 +fortiswitch_port_transmit_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.935104868e+09 +fortiswitch_port_transmit_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.771233202e+09 +fortiswitch_port_transmit_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.4567727e+07 +fortiswitch_port_transmit_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.7394893e+09 +fortiswitch_port_transmit_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.870034438e+09 +fortiswitch_port_transmit_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_receive_packets_total Number of packets received on the interface +# TYPE fortiswitch_port_receive_packets_total counter +fortiswitch_port_receive_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.2926722e+07 +fortiswitch_port_receive_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.7078313e+07 +fortiswitch_port_receive_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.36109511e+09 +fortiswitch_port_receive_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.28335158e+08 +fortiswitch_port_receive_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.943744942e+09 +fortiswitch_port_receive_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.674920338e+09 +fortiswitch_port_receive_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 7.67499331e+08 +fortiswitch_port_receive_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.739489487e+09 +fortiswitch_port_receive_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.00568994e+09 +fortiswitch_port_receive_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 420799 +fortiswitch_port_receive_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.935104683e+09 +fortiswitch_port_receive_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 2.207656699e+09 +fortiswitch_port_receive_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +#HELP fortiswitch_port_receive_broadcast_packets_total Number of broadcast packets received on the interface +# TYPE fortiswitch_port_receive_broadcast_packets_total counter +fortiswitch_port_receive_broadcast_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 4.713459e06 +fortiswitch_port_receive_broadcast_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.461722e06 +fortiswitch_port_receive_broadcast_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.430059e06 +fortiswitch_port_receive_broadcast_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 464 +fortiswitch_port_receive_broadcast_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 390496 +fortiswitch_port_receive_broadcast_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 838650 +fortiswitch_port_receive_broadcast_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.116203e06 +fortiswitch_port_receive_broadcast_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 3.088381e06 +fortiswitch_port_receive_broadcast_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.172753e06 +fortiswitch_port_receive_broadcast_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 207264 +fortiswitch_port_receive_broadcast_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 5.890675e06 +fortiswitch_port_receive_broadcast_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 5.685072e06 +fortiswitch_port_receive_broadcast_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_broadcast_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_receive_bytes_total Number of bytes received on the interface +# TYPE fortiswitch_port_receive_bytes_total counter +fortiswitch_port_receive_bytes_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.1352224784e10 +fortiswitch_port_receive_bytes_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 6.407616215e09 +fortiswitch_port_receive_bytes_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.1003829024042e13 +fortiswitch_port_receive_bytes_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 6.348630629e10 +fortiswitch_port_receive_bytes_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.919415523606e12 +fortiswitch_port_receive_bytes_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.2770689222182e13 +fortiswitch_port_receive_bytes_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 9.319869478488e12 +fortiswitch_port_receive_bytes_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.159387519622e12 +fortiswitch_port_receive_bytes_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.0496453460264e13 +fortiswitch_port_receive_bytes_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 4.2523424e07 +fortiswitch_port_receive_bytes_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.324840613348e12 +fortiswitch_port_receive_bytes_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.612957216684e12 +fortiswitch_port_receive_bytes_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_bytes_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_receive_drops_total Number of dropped packets detected during transmission on the interface +# TYPE fortiswitch_port_receive_drops_total counter +fortiswitch_port_receive_drops_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3400 +fortiswitch_port_receive_drops_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 25 +fortiswitch_port_receive_drops_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.2092694e07 +fortiswitch_port_receive_drops_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 11 +fortiswitch_port_receive_drops_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.1260376e07 +fortiswitch_port_receive_drops_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.3489257e07 +fortiswitch_port_receive_drops_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 5.530408e06 +fortiswitch_port_receive_drops_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 65652 +fortiswitch_port_receive_drops_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 9.331414e06 +fortiswitch_port_receive_drops_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 36 +fortiswitch_port_receive_drops_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 5.339649e06 +fortiswitch_port_receive_drops_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 5.849172e06 +fortiswitch_port_receive_drops_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_drops_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_receive_errors_total Number of transmission errors detected on the interface +# TYPE fortiswitch_port_receive_errors_total counter +fortiswitch_port_receive_errors_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_errors_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_receive_multicast_packets_total Number of multicast packets received on the interface +# TYPE fortiswitch_port_receive_multicast_packets_total counter +fortiswitch_port_receive_multicast_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 2.2194933e07 +fortiswitch_port_receive_multicast_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 9.672064e06 +fortiswitch_port_receive_multicast_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 4715 +fortiswitch_port_receive_multicast_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 33113 +fortiswitch_port_receive_multicast_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 5287 +fortiswitch_port_receive_multicast_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3235 +fortiswitch_port_receive_multicast_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 6.625242e06 +fortiswitch_port_receive_multicast_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.4073094e07 +fortiswitch_port_receive_multicast_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 2.386241e06 +fortiswitch_port_receive_multicast_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 3861 +fortiswitch_port_receive_multicast_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.5459295e07 +fortiswitch_port_receive_multicast_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 8.7964741e07 +fortiswitch_port_receive_multicast_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_multicast_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_receive_oversized_packets_total Number of oversized packets received on the interface +# TYPE fortiswitch_port_receive_oversized_packets_total counter +fortiswitch_port_receive_oversized_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_oversized_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_receive_unicast_packets_total Number of unicast packets received on the interface +# TYPE fortiswitch_port_receive_unicast_packets_total counter +fortiswitch_port_receive_unicast_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 6.01833e06 +fortiswitch_port_receive_unicast_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 5.944527e06 +fortiswitch_port_receive_unicast_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.359660336e09 +fortiswitch_port_receive_unicast_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.28301581e08 +fortiswitch_port_receive_unicast_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.943349159e09 +fortiswitch_port_receive_unicast_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.674078453e09 +fortiswitch_port_receive_unicast_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 7.59757886e08 +fortiswitch_port_receive_unicast_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.722328012e09 +fortiswitch_port_receive_unicast_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.002130946e09 +fortiswitch_port_receive_unicast_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 209674 +fortiswitch_port_receive_unicast_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.843754713e09 +fortiswitch_port_receive_unicast_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 2.114006886e09 +fortiswitch_port_receive_unicast_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_receive_unicast_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_transmit_broadcast_packets_total Number of broadcast packets transmitted on the interface +# TYPE fortiswitch_port_transmit_broadcast_packets_total counter +fortiswitch_port_transmit_broadcast_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 69913 +fortiswitch_port_transmit_broadcast_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 69879 +fortiswitch_port_transmit_broadcast_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.624954e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.296068e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 9.554441e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.991159e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.828099e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 5.890675e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.759829e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 850698 +fortiswitch_port_transmit_broadcast_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.088381e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 3.288593e06 +fortiswitch_port_transmit_broadcast_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_broadcast_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_transmit_bytes_total Number of bytes transmitted on the interface +# TYPE fortiswitch_port_transmit_bytes_total counter +fortiswitch_port_transmit_bytes_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 4.844915593e09 +fortiswitch_port_transmit_bytes_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 5.181766502e09 +fortiswitch_port_transmit_bytes_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.0921799654249e13 +fortiswitch_port_transmit_bytes_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 2.89477628518e11 +fortiswitch_port_transmit_bytes_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 5.84025450544e12 +fortiswitch_port_transmit_bytes_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.2355499172422e13 +fortiswitch_port_transmit_bytes_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.0343038183895e13 +fortiswitch_port_transmit_bytes_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.324840632702e12 +fortiswitch_port_transmit_bytes_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.3253235010876e13 +fortiswitch_port_transmit_bytes_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 5.86307952e09 +fortiswitch_port_transmit_bytes_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.159387493899e12 +fortiswitch_port_transmit_bytes_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.225785748078e12 +fortiswitch_port_transmit_bytes_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_bytes_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_transmit_drops_total Number of dropped packets detected during transmission on the interface +# TYPE fortiswitch_port_transmit_drops_total counter +fortiswitch_port_transmit_drops_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 2 +fortiswitch_port_transmit_drops_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_drops_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_transmit_errors_total Number of transmission errors detected on the interface +# TYPE fortiswitch_port_transmit_errors_total counter +fortiswitch_port_transmit_errors_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_errors_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_transmit_multicast_packets_total Number of multicast packets transmitted on the interface +# TYPE fortiswitch_port_transmit_multicast_packets_total counter +fortiswitch_port_transmit_multicast_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.1994229e07 +fortiswitch_port_transmit_multicast_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.4158987e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.1573697e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.48505e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.1931485e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 8.1930854e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 7.5610099e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 8.5459296e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 7.9655049e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.29357e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.4073093e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.0019549e07 +fortiswitch_port_transmit_multicast_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_multicast_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_transmit_oversized_packets_total Number of oversized packets transmitted on the interface +# TYPE fortiswitch_port_transmit_oversized_packets_total counter +fortiswitch_port_transmit_oversized_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_oversized_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +# HELP fortiswitch_port_transmit_unicast_packets_total Number of unicast packets transmitted on the interface +# TYPE fortiswitch_port_transmit_unicast_packets_total counter +fortiswitch_port_transmit_unicast_packets_total{interface="internal",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 5.781248e06 +fortiswitch_port_transmit_unicast_packets_total{interface="internal",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 5.724371e06 +fortiswitch_port_transmit_unicast_packets_total{interface="port1",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.494813587e09 +fortiswitch_port_transmit_unicast_packets_total{interface="port1",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 2.65123972e08 +fortiswitch_port_transmit_unicast_packets_total{interface="port10",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port10",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port2",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 2.44675503e09 +fortiswitch_port_transmit_unicast_packets_total{interface="port2",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port3",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.953785027e09 +fortiswitch_port_transmit_unicast_packets_total{interface="port3",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port4",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.231396217e09 +fortiswitch_port_transmit_unicast_packets_total{interface="port4",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.843754897e09 +fortiswitch_port_transmit_unicast_packets_total{interface="port5",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 3.682818324e09 +fortiswitch_port_transmit_unicast_packets_total{interface="port5",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port6",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port6",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port7",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port7",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 781329 +fortiswitch_port_transmit_unicast_packets_total{interface="port8",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 1.722327826e09 +fortiswitch_port_transmit_unicast_packets_total{interface="port8",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 1.856726296e09 +fortiswitch_port_transmit_unicast_packets_total{interface="port9",name="S108EN0000000000",serial_number="S108EN0000000000",vdom="root"} 0 +fortiswitch_port_transmit_unicast_packets_total{interface="port9",name="S108EP4N00000000",serial_number="S108EP4N00000000",vdom="root"} 0 +` diff --git a/pkg/probe/probe.go b/pkg/probe/probe.go index 88d76fe6..8ec0f12f 100644 --- a/pkg/probe/probe.go +++ b/pkg/probe/probe.go @@ -151,6 +151,8 @@ func (p *ProbeCollector) Probe(ctx context.Context, target map[string]string, hc {"System/Status", probeSystemStatus}, {"System/VDOMResources", probeSystemVDOMResources}, {"System/HAChecksum", probeSystemHAChecksum}, + {"SwitchController/ManageSwitch/PortStats", probeSwitchPortStats}, + {"SwitchController/ManageSwitch/Health", probeSwitchHealth}, {"User/Fsso", probeUserFsso}, {"VPN/IPSec", probeVPNIPSec}, {"VPN/Ssl/Connections", probeVPNSsl}, diff --git a/pkg/probe/probe_test.go b/pkg/probe/probe_test.go index 0d0e5583..512172b1 100644 --- a/pkg/probe/probe_test.go +++ b/pkg/probe/probe_test.go @@ -63,6 +63,7 @@ func (c *fakeClient) prepare(path string, jfile string) { d: []byte(output), q: u.Query(), }) + } func (c *fakeClient) Get(path string, query string, obj interface{}) error { diff --git a/pkg/probe/testdata/fsw-health.jsonnet b/pkg/probe/testdata/fsw-health.jsonnet new file mode 100644 index 00000000..8fb333fc --- /dev/null +++ b/pkg/probe/testdata/fsw-health.jsonnet @@ -0,0 +1,455 @@ +# api/v2/monitor/switch-controller/managed-switch?port_stats=true + +{ + "http_method":"GET", + "results":{ + "FS00000000000027":{ + "performance-status":{ + "cpu":{ + "user":{ + "value":0, + "unit":"%%" + }, + "system":{ + "value":0, + "unit":"%%" + }, + "nice":{ + "value":0, + "unit":"%%" + }, + "idle":{ + "value":100, + "unit":"%%" + } + }, + "memory":{ + "used":{ + "value":15, + "unit":"%%" + } + }, + "network":{ + "in-1min":{ + "value":0, + "unit":"kbps" + }, + "in-10min":{ + "value":0, + "unit":"kbps" + }, + "in-30min":{ + "value":0, + "unit":"kbps" + } + }, + "uptime":{ + "days":{ + "value":454, + "unit":"days" + }, + "hours":{ + "value":17, + "unit":"hours" + }, + "minutes":{ + "value":49, + "unit":"minutes" + } + } + }, + "temperature":[ + { + "module":"sensor1(CPU Board Temp)", + "status":{ + "value":39.000000, + "unit":"celsius" + } + }, + { + "module":"sensor2(MAIN Board Temp1)", + "status":{ + "value":60.625000, + "unit":"celsius" + } + }, + { + "module":"sensor3(MAIN Board Temp2)", + "status":{ + "value":48.937000, + "unit":"celsius" + } + }, + { + "module":"sensor4(MAIN Board Temp3)", + "status":{ + "value":36.062000, + "unit":"celsius" + } + } + ], + "summary":{ + "cpu":{ + "value":0, + "rating":"good" + }, + "memory":{ + "value":15, + "rating":"good" + }, + "uptime":{ + "value":39289740, + "rating":"good" + }, + "temperature":{ + "value":46.156000000000006, + "rating":"good" + }, + "overall":"good" + }, + "poe":{ + "value":0, + "max_value":0, + "unit":"watts" + } + }, + "FS00000000000024":{ + "performance-status":{ + "cpu":{ + "user":{ + "value":0, + "unit":"%%" + }, + "system":{ + "value":0, + "unit":"%%" + }, + "nice":{ + "value":0, + "unit":"%%" + }, + "idle":{ + "value":100, + "unit":"%%" + } + }, + "memory":{ + "used":{ + "value":10, + "unit":"%%" + } + }, + "network":{ + "in-1min":{ + "value":0, + "unit":"kbps" + }, + "in-10min":{ + "value":0, + "unit":"kbps" + }, + "in-30min":{ + "value":0, + "unit":"kbps" + } + }, + "uptime":{ + "days":{ + "value":454, + "unit":"days" + }, + "hours":{ + "value":17, + "unit":"hours" + }, + "minutes":{ + "value":48, + "unit":"minutes" + } + } + }, + "temperature":[ + { + "module":"sensor1(CPU Board Temp)", + "status":{ + "value":41.937000, + "unit":"celsius" + } + }, + { + "module":"sensor2(MAIN Board Temp1)", + "status":{ + "value":63.875000, + "unit":"celsius" + } + }, + { + "module":"sensor3(MAIN Board Temp2)", + "status":{ + "value":51.312000, + "unit":"celsius" + } + }, + { + "module":"sensor4(MAIN Board Temp3)", + "status":{ + "value":38.687000, + "unit":"celsius" + } + } + ], + "summary":{ + "cpu":{ + "value":0, + "rating":"good" + }, + "memory":{ + "value":10, + "rating":"good" + }, + "uptime":{ + "value":39289680, + "rating":"good" + }, + "temperature":{ + "value":48.952749999999995, + "rating":"good" + }, + "overall":"good" + }, + "poe":{ + "value":0, + "max_value":0, + "unit":"watts" + } + }, + "FS00000000000038":{ + "performance-status":{ + "cpu":{ + "user":{ + "value":0, + "unit":"%%" + }, + "system":{ + "value":0, + "unit":"%%" + }, + "nice":{ + "value":0, + "unit":"%%" + }, + "idle":{ + "value":100, + "unit":"%%" + } + }, + "memory":{ + "used":{ + "value":10, + "unit":"%%" + } + }, + "network":{ + "in-1min":{ + "value":0, + "unit":"kbps" + }, + "in-10min":{ + "value":0, + "unit":"kbps" + }, + "in-30min":{ + "value":0, + "unit":"kbps" + } + }, + "uptime":{ + "days":{ + "value":308, + "unit":"days" + }, + "hours":{ + "value":0, + "unit":"hours" + }, + "minutes":{ + "value":23, + "unit":"minutes" + } + } + }, + "temperature":[ + { + "module":"sensor1(CPU Board Temp)", + "status":{ + "value":35.437000, + "unit":"celsius" + } + }, + { + "module":"sensor2(MAIN Board Temp1)", + "status":{ + "value":55.625000, + "unit":"celsius" + } + }, + { + "module":"sensor3(MAIN Board Temp2)", + "status":{ + "value":43.125000, + "unit":"celsius" + } + }, + { + "module":"sensor4(MAIN Board Temp3)", + "status":{ + "value":32.312000, + "unit":"celsius" + } + } + ], + "summary":{ + "cpu":{ + "value":0, + "rating":"good" + }, + "memory":{ + "value":32, + "rating":"good" + }, + "uptime":{ + "value":26612580, + "rating":"good" + }, + "temperature":{ + "value":41.624750000000006, + "rating":"good" + }, + "overall":"good" + }, + "poe":{ + "value":0, + "max_value":0, + "unit":"watts" + } + }, + "FS00000000000030":{ + "performance-status":{ + "cpu":{ + "user":{ + "value":0, + "unit":"%%" + }, + "system":{ + "value":0, + "unit":"%%" + }, + "nice":{ + "value":0, + "unit":"%%" + }, + "idle":{ + "value":100, + "unit":"%%" + } + }, + "memory":{ + "used":{ + "value":50, + "unit":"%%" + } + }, + "network":{ + "in-1min":{ + "value":0, + "unit":"kbps" + }, + "in-10min":{ + "value":0, + "unit":"kbps" + }, + "in-30min":{ + "value":0, + "unit":"kbps" + } + }, + "uptime":{ + "days":{ + "value":308, + "unit":"days" + }, + "hours":{ + "value":0, + "unit":"hours" + }, + "minutes":{ + "value":28, + "unit":"minutes" + } + } + }, + "temperature":[ + { + "module":"sensor1(CPU Board Temp)", + "status":{ + "value":33.875000, + "unit":"celsius" + } + }, + { + "module":"sensor2(MAIN Board Temp1)", + "status":{ + "value":53.750000, + "unit":"celsius" + } + }, + { + "module":"sensor3(MAIN Board Temp2)", + "status":{ + "value":41.000000, + "unit":"celsius" + } + }, + { + "module":"sensor4(MAIN Board Temp3)", + "status":{ + "value":30.250000, + "unit":"celsius" + } + } + ], + "summary":{ + "cpu":{ + "value":0, + "rating":"good" + }, + "memory":{ + "value":50, + "rating":"good" + }, + "uptime":{ + "value":26612880, + "rating":"good" + }, + "temperature":{ + "value":39.71875, + "rating":"good" + }, + "overall":"good" + }, + "poe":{ + "value":0, + "max_value":0, + "unit":"watts" + } + } + }, + "vdom":"root", + "path":"switch-controller", + "name":"managed-switch", + "action":"health", + "status":"success", + "serial":"FS000000000000302", + "version":"v6.4.0", + "build":1030 +} diff --git a/pkg/probe/testdata/fsw-port-stats7.jsonnet b/pkg/probe/testdata/fsw-port-stats7.jsonnet new file mode 100644 index 00000000..d886399d --- /dev/null +++ b/pkg/probe/testdata/fsw-port-stats7.jsonnet @@ -0,0 +1,553 @@ +# api/v2/monitor/switch-controller/managed-switch/port-stats + +{ + "http_method":"GET", + "results":[ + { + "serial":"S108EN0000000000", + "ports":{ + "port1":{ + "tx-bytes":10921799654249, + "tx-packets":1585012238, + "tx-ucast":1494813587, + "tx-mcast":81573697, + "tx-bcast":8624954, + "tx-errors":0, + "tx-drops":2, + "tx-oversize":0, + "rx-bytes":11003829024042, + "rx-packets":1361095110, + "rx-ucast":1359660336, + "rx-mcast":4715, + "rx-bcast":1430059, + "rx-errors":0, + "rx-drops":12092694, + "rx-oversize":0, + "undersize":1, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port2":{ + "tx-bytes":5840254505440, + "tx-packets":2538240956, + "tx-ucast":2446755030, + "tx-mcast":81931485, + "tx-bcast":9554441, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":8919415523606, + "rx-packets":3943744942, + "rx-ucast":3943349159, + "rx-mcast":5287, + "rx-bcast":390496, + "rx-errors":0, + "rx-drops":11260376, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port3":{ + "tx-bytes":12355499172422, + "tx-packets":4044707040, + "tx-ucast":3953785027, + "tx-mcast":81930854, + "tx-bcast":8991159, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":12770689222182, + "rx-packets":3674920338, + "rx-ucast":3674078453, + "rx-mcast":3235, + "rx-bcast":838650, + "rx-errors":0, + "rx-drops":13489257, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port4":{ + "tx-bytes":10343038183895, + "tx-packets":1315834415, + "tx-ucast":1231396217, + "tx-mcast":75610099, + "tx-bcast":8828099, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":9319869478488, + "rx-packets":767499331, + "rx-ucast":759757886, + "rx-mcast":6625242, + "rx-bcast":1116203, + "rx-errors":0, + "rx-drops":5530408, + "rx-oversize":0, + "undersize":168, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port5":{ + "tx-bytes":13253235010876, + "tx-packets":3771233202, + "tx-ucast":3682818324, + "tx-mcast":79655049, + "tx-bcast":8759829, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":10496453460264, + "rx-packets":3005689940, + "rx-ucast":3002130946, + "rx-mcast":2386241, + "rx-bcast":1172753, + "rx-errors":0, + "rx-drops":9331414, + "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":1159387493899, + "tx-packets":1739489300, + "tx-ucast":1722327826, + "tx-mcast":14073093, + "tx-bcast":3088381, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":1324840613348, + "rx-packets":1935104683, + "rx-ucast":1843754713, + "rx-mcast":85459295, + "rx-bcast":5890675, + "rx-errors":0, + "rx-drops":5339649, + "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":0, + "l3packets":0 + }, + "port10":{ + "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":4844915593, + "tx-packets":17845390, + "tx-ucast":5781248, + "tx-mcast":11994229, + "tx-bcast":69913, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":11352224784, + "rx-packets":32926722, + "rx-ucast":6018330, + "rx-mcast":22194933, + "rx-bcast":4713459, + "rx-errors":0, + "rx-drops":3400, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + } + }, + }, + { + "serial":"S108EP4N00000000", + "ports":{ + "port1":{ + "tx-bytes":289477628518, + "tx-packets":281270540, + "tx-ucast":265123972, + "tx-mcast":14850500, + "tx-bcast":1296068, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":63486306290, + "rx-packets":128335158, + "rx-ucast":128301581, + "rx-mcast":33113, + "rx-bcast":464, + "rx-errors":0, + "rx-drops":11, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "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":1324840632702, + "tx-packets":1935104868, + "tx-ucast":1843754897, + "tx-mcast":85459296, + "tx-bcast":5890675, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":1159387519622, + "rx-packets":1739489487, + "rx-ucast":1722328012, + "rx-mcast":14073094, + "rx-bcast":3088381, + "rx-errors":0, + "rx-drops":65652, + "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":5863079520, + "tx-packets":14567727, + "tx-ucast":781329, + "tx-mcast":12935700, + "tx-bcast":850698, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":42523424, + "rx-packets":420799, + "rx-ucast":209674, + "rx-mcast":3861, + "rx-bcast":207264, + "rx-errors":0, + "rx-drops":36, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + }, + "port8":{ + "tx-bytes":1225785748078, + "tx-packets":1870034438, + "tx-ucast":1856726296, + "tx-mcast":10019549, + "tx-bcast":3288593, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":1612957216684, + "rx-packets":2207656699, + "rx-ucast":2114006886, + "rx-mcast":87964741, + "rx-bcast":5685072, + "rx-errors":0, + "rx-drops":5849172, + "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":0, + "l3packets":0 + }, + "port10":{ + "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":5181766502, + "tx-packets":19953237, + "tx-ucast":5724371, + "tx-mcast":14158987, + "tx-bcast":69879, + "tx-errors":0, + "tx-drops":0, + "tx-oversize":0, + "rx-bytes":6407616215, + "rx-packets":17078313, + "rx-ucast":5944527, + "rx-mcast":9672064, + "rx-bcast":1461722, + "rx-errors":0, + "rx-drops":25, + "rx-oversize":0, + "undersize":0, + "fragments":0, + "jabbers":0, + "collisions":0, + "crc-alignments":0, + "l3packets":0 + } + }, + } + ], + "vdom":"root", + "path":"switch-controller", + "name":"managed-switch", + "action":"port-stats", + "status":"success", + "serial":"FGT60ETK0000000", + "version":"v7.2.10", + "build":1706 +} diff --git a/pkg/probe/testdata/fsw-status7.jsonnet b/pkg/probe/testdata/fsw-status7.jsonnet new file mode 100644 index 00000000..b8647496 --- /dev/null +++ b/pkg/probe/testdata/fsw-status7.jsonnet @@ -0,0 +1,364 @@ +# api/v2/monitor/switch-controller/managed-switch/status + +{ + "http_method":"GET", + "results":[ + { + "name":"S108EN0000000000", + "serial":"S108EN0000000000", + "fgt_peer_intf_name":"fortilink", + "state":"Authorized", + "status":"Connected", + "os_version":"S108EN-v7.4.2-build801,231207 (GA)", + "connecting_from":"169.254.2.2", + "join_time":"Mon Oct 12 14:44:15 2020\n", + "ports":[ + { + "interface":"port1", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"proxmox", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port2", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"proxmox", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port3", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"proxmox", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port4", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"proxmox", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port5", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"proxmox", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port6", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"snf.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port7", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"snf.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port8", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"S108EP4N00000000", + "isl-peer-device-name":"S108EP4N00000000", + "isl_peer_port_name":"port4", + "isl-peer-port-name":"port4" + }, + { + "interface":"port9", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"snf.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port10", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"snf.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + } + ], + "max_poe_budget":0, + "igmp_snooping_supported":true, + "dhcp_snooping_supported":true, + "mc_lag_supported":false, + "led_blink_supported":true, + "vlan_segment_supported":true, + "vlan_segment_lite_supported":false, + "type":"physical", + "faceplate_xml":"\n\t\n\t\t\n\t<\/portgroup>\n\t\n\t\t\n\t<\/portgroup>\n\t\n\t\t\n\t<\/portgroup>\n<\/model>\n", + "vdom":"root", + "is_l3":false, + "eos":false, + "forticare_registration_status":"registered" + }, + { + "name":"S108EP4N00000000", + "serial":"S108EP4N00000000", + "fgt_peer_intf_name":"fortilink", + "state":"Authorized", + "status":"Connected", + "os_version":"S108EP-v6.4.2-build425,200629 (GA)", + "connecting_from":"169.254.2.3", + "join_time":"Mon Oct 12 14:43:55 2020\n", + "ports":[ + { + "interface":"port1", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"fortiap", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port2", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port3", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"snf.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port4", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"S108EN0000000000", + "isl-peer-device-name":"S108EN0000000000", + "isl_peer_port_name":"port8", + "isl-peer-port-name":"port8" + }, + { + "interface":"port5", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port6", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port7", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":false, + "fortilink-port":false, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port8", + "status":"up", + "duplex":"full", + "speed":1000, + "fortilink_port":true, + "fortilink-port":true, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"internal7", + "fgt_peer_device_name":"FGT60ETK0000000", + "fgt-peer-port-name":"internal7", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port9", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + }, + { + "interface":"port10", + "status":"down", + "fortilink_port":false, + "fortilink-port":false, + "vlan":"vsw.fortilink", + "fgt_peer_port_name":"", + "fgt_peer_device_name":"", + "fgt-peer-port-name":"", + "isl_peer_device_name":"", + "isl-peer-device-name":"", + "isl_peer_port_name":"", + "isl-peer-port-name":"" + } + ], + "max_poe_budget":0, + "igmp_snooping_supported":true, + "dhcp_snooping_supported":true, + "mc_lag_supported":false, + "led_blink_supported":true, + "vlan_segment_supported":true, + "vlan_segment_lite_supported":false, + "type":"physical", + "is_l3":false, + "eos":false, + "forticare_registration_status":"registered", + "faceplate_xml":"\n\t\n\t\t\n\t<\/portgroup>\n\t\n\t\t\n\t<\/portgroup>\n\t\n\t\t\n\t<\/portgroup>\n<\/model>\n", + "vdom":"root" + } + ], + "vdom":"root", + "path":"switch-controller", + "name":"managed-switch", + "status":"success", + "serial":"FGT60ETK0000000", + "version":"v6.2.5", + "build":1142 +}