junos_exporter icon indicating copy to clipboard operation
junos_exporter copied to clipboard

Allow disabling features per device or fallback more gracefully

Open mweinelt opened this issue 2 years ago • 2 comments

We are currently trying to roll this out and our smallest devices (EX2200) simply don't support power metering.

> show chassis power 
error: command is not valid on the ex2200-c-12t-2g

which makes the export for that complete device fail

Could not connect to switch.example.net: could not connect to device: ssh: handshake failed: EOF
Power: expected element type <rpc-reply> but have <command>

One solution to this could be to allow disabling features on a per device basis. Ideally this could be extended to a grouping logic. Another approach I could imagine would be to notice these kinds of responses and disable the feature for this device at runtime.

mweinelt avatar Aug 13 '21 13:08 mweinelt

As of today you already can define a feature set for a device. At the moment it has to be the complete set (not an override). I will addresss this topic in the future. I added an example in the README for the current approach.

czerwonk avatar Oct 19 '21 09:10 czerwonk

It'd be great if we'd be able to scrape the different groups of metrics per device dynamically (i.e., not just through the config file), e.g., http://localhost:9326/metrics?target=1.2.3.4&features=isis,bgp,rpki / http://localhost:9326/metrics?target=5.6.7.8&features=storage,fpc,alarm. Would you be open to something like this @czerwonk?

mirceaulinic avatar Dec 29 '21 10:12 mirceaulinic