The
VPN Client
'/etc/openvpn/clientX/status' file does not track/contain the
UP time
However, a crude method would be to manually record the
VPN Client
initialised time (to a file) using the
openvpn-event '
vpnclientX-up' trigger script
e.g.
VPN Client 4
Code:
VPN_ID=4;echo "$(date "+%F %T")" > /tmp/vpnclient$VPN_ID.log
then when appropriate you can simply compare the timestamp in
'/tmp/vpnclient$VPN_ID.log' to the current time to calculate the elapsed duration.
e.g. Determine the
TOTAL (
PID UP time) in the
openvpn-event vpnclientX-down trigger script.
Alternatively you could use a
SyslogEventMonitor script to track the
VPN Client events and calculate the actual duration in more detail.