How to use properly openvpn.conf module so we can have per_user_stats?

I have been trying really hard to get per user chart with openvpn, but it seems like no matter what I do, I can’t get it working properly.
Here is a screenshot of the openvpn.conf file
!


and there you can see I am connected to the openvpn server as ipad user:
!
I restarted both, the openvpn server and the netdata, and I watched the log for both to see if there was any error. I have no error. Here is a screenshot
!
And when I went to see the dashboard, I can see a specific chart for ipad user.
!
My goal is to have a specific chart for each connected user to the openvpn server. Until now, I am able to see a chart for all connected users, and a chart for global traffic through the openvpn server, but I can’t have a special chart for each connected user. I am wondering if I the issue is with the syntax format for the per_user_stats parameter.

@derobert,

Can you try different users with different usernames/pw and report back the results?

jobs:
  - name: Server Untrusted
    address: /run/openvpn/server-untrusted.sock
    per_user_stats:
      includes:
        - '* *'

doesn’t seem to be getting me per-user stats either. Maybe it’s my different users are differentiated by different client certificates, not usernames/passwords?

Hey everyone,

@derobert please make sure that you use includes and excludes, rather than include and exclude.

@sestrah - yes, the charts would be created in the openvpn category. Let me look more into it.

Similar issue here, I’ve got

per_user_stats:
  include:
    - '* *'

and running /usr/libexec/netdata/plugins.d/go.d.plugin -d -m openvpn confirms that it’s not generating per-user stats.

Thanks a lot for trying to help me. I actually did exactly as you told. But it doesn’t work. I would like to ask a question. If it worked, where would each user chart appear? I guess they would appear on the the openvpn section. This is where i always look at, after each modification in the openvpn.conf file, and each restart of netdata and refresh the dashboard. I thought, i could see chart for each user with common name of each connected user. But nothing appears to be working except the users, and traffic charts.

Hi @sestrah,

Thanks for posting that on our forums. After talking with my colleagues, can you please try - '= ipad' instead of - == iPad?

Moreover, if you want to create a chart for every user, you can create a pattern to allow any user: - '* *'. This patterns means that you want to use the glob matcher and match for any string *.

We will be improving the docs of our pattern matcher to make it easier for everyone to use it.

Thanks for being an active member of this community and improving our product, in this case, our documentation. It means a lot!

Cheers :slight_smile:

1 Like