|
| 1 | +# IPsec Exporter |
| 2 | + |
| 3 | +[](https://github.com/sergeymakinen/ipsec_exporter/actions?query=workflow%3Atests) |
| 4 | +[](https://pkg.go.dev/github.com/sergeymakinen/ipsec_exporter) |
| 5 | +[](https://goreportcard.com/report/github.com/sergeymakinen/ipsec_exporter) |
| 6 | +[](https://codecov.io/gh/sergeymakinen/ipsec_exporter) |
| 7 | + |
| 8 | +Export strongswan/libreswan IPsec stats to Prometheus. |
| 9 | + |
| 10 | +To run it: |
| 11 | + |
| 12 | +```bash |
| 13 | +make |
| 14 | +./ipsec_exporter [flags] |
| 15 | +``` |
| 16 | + |
| 17 | +## Exported Metrics |
| 18 | + |
| 19 | +| Metric | Meaning | Labels |
| 20 | +| --- | --- | --- |
| 21 | +| ipsec_up | Was the last scrape successful. | |
| 22 | +| ipsec_uptime_seconds | Number of seconds since the daemon started. | |
| 23 | +| ipsec_workers_total | Number of worker threads. | |
| 24 | +| ipsec_idle_workers | Number of idle worker threads. | |
| 25 | +| ipsec_active_workers | Number of threads processing jobs. | |
| 26 | +| ipsec_queues | Number of queued jobs. | priority |
| 27 | +| ipsec_ike_sas | Number of currently registered IKE SAs. | |
| 28 | +| ipsec_half_open_ike_sas | Number of IKE SAs in half-open state. | |
| 29 | +| ipsec_pool_ips_total | Number of addresses in the pool. | name, address |
| 30 | +| ipsec_online_pool_ips | Number of leases online. | name, address |
| 31 | +| ipsec_offline_pool_ips | Number of leases offline. | name, address |
| 32 | +| ipsec_ike_sa_state | IKE SA state. Created: 0, connecting: 1, established: 2, passive: 3, rekeying: 4, rekeyed: 5, deleting: 6, destroying: 7. | name, uid, version, local_host, local_id, remote_host, remote_id, remote_identity, vips |
| 33 | +| ipsec_ike_sa_established_seconds | Number of seconds since the IKE SA has been established. | name, uid, version, local_host, local_id, remote_host, remote_id, remote_identity, vips |
| 34 | +| ipsec_child_sa_state | Child SA state. Created: 0, routed: 1, installing: 2, installed: 3, updating: 4, rekeying: 5, rekeyed: 6, retrying: 7, deleting: 8, deleted: 9, destroying: 10. | ike_sa_name, ike_sa_uid, name, uid, mode, protocol, local_ts, remote_ts |
| 35 | +| ipsec_child_sa_bytes_in | Number of input bytes processed. | ike_sa_name, ike_sa_uid, name, uid, mode, protocol, local_ts, remote_ts |
| 36 | +| ipsec_child_sa_packets_in | Number of input packets processed. | ike_sa_name, ike_sa_uid, name, uid, mode, protocol, local_ts, remote_ts |
| 37 | +| ipsec_child_sa_bytes_out | Number of output bytes processed. | ike_sa_name, ike_sa_uid, name, uid, mode, protocol, local_ts, remote_ts |
| 38 | +| ipsec_child_sa_packets_out | Number of output packets processed. | ike_sa_name, ike_sa_uid, name, uid, mode, protocol, local_ts, remote_ts |
| 39 | +| ipsec_child_sa_installed_seconds | Number of seconds since the child SA has been installed. | ike_sa_name, ike_sa_uid, name, uid, mode, protocol, local_ts, remote_ts |
| 40 | + |
| 41 | +### Flags |
| 42 | + |
| 43 | +```bash |
| 44 | +./ipsec_exporter --help |
| 45 | +``` |
| 46 | + |
| 47 | +* __`vici.address`:__ VICI socket address. Example: `unix:///var/run/charon.vici` or `tcp://127.0.0.1:4502`. |
| 48 | +* __`vici.timeout`:__ VICI socket connect timeout. |
| 49 | +* __`collector`:__ Collector type to scrape metrics with. `vici` or `ipsec`. |
| 50 | +* __`ipsec.command`:__ Command to scrape IPsec metrics when the collector is configured to an `ipsec` binary. |
| 51 | +* __`web.listen-address`:__ Address to listen on for web interface and telemetry. |
| 52 | +* __`web.telemetry-path`:__ Path under which to expose metrics. |
| 53 | +* __`log.level`:__ Logging level. `info` by default. |
| 54 | +* __`log.format`:__ Set the log target and format. Example: `logger:syslog?appname=bob&local=7` |
| 55 | + or `logger:stdout?json=true`. |
| 56 | + |
| 57 | +### TLS and basic authentication |
| 58 | + |
| 59 | +The ipsec_exporter supports TLS and basic authentication. |
| 60 | +To use TLS and/or basic authentication, you need to pass a configuration file |
| 61 | +using the `--web.config.file` parameter. The format of the file is described |
| 62 | +[in the exporter-toolkit repository](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md). |
0 commit comments