softether_exporter

Prometheus exporter for SoftEther VPN server

Actions Status Crates.io

Exported Metrics

| metric | description | labels | | ------------------------------------ | -------------------------------------- | ------------------------------ | | softetherup | The last query is successful | hub | | softetheronline | Hub is online | hub | | softethersessions | Number of sessions | hub | | softethersessionsclient | Number of client sessions | hub | | softethersessionsbridge | Number of bridge sessions | hub | | softetherusers | Number of users | hub | | softethergroups | Number of groups | hub | | softethermactables | Number of entries in MAC table | hub | | softetheriptables | Number of entries in IP table | hub | | softetherlogins | Number of logins | hub | | softetheroutgoingunicastpackets | Outgoing unicast transfer in packets | hub | | softetheroutgoingunicastbytes | Outgoing unicast transfer in bytes | hub | | softetheroutgoingbroadcastpackets | Outgoing broadcast transfer in packets | hub | | softetheroutgoingbroadcastbytes | Outgoing broadcast transfer in bytes | hub | | softetherincomingunicastpackets | Incoming unicast transfer in packets | hub | | softetherincomingunicastbytes | Incoming unicast transfer in bytes | hub | | softetherincomingbroadcastpackets | Incoming broadcast transfer in packets | hub | | softetherincomingbroadcastbytes | Incoming broadcast transfer in bytes | hub | | softetherbuildinfo | softetherexporter Build information | version, revision, rustversion | | softetherusertransferpackets | User transfer in packets | hub, user | | softetherusertransfer_bytes | User transfer in bytes | hub, user |

Query Example

Outgoing unicast packet rate of HUB1 is below.

rate(softether_outgoing_unicast_packets{hub="HUB1"}[1m])

Install

Download from release page, and extract to any directory ( e.g. /usr/local/bin ). See the example files in example directory as below.

| File | Description | | ---------------------------------- | ------------------------------ | | example/softetherexporter.service | systemd unit file | | example/config.toml | softetherexporter config file |

If the release build doesn't fit your environment, you can build and install from source code.

cargo install softether_exporter

Requirement

softether_exporter uses vpncmd or vpncmd.exe to access SoftEther VPN server. The binary can be got from SoftEther VPN Download.

Usage

``` softether_exporter 0.1.5

USAGE: softether_exporter [FLAGS] [OPTIONS] --config.file

FLAGS: -v, --verbose Show verbose message -h, --help Prints help information -V, --version Prints version information

OPTIONS: --web.listen-address Address on which to expose metrics and web interface [default: :9411]

    --config.file <config>                   Config file

```

The format of <config> is below.

``` vpncmd = "/usr/local/bin/vpncmd" # path to vpncmd binary server = "localhost:8888" # address:port of SoftEther VPN server

[[hubs]] name = "HUB1" # HUB name password = "xxx" # HUB password

[[hubs]] name = "HUB2" password = "yyy" ```