Page 1 of 1

[Solved] status.log resets while there are connected users

Posted: Sat Jan 02, 2016 8:14 pm
by justjust

I have setup openvpn with freeradius as authenticating software. openvpn server is on CentOS 6.7. In openvpn config I am including

status /etc/openvpn/openvpn-status.log 60
status-version 2
plugin /etc/openvpn/ /etc/openvpn/radiusplugin.cnf

lines. My problem begins when I want to detect the number of logins one client does. For this, I use checkrad script on the freeradius server and that script uses SNMP. I was able to make checkrad read openvpn-status.log file by SNMP. But the problem is that openvpn-status.log file changes frequently. It once gives the connected clients' info but then it gives nothing.

For example when there are connected users openvpn-status.log reads

TITLE OpenVPN 2.3.8 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Aug 4 2015
TIME Sat Jan 2 23:06:57 2016 1451765217
HEADER CLIENT_LIST Common Name Real Address Virtual Address Bytes Received Bytes Sent Connected Since Connected Since (time_t) Username
HEADER ROUTING_TABLE Virtual Address Common Name Real Address Last Ref Last Ref (time_t)
GLOBAL_STATS Max bcast/mcast queue length 0

And this changes for 2-4 second (I use watch) to

TITLE,OpenVPN 2.3.8 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Aug 4 2015
TIME,Sat Jan 2 22:35:46 2016,1451763346
HEADER,CLIENT_LIST,Common Name,Real Address,Virtual Address,Bytes Received,Bytes Sent,Connected Since,Connected Since (time_t),Username
CLIENT_LIST,UNDEF,,,43,14,Sat Jan 2 22:35:45 2016,1451763345,UNDEF
CLIENT_LIST,xxxxxxxxxxxxx,,10.x.x.x,10290,11235,Sat Jan 2 22:35:17 2016,1451763317,xxxxxxxxxxxx
HEADER,ROUTING_TABLE,Virtual Address,Common Name,Real Address,Last Ref,Last Ref (time_t)
ROUTING_TABLE,10.x.x.x,xxxxxxxxxxxxxxxx,,Sat Jan 2 22:35:44 2016,1451763344
GLOBAL_STATS,Max bcast/mcast queue length,0

Then is gives no info again for about minutes.

Isn't that file supposed to stay the same when there are clients connected and give the info persistently?

Is there anything I can do to get the client status info from this file in a persistent manner?

Thanks for your help!

Re: openvpn-status.log resets while there are connected user

Posted: Sun Jan 03, 2016 12:55 pm
by justjust
I solved the problem. The point is that I have two openvpn config files, one for udp and one for tcp. I had written openvpn-status.log (the same file name) in both configs. When I changed the one in tcp config file to openvpn-status01.log, things become stable.

Re: openvpn-status.log resets while there are connected user

Posted: Wed Jan 06, 2016 2:49 pm
by Traffic
Hi, thanks for letting us know your solution 8-)