tynany / junos_exporter

Prometheus Exporter for Junos Devices
MIT License
19 stars 7 forks source link

add junos ipsec collector for basic tunnel status #10

Closed cwaynej closed 3 years ago

cwaynej commented 3 years ago

Summary

Adding ipsec collector equivalent SRX commands

show security ipsec inactive-tunnels show security ipsec security-associations

Test output

# HELP junos_collector_up Whether the collector's last scrape was successful (1 = successful, 0 = unsuccessful).
# TYPE junos_collector_up gauge
junos_collector_up{collector="ipsec"} 1
# HELP junos_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which junos_exporter was built.
# TYPE junos_exporter_build_info gauge
junos_exporter_build_info{branch="",goversion="go1.13.8",revision="",version=""} 1
# HELP junos_ipsec_tunnel_status_up Tunnel Status (1 UP, 0 DOWN)
# TYPE junos_ipsec_tunnel_status_up gauge
junos_ipsec_tunnel_status_up{saremotegateway="<removed>",satunnelindex="131075"} 0
junos_ipsec_tunnel_status_up{saremotegateway="<removed>",satunnelindex="67108866"} 1
junos_ipsec_tunnel_status_up{saremotegateway="<removed>",satunnelindex="67108867"} 1
junos_ipsec_tunnel_status_up{saremotegateway="<removed>",satunnelindex="67108868"} 1
junos_ipsec_tunnel_status_up{saremotegateway="<removed>",satunnelindex="67108865"} 0
junos_ipsec_tunnel_status_up{saremotegateway="<removed>",satunnelindex="131073"} 0
# HELP junos_scrape_duration_seconds Time it took for a collector's scrape to complete.
# TYPE junos_scrape_duration_seconds gauge
junos_scrape_duration_seconds{collector="ipsec"} 8.481809263
# HELP junos_scrape_errors_total Total number of errors from a collector.
# TYPE junos_scrape_errors_total gauge
junos_scrape_errors_total{collector="ipsec"} 0
# HELP junos_scrapes_total Total number of times Junos has been scraped.
# TYPE junos_scrapes_total counter
junos_scrapes_total 1

config change:

[...]
enabled_collectors:
  - ipsec
[...]

Please let me know if you need more specifics.

Thanks Chris

tynany commented 3 years ago

Thanks for contributing!