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

Add multi-target support #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rodecker
Copy link

By calling target=myswitch.local,myotherswitch.local multiple switches can be queried at once.
Alternatively, target=all can be used to query a list of targets specified in the config file.
All metrics get an additional target label to distinguish values from different switches.

This functionality is particularly useful when calling the exporter via an exporter-exporter proxy.

Martin Pels added 3 commits March 28, 2023 17:22
By calling `target=myswitch.local,myotherswitch.local` multiple switches can be queried at once.
Alternatively, `target=all` can be used to query a list of targets specified in the config file.
All metrics will get an additional `target` label to distinguish values from different switches.

This functionality is particularly useful when calling the exporter via an exporter-exporter proxy.
The `show ip bgp summary` and `show ipv6 bgp summary` commands only return sessions from the main vrf.
Adding `vrf all` makes the commands return sessions from all vrfs.
@zloo
Copy link
Member

zloo commented Mar 30, 2023

Thank you, this looks great! Do you already run this version?

I went through the code and don't have any comments or suggestions, other than I would probably go about it the other way around - i.e. iterate over switches and do everything on one switch, then move to the next one. That way it would be easier to parallelize if we ever come to a point where it takes too long to fetch the metrics, because the main bottleneck I've seen so far is waiting for the switch to respond to show commands. Handling each switch in parallel would remove this bottleneck.

That being said, i've never run into this issue so I'm okay with merging this as is unless someone objects.

@rodecker
Copy link
Author

Hi @zloo,

I currently have this code running on a lab server against our production switches. I intend to move it to a permanent home shortly.

I did not consider the parallelization case, as our environment only consists of a handful devices. With that scraping still only takes a few seconds, even with all modules enabled. For larger deployments (100+ devices) some more work is probably needed, like persistent connections.

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

Successfully merging this pull request may close these issues.

2 participants