Task was to find out who is logged in by openvpn to our Sophos UTM 9.

this does not give results

I could not find any hints in SNMP-output nor "cc get_objects" (this is for configuration not for monitoring).

this works

ssh root@sophos-utm.local

/usr/local/bin/openvpn_connections.sh

OpenVPN CLIENT LIST
Updated,Wed Mar 25 10:53:27 2020
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
openvpn-myuser1,1.2.3.4:63969,4333648,11695199,Wed Mar 2 06:58:51 2020
openvpn-myuser25,1.20.36.99:55371,9183690,57628351,Wed Mar 2 07:28:08 2020
REF_AaaUse99,30.50.20.1:53100,16113267,48635679,Wed Mar 2 05:01:58 2020
...

I am using this output to feed a webservice via a perl-script which gives me data for PRTG, my monitoring-tool with the sensor "Http Data Advanced"

http://prtghelper.local/prtg-openvpn-utm

{
prtg: {
  text: "openvpn-sophos"
  result: [
    {
      value: 16,
      channel: "openvpn-connections-number"
    },
    {
      channel: "openvpn-myuser1"
      value: 1,
    },
    ...
  ],
}

This is what you need to implement this solution

  • Extra Linux-Webserver which runs a perl-script (or other language to ssh to UTM and parse the output)
  • Open SSH in Sophos to the Linux Webserver for it to get the data for openvpn

Article Comments