Giter Club home page Giter Club logo

Comments (3)

fdomain avatar fdomain commented on June 20, 2024 1

Yes, this is something doable.

Output example from occtl --json show users:

    "Connected at":  "2023-09-22 04:28",
    "_Connected at":  " 9h:46m",

What should be done is to parse the duration of "_Connected at" value.
Don't hesitate to propose a PR if you're interested, otherwise I'll have a look soon.

from ocserv-exporter.

fdomain avatar fdomain commented on June 20, 2024 1

After looking closer into this, the values returned in Connected at or _Connected at are not consistent enough (the format changes depending on the connection time).
I proposed a PR on ocserv project to display the raw value of the connection start time (unix timestamp).

Depending on its acceptance, I'll make the required change on ocserv-exporter.
The only thing you'll have to do on Prometheus is to compute the uptime by doing something like:

time() - vpn_user_start_time_seconds

from ocserv-exporter.

fdomain avatar fdomain commented on June 20, 2024

The PR is accepted, so I added vpn_user_start_time_seconds metric (see 11796a5).

It relies on the presence of the raw_connected_at field in JSON output of occtl, which will be most likely available with version 1.2.3 of ocserv.

from ocserv-exporter.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.