Sign inSign up

torilabs/ipsec-prometheus-exporter

By torilabs

•Updated 11 days ago

Prometheus exporter for strongSwan IPsec

Image
Monitoring & observability
0

10K+

torilabs/ipsec-prometheus-exporter repository overview

⁠IPSec Prometheus Exporter

The IPSec Prometheus exporter subscribes to the strongSwan via Vici API and exposes Security Associations⁠ (SAs) metrics. Optionally X509 certificate⁠ and connection configuration⁠ metrics can be turned on.

Collected metrics (together with application metrics) are exposed on /metrics endpoint. Prometheus target is then configured with this endpoint and port e.g. http://localhost:8079/metrics.

⁠Configuration

IPSec Prometheus exporter is configured via command-line arguments. If not provided, the default values are used.

⁠Command-line arguments

If the default value match with your choice you can omit it.

Options and default values:
--server-port=8079              Application listen port where the collected metrics are available
--server-host=""                Application listen host where the collected metrics are available (empty for all hosts)
--log-level=info                Logging level (debug, info, warn, error)
--vici-network=tcp              Vici network scheme (tcp, udp, unix)
--vici-address=localhost:4502   IP address or hostname with a port or unix socket path
                                IPv6 is supported. Use address in format of "[fd12:3456:789a::1]:4502"
--enable-cert-metrics=false     Enable collecting of X509 certificate metrics (true, false)
--enable-conn-metrics=false     Enable collecting of connection configuration metrics (true, false)

⁠Value Definition

MetricValueDescription
strongswan_*_status0The tunnel is installed and is up and running.
strongswan_*_status1The connection is established.
strongswan_*_status2The tunnel or connection is down.
strongswan_*_status3The tunnel or connection status is not recognized.

⁠Build & Run

To build the binary run:

make build

Run the binary with optional arguments provided:

./ipsec-prometheus-exporter [--server-port=8079] [--server-host=""] [--log-level=info] [--vici-network=tcp] [--vici-address=localhost:4502] [--enable-cert-metrics=false] [--enable-conn-metrics=false]

⁠Docker image

Public docker image is available for multiple platforms: https://hub.docker.com/r/torilabs/ipsec-prometheus-exporter⁠

docker run -it -p 8079:8079 --rm torilabs/ipsec-prometheus-exporter:latest --server-port=8079

Tag summary

Content type

Image

Digest

sha256:a804c0436…

Size

10.4 MB

Last updated

11 days ago

docker pull torilabs/ipsec-prometheus-exporter