Page 1 of 1

Getting connected/disconnected status

Posted: Thu Aug 11, 2022 4:06 pm
by adamhamlin
Hi,

I'm using version 3.3.5. I'd like to be able to determine--programmatically, from command line--whether or not my client is connected to the OpenVPN server. It doesn't need to be 100% accurate; i.e. it's ok if it says things are connected a split second before they actually are.

Some things I've tried:
  • I know there would be differences in ifconfig, but w/o the diff seems hard to generally make that determination (e.g., it won't "always" be utun2)
  • Maybe I could ping a host that is only reachable via the VPN, but let's assume ICMP has been disabled on any such host
  • The log file button in top right corner of the app provides rich logs, but I don't know where they exist on my machine (maybe they only live on the server?)
  • The only log file I've found of any possible use is at /private/var/log/ovpnagent.log, but it's esoteric and would be a big stretch to use it for this purpose
Ideally I'd like to not have to mess with the 2.x client.

Any help would be greatly appreciated, thanks!

Re: Getting connected/disconnected status

Posted: Sat Aug 13, 2022 4:42 pm
by openvpn_inc
Hi Adam,

Please see Locating the Client Log Files.

regards, rob0