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

Samples of working configurations.
Locked
justjust
OpenVpn Newbie
Posts: 2
Joined: Sat Jan 02, 2016 8:00 pm

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

Post by justjust » Sat Jan 02, 2016 8:14 pm

Hello,

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
duplicate-cn
plugin /etc/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnf
client-cert-not-required
username-as-common-name

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
END

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,108.168.204.209:15400,,43,14,Sat Jan 2 22:35:45 2016,1451763345,UNDEF
CLIENT_LIST,xxxxxxxxxxxxx,xx.xxx.xxx.xx:53258,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,xx.xxx.xxx.xx:53258,Sat Jan 2 22:35:44 2016,1451763344
GLOBAL_STATS,Max bcast/mcast queue length,0
END

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!

justjust
OpenVpn Newbie
Posts: 2
Joined: Sat Jan 02, 2016 8:00 pm

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

Post by justjust » Sun Jan 03, 2016 12:55 pm

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.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4081
Joined: Sat Aug 09, 2014 11:24 am

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

Post by Traffic » Wed Jan 06, 2016 2:49 pm

Hi, thanks for letting us know your solution 8-)

Locked