[Solved] status.log resets while there are connected users
Posted: 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!
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!