Skip to content

fix(probe): use switch-id field for managed switch name on FortiOS 7.4+ - #400

Merged
bastischubert merged 2 commits into
mainfrom
bastischubert/fixswitchid
Apr 20, 2026
Merged

fix(probe): use switch-id field for managed switch name on FortiOS 7.4+#400
bastischubert merged 2 commits into
mainfrom
bastischubert/fixswitchid

Conversation

@bastischubert

Copy link
Copy Markdown
Contributor

FortiOS 7.4 replaced the 'name' field with 'switch-id' in the
managed-switch/status API response. Without this fix, all switches
had an empty switch_name label causing duplicate metric errors.

Fixes: #392

  FortiOS 7.4 replaced the 'name' field with 'switch-id' in the
  managed-switch/status API response. Without this fix, all switches
  had an empty switch_name label causing duplicate metric errors.

  Fixes: #392

Signed-off-by: Sebastian Schubert <basti@schubert.digital>
@bastischubert
bastischubert requested a review from SuperQ April 19, 2026 07:27
@bastischubert

Copy link
Copy Markdown
Contributor Author

@Philldomd fyi

@Philldomd

Copy link
Copy Markdown
Contributor

We should look into how to test that with go test somehow. A step called prom validation that does more than check strings against each other. Add a test file for this so the ci passes for now.

Signed-off-by: Sebastian Schubert <basti@schubert.digital>
@bastischubert

Copy link
Copy Markdown
Contributor Author

@Philldomd sorry i seem to have missed the testdata in the commit earlier today.

@WatchCollector67

Copy link
Copy Markdown

looks good guys <3

@bastischubert
bastischubert merged commit 3970a56 into main Apr 20, 2026
9 checks passed
@bastischubert
bastischubert deleted the bastischubert/fixswitchid branch April 20, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

switch_name label empty for all managed switches — API returns switch-id not name

4 participants