Getting connected/disconnected status

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
adamhamlin
OpenVpn Newbie
Posts: 1
Joined: Thu Aug 11, 2022 3:49 pm

Getting connected/disconnected status

Post by adamhamlin » Thu Aug 11, 2022 4:06 pm

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!

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1333
Joined: Tue Feb 16, 2021 10:41 am

Re: Getting connected/disconnected status

Post by openvpn_inc » Sat Aug 13, 2022 4:42 pm

Hi Adam,

Please see Locating the Client Log Files.

regards, rob0
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

Post Reply