Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

FortiSwitch API causing issues with collector returning metrics #288

Open
fg-pi opened this issue May 2, 2024 · 2 comments
Open

FortiSwitch API causing issues with collector returning metrics #288

fg-pi opened this issue May 2, 2024 · 2 comments

Comments

@fg-pi
Copy link

fg-pi commented May 2, 2024

On the pre-built Grafana dashboard page, there are instructions for updating the Managed Switch collection if running FortiOS 7.2 or higher.
"Updated version with Analyzer, Wifi and Switch, please note that in order to get switch data after v. 7.2 you need to edit “managed_switch.go” to look like this: “api/v2/monitor/switch-controller/managed-switch/status”"

I'm running into an issue with the collector after making the change above (due to our firewall running FortiOS 7.4.3).

Prior to modifying "managed_switch.go" and rebuilding, the exporter was returning metrics for everything except the FortiSwitches (which led to chase down the problem and find the note above re: changing the path).

Now when running the exporter, the probe's metrics fail to load at all and instead there are only errors re: switch metric collection:

image

@fg-pi fg-pi changed the title FortiSwitch API endpoint inaccessible? FortiSwitch API causing issues with collector returning metrics May 2, 2024
@fg-pi
Copy link
Author

fg-pi commented May 7, 2024

I believe I have resolved the issue by changing json:"name" to json:"switch-id" in the Results struct in managed_switch.go. It seems Fortinet changed the naming convention in FortiOS 7.4.3; "switch-id" is the friendly name of the device.

@hexionas
Copy link

hexionas commented Jun 3, 2024

I've created an MR that should fix this:
#290

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants