czerwonk / junos_exporter

Exporter for devices running JunOS to use with https://prometheus.io/
MIT License
198 stars 81 forks source link

Globally defined features are not inherited if feature option is set per device #233

Open netaviator opened 1 year ago

netaviator commented 1 year ago

Maybe it's just me misunderstanding the function but the inheritance of the feature configuration is not working as I would expect it. My idea was to configure a basic/minimum feature-set globally and have a overwrite per device similar to the following configuration.

devices:
# Routers
  - host: ..*.my-other.tld
    host_pattern: true
    username: monitoring
    key_file: /etc/prometheus/monitoring.key
    features:
      bgp: true
      bfd: true
      l2circuit: true
      ldp: true
      fpc: true
      rpki: true
# Switches
  - host: .*.my.tld
    host_pattern: true
    username: monitoring
    key_file: /etc/prometheus/monitoring.key

# Default Values
features:
  alarm: true
  environment: true
  bgp: false
  bfd: false
  ospf: false
  isis: false
  nat: false
  l2circuit: false
  ldp: false
  routes: true
  routing_engine: true
  firewall: true
  interfaces: true
  interface_diagnostic: false
  interface_queue: false
  storage: true
  accounting: false
  ipsec: false
  fpc: true
  rpki: false
  rpm: false
  satellite: false
  system: true
  power: true

If I scrape devices via the exporter, the switches are showing all the "basic" information just fine but routers are only showing the additional features. I've now added the feature parameter per group to make it working but I thought it might be something to think and talk about.