Disconnect script not executed after ping timeout
Posted: Thu Jun 09, 2016 9:41 am
Hello. 
I want to monitor which user was connected for how long and how much traffic has been used in this time. For this I created a connect script which creates an entry in a database that the user connected and a disconnect script which updates the entry with the disconnect time and traffic volume. The scripts are working totally fine but sadly the disconnect script is sometimes not executed. I have been debugging this for quite some time and I think I found the problem for the disconnect script not beeing executed.
Here is a scenario:
The user connected, the connect script has been called and an entry in the database was created. But then the user seems to get a ping timeout. This is the log from the serverside:
I would expect the disconnect script beeing called after this timeout, as the user is not directly reconnecting and the traffic volume should be stored. 45 minutes later the user finally reconnects and the connect script is called again and creates a new entry. Sadly the old database entry is still empty and shows that the user is still connected. Also the traffic used in the old session is lost and was not stored in the old entry.
Does anybody have an idea how to solve this problem? Or is there a "better" way to monitor which user was connected for how long and to see how much traffic has been used by him?
Thanks for your help.

I want to monitor which user was connected for how long and how much traffic has been used in this time. For this I created a connect script which creates an entry in a database that the user connected and a disconnect script which updates the entry with the disconnect time and traffic volume. The scripts are working totally fine but sadly the disconnect script is sometimes not executed. I have been debugging this for quite some time and I think I found the problem for the disconnect script not beeing executed.
Here is a scenario:
The user connected, the connect script has been called and an entry in the database was created. But then the user seems to get a ping timeout. This is the log from the serverside:
Code: Select all
Thu Jun 9 01:09:42 2016 us=4118 username/*.*.*.*:12946 [username] Inactivity timeout (--ping-restart), restarting
Thu Jun 9 01:09:42 2016 us=4217 username/*.*.*.*:12946 SIGUSR1[soft,ping-restart] received, client-instance restarting
Does anybody have an idea how to solve this problem? Or is there a "better" way to monitor which user was connected for how long and to see how much traffic has been used by him?
Thanks for your help.