{"id":21293129,"url":"https://github.com/criteo/ocserv-exporter","last_synced_at":"2026-03-04T08:02:32.992Z","repository":{"id":185654320,"uuid":"673689431","full_name":"criteo/ocserv-exporter","owner":"criteo","description":"ocserv exporter for Prometheus","archived":false,"fork":false,"pushed_at":"2023-09-29T10:46:17.000Z","size":43,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-06T06:07:16.764Z","etag":null,"topics":["metrics","monitoring","ocserv","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/criteo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-02T07:47:58.000Z","updated_at":"2025-03-25T06:13:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"968bf41e-e410-48aa-8a2a-627607e3ffb9","html_url":"https://github.com/criteo/ocserv-exporter","commit_stats":{"total_commits":19,"total_committers":3,"mean_commits":6.333333333333333,"dds":"0.10526315789473684","last_synced_commit":"98d992d85fc3a81d892764fe7b6ae8ac89e9190e"},"previous_names":["criteo/ocserv-exporter"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/criteo/ocserv-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Focserv-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Focserv-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Focserv-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Focserv-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/criteo","download_url":"https://codeload.github.com/criteo/ocserv-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Focserv-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30075918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["metrics","monitoring","ocserv","prometheus","prometheus-exporter"],"created_at":"2024-11-21T13:53:29.849Z","updated_at":"2026-03-04T08:02:32.977Z","avatar_url":"https://github.com/criteo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest](https://img.shields.io/github/v/release/criteo/ocserv-exporter)](https://github.com/criteo/ocserv-exporter/releases)\n[![Go](https://img.shields.io/github/go-mod/go-version/criteo/ocserv-exporter)](https://github.com/criteo/ocserv-exporter)\n[![CI](https://github.com/criteo/ocserv-exporter/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/criteo/ocserv-exporter/actions/workflows/ci.yml)\n[![GitHub](https://img.shields.io/github/license/criteo/ocserv-exporter)](https://github.com/criteo/ocserv-exporter/blob/main/LICENSE)\n\n# Prometheus ocserv exporter\n\nThis exporter allows to expose statistics from `ocserv` in Prometheus format.\nIt simply parses the output of `occtl` tool to gather VPN server and user statistics.\n\n# Usage\n\n## Installation\n\nBinaries can be download from the [Github releases](https://github.com/criteo/ocserv-exporter/releases) page.\n\n\n## Running\n\nStart `ocserv-exporter` as a daemon or from CLI on the same host running `ocserv` (`use-occtl = true` must be set in ocserv configuration):\n\n```sh\n$ ./ocserv-exporter\n```\n\n```sh\n$ curl -s http://127.0.0.1:8000/metrics\nocctl_status_scrape_error_total 0\nocctl_users_scrape_error_total 0\nvpn_active_sessions 29\nvpn_authentication_failures 32\nvpn_average_auth_time_seconds 0\nvpn_average_session_time_seconds 9960\nvpn_closed_error_sessions 0\nvpn_handled_sessions 589\nvpn_ips_banned 0\nvpn_max_auth_time_seconds 46\nvpn_max_session_time_seconds 43200\nvpn_rx_bytes 2.4823e+07\nvpn_sessions_handled 139\nvpn_timed_out_idle_sessions 0\nvpn_timed_out_sessions 0\nvpn_total_authentication_failures 171\nvpn_tx_bytes 2.84913e+08\nvpn_user_rx_bytes{device=\"vpns0\",mtu=\"1434\",remote_ip=\"203.0.113.0\",username=\"j.doe\",vpn_ipv4=\"10.0.0.1\",vpn_ipv6=\"\"} 962053\nvpn_user_rx_bytes{device=\"vpns1\",mtu=\"1434\",remote_ip=\"203.0.113.1\",username=\"a.bob\",vpn_ipv4=\"10.0.0.2\",vpn_ipv6=\"\"} 532733\nvpn_user_tx_bytes{device=\"vpns0\",mtu=\"1434\",remote_ip=\"203.0.113.0\",username=\"j.doe\",vpn_ipv4=\"10.0.0.1\",vpn_ipv6=\"\"} 3.474418e+06\nvpn_user_tx_bytes{device=\"vpns1\",mtu=\"1434\",remote_ip=\"203.0.113.1\",username=\"a.bob\",vpn_ipv4=\"10.0.0.2\",vpn_ipv6=\"\"} 200146\n```\n\n## Command line flags\n\n| Name     | Description                                                   |\n|----------|---------------------------------------------------------------|\n| interval | Delay between occtl scrape (default 30s)                      |\n| listen   | Prometheus HTTP listen IP and port (default \"127.0.01:8000\")  |\n\n## Prometheus Configuration\n\nExample config:\n```yaml\nscrape_configs:\n  - job_name: 'ocserv-exporter'\n    scrape_interval: 30s\n    static_configs:\n      - targets:\n        - 127.0.0.1:8000  # The ocserv exporter's real ip:port\n    metrics_path: /metrics\n```\n\n# Contributing\n\nContributions are welcome! Before starting work on significant changes, please create an issue first.\n## Commit message\n\nUse [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary).\nConventional commit messages is enforced by the CI.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcriteo%2Focserv-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcriteo%2Focserv-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcriteo%2Focserv-exporter/lists"}