dalance / softether_exporter

Prometheus Exporter of SoftEther VPN Server
MIT License
33 stars 5 forks source link

Options for authentication #87

Open Maximebb opened 2 years ago

Maximebb commented 2 years ago

Hi,

I'm running softether servers with dynamic hubs that are added and removed regularly. I can't have a single static config for each hub as the doc suggests.

Is there a way to specify the server password instead to pull those metrics? I'm thinking having a config file like so:

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

[[server]]
password = "xxx"
robisetiapermadi commented 10 months ago

Hello,

I had same problem with you. So, I forked this repo and modified the source code.

The result of my modification is that the configuration file only defines adminpassword instead of hub password.

But, we still need to define the HUB that we will be monitoring. I work around this by creating a cronjob to generate the HUB list and then if there is a new HUB list, the cronjob will re-generate the configuration file and restart the service.

Here's to the repo .

So, the new format for configuration file is below:

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

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

[[hubs]]
name     = "HUB2"

You can build the binary with cargo using below command:

cargo install softether_exporter --branch dev --git https://github.com/robisetiapermadi/softether_exporter.git

Thank you