Page 1 of 1
[SOLVED] howto know status of openvpn client ?
Posted: Thu Feb 02, 2012 1:28 pm
by tushar.sharma
Hello All,
howto know status of openvpn client connected to server.
in openvpn --status when done with server side it shows status of all connected client,
but if I am running as client mode and connecting to server in daemon mode
how can i know status of client ( what if there are many ?) ? like in --status ?
Thanking YOu
Tushar
Re: howto know status of openvpn client ?
Posted: Thu Feb 02, 2012 10:16 pm
by janjust
you can use --status or at least the management interface on the client side as well - this gives you a programmatic way to check if a client is up and running.
Re: howto know status of openvpn client ?
Posted: Fri Feb 03, 2012 5:46 am
by tushar.sharma
Dear Jan Just,
--status on client side shows like this
Status
OPen VPN STATISTICS
Updated Fri Feb 10:43
TUN/TAP read bytes 1231
TUN/TAP write bytes 1072
Auth read bytes xxxx
END
I don't know to parse this whether client is connected or not.
and using management interface i need to telnet to particular, I want that whenever client succesfully authenticates its status something like Peer Connection With 192.168.103.61 Initiated to be stored in file so that i can retrieve it any time.
can i use ?
--client-connect script
--route-up
Thanking You
Tushar
Re: howto know status of openvpn client ?
Posted: Fri Feb 03, 2012 6:16 am
by tushar.sharma
i have even tried changing status-version 1,2,3 but same results.
Thanking You
Tushar
Re: howto know status of openvpn client ?
Posted: Tue Feb 07, 2012 5:41 am
by tushar.sharma
Do i need to grep output from log files ??
Thanking You
Tushar
Re: howto know status of openvpn client ?
Posted: Tue Feb 07, 2012 9:52 am
by janjust
TUN/TAP read bytes 1231
TUN/TAP write bytes 1072
the fact that bytes are read from and written to the tun/tap adapter is an indication that the VPN is functional; other than that there is no (easy) method to see whether the VPN is active; your best bet is to simply ping the VPN server IP.
Re: howto know status of openvpn client ?
Posted: Tue Feb 07, 2012 1:57 pm
by tushar.sharma
Dear JanJust,
I got some info regarding use of management client to display status of client on GUI interface, I didnt exactly
got what they actually want to convey but i will try other way and will try to look in more detail what you have suggested.
Re: howto know status of openvpn client ?
Posted: Mon Feb 13, 2012 4:32 am
by tushar.sharma
Hey JanJust, i have determine whether client is connected or not using management interface
and state command in that. I have opened tcp socket on management interface and determine status of client using state command.
Still It is giving only whether client is connected or not, and i want time too i.e from when since client is connected. This information is even not there in status command.
From where can i get whether particular client instance is connected and time since when it is connected. ?
Thanking You
tushar
Re: howto know status of openvpn client ?
Posted: Mon Feb 13, 2012 3:24 pm
by janjust
you can only get that information by parsing the client connect logs; alternatively you could use an 'up' and 'down' script to launch an external program which records the date&time.
Re: howto know status of openvpn client ?
Posted: Tue Feb 14, 2012 5:46 am
by tushar.sharma
Dear JanJust,
Done that using up and down script as suggest by Dazo on irc channel..Thanks for replying.
Thanking You,
Tushar