{"id":19044526,"url":"https://github.com/stdevel/check_ovpn_users","last_synced_at":"2025-04-23T23:28:23.254Z","repository":{"id":79816729,"uuid":"116365568","full_name":"stdevel/check_ovpn_users","owner":"stdevel","description":"A Nagios / Icinga plugin for checking the amount of connected OpenVPN users","archived":false,"fork":false,"pushed_at":"2023-12-15T10:53:11.000Z","size":20,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T08:39:30.916Z","etag":null,"topics":["icinga","icinga-plugin","icinga2","icinga2-plugin","ipfire","nagios","nagios-plugins","openvpn","openvpn-client","openvpn-server"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stdevel.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-05T09:10:53.000Z","updated_at":"2023-12-15T10:53:16.000Z","dependencies_parsed_at":"2023-12-15T11:49:03.934Z","dependency_job_id":null,"html_url":"https://github.com/stdevel/check_ovpn_users","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_ovpn_users","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_ovpn_users/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_ovpn_users/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevel%2Fcheck_ovpn_users/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdevel","download_url":"https://codeload.github.com/stdevel/check_ovpn_users/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250531155,"owners_count":21445933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["icinga","icinga-plugin","icinga2","icinga2-plugin","ipfire","nagios","nagios-plugins","openvpn","openvpn-client","openvpn-server"],"created_at":"2024-11-08T22:46:33.050Z","updated_at":"2025-04-23T23:28:23.230Z","avatar_url":"https://github.com/stdevel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"``check_ovpn_users`` is a Nagios/Icinga plugin for checking the amount of logged in OpenVPN users.\n\n# Requirements\nThe plugin requires an installed OpenVPN server and the ``logging`` Python module.\n\n# Usage\nBy default, the script checks the current amount of connected OpenVPN users by reading the log file. It is possible to control this behaviour by specifying additional parameters (*see below*).\nThe script also support performance data for data visualization.\n\nThe following parameters can be specified:\n\n| Parameter | Description |\n|:----------|:------------|\n| `-d` / `--debug` | enable debugging outputs (*default: no*) |\n| `-h` / `--help` | shows help and quits |\n| `-P` / `--show-perfdata` | enables performance data (*default: no*) |\n| `-f` / `--log-file` | defines the OpenVPN server log file (*default: /var/run/ovpnserver.log*) |\n| `-w` / `--users-warning` | defines the user warning threshold (*default: 5*) |\n| `-c` / `--users-critical` | defines the user critical threshold (*default: 10*) |\n| `--version` | prints programm version and quits |\n\n## Examples\nCheck with default thresholds and parameters:\n```\n$ ./check_ovpn_users.py\nOK: OpenVPN users OK (2) |\n```\n\nCheck with customized thresholds:\n```\n$ ./check_ovpn_users.py -w 1 -c 3\nOK: OpenVPN users WARNING (2) |\n```\n\nCheck also reporting performance data:\n```\n$ ./check_ovpn_users.py -P\nOK: OpenVPN users OK (2) | 'ovpn_users'=2;5;10\n```\n\n# Installation\nTo install the plugin, move the Python script into the appropriate directory and create an appropriate **NRPE** or **Icinga2** configuration - check-out the examples in this repository. There is also a spec file for creating a RPM file.\n\n# Configuration\nInside Nagios / Icinga you will need to configure a check, e.g. for Icinga2:\n```\napply Service \"DIAG: OpenVPN users\" {\n  import \"generic-service\"\n  check_command = \"check_ovpn_users\"\n  vars.openvpn_perfdata = true\n  assign where host.vars.os == \"Linux\" \u0026\u0026 host.vars.app == \"router\"\n  ignore where host.vars.noagent\n}\n```\n\nFor agentless systems (*e.g. IPFire/IPCop*), utilize the ``check_by_ssh`` command:\n```\napply Service \"DIAG: OpenVPN users\" {\n  import \"generic-service\"\n  check_command = \"by_ssh\"\n  vars.by_ssh_command = [ \"/opt/check_ovpn_users.py\", \"-P\" ]\n  vars.by_ssh_port = host.vars.ssh_port\n  vars.by_ssh_logname = \"icinga\"\n  assign where host.vars.os == \"Linux\" \u0026\u0026 host.vars.app == \"router\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdevel%2Fcheck_ovpn_users","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdevel%2Fcheck_ovpn_users","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdevel%2Fcheck_ovpn_users/lists"}