Score:0

How to view total traffic usage of each user in ocserv

mw flag

I'm using ocserv as VPN server in my company on ubuntu, and I want to view how much traffic each user is using. Users are set in ocpsswd file. Do ocserv have this feature or any library I can use? As I search Google and I'm confused. Anybody can help me?

Score:0
st flag

connect your server with putty and run this command

occtl show users

this command will return all connected users with IDs Result of above command

then type this command to view particular user stats

occtl id [ID from the above command first colum]

occtl id 1662451

result of the command

occtl is built-in command of ocserv

Hamed Zargar avatar
mw flag
Really thanks for your answer, as I determined, occtl show id is showing user usage for current session only. Is there a way to see or calculate for a period for example a month? Or any file logging all session info everytime a user disconnects and reconnects?
Hamed Zargar avatar
mw flag
I've tested several ways for a lightweight approach. Vnstat is doing great. and Openconnect server is using different interface names VPNS{number}. The problem is that everytime a user connects and opens a session, a new interface name is assigned to him/her. Is there a way to avoid changing interface names per session for each user?
Score:0
eu flag

Consider using ntopng panel to control and monitor traffic. Or you can run multiple instances of ocserv on your server and let each user use one.

Hamed Zargar avatar
mw flag
Thanks a lot. I,ve tried ntopng and seems that most features are premium. Prefer a more lightweight way maybe. Running multiple ocserv for 15 users is so weird.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.