softether_exporter

Prometheus exporter for SoftEther VPN server

Build 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 | softether_exporter Build information | version, revision, rustversion |

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 [config_file]

The format of config_file is below.

``` listenport = 9411 # listenport of expoter ( 9411 is the default port of softether_exporter ) 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" ```