Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name

v2.0.1 · public · Published over 4 years ago

Asset Definition
Release Notes
Release Assets

Bonsai Asset Badge
Build Status
Gem Version
Code Climate
Test Coverage
Dependency Status

Sensu OpenVPN Metrics Plugin


This plugin provides native OpenVPN instrumentation for metrics collection of load-stats metrics. It is capable of being used with both Sensu Core and Sensu Go.

The Sensu assets packaged from this repository are built against the Sensu ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator or handler), make sure you include the corresponding Sensu ruby runtime asset in the list of assets needed by the resource. The current ruby-runtime assets can be found here in the Bonsai Asset Index

Usage examples

Usage: metrics-openvpn.rb (options)
    -h, --host HOST                  Host to connect to
    -p, --port PORT                  Port to connect to
    -r, --prompt PROMPT              Initial prompt for OpenVPN admin interface
    -s, --scheme SCHEME              Metric naming scheme, text to prepend to metric
    -e, --service SERVICE            If more than one openvpn service is running here, name this one to identify it
    -t, --timeout TIMEOUT            Connection timeout


Sensu Go

Asset registration

Assets are the best way to make use of this handler. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset:

sensuctl asset add sensu/sensu-email-handler

If you're using an earlier version of sensuctl, you can download the asset definition from this project's Bonsai Asset Index page.

Asset definition
type: Asset
api_version: core/v2
  name: sensu-plugins-openvpn_centos_amd64
    io.sensu.bonsai.tier: Community
    io.sensu.bonsai.version: 1.0.4-pre
    io.sensu.bonsai.namespace: asachs01 sensu-plugins-openvpn
    io.sensu.bonsai.tags: experimental, pre-release
  sha512: bc2ab56354ec9fe5ca468c391000bcdc1d8893818561c21cc6bea6e3fde5c405434bf01e867c4de383c5626601c9ee19c8a5c0af87d0b2debc663c93c172f677
  - entity.system.os == 'linux'
  - entity.system.arch == 'amd64'
  - entity.system.platform_family == 'rhel'
Check definition
type: CheckConfig
api_version: core/v2
  name: metrics-openvpn
  namespace: default
  command: 'metrics-openvpn.rb'
  - sensu-plugins/sensu-plugins-openvpn
  - sensu/sensu-ruby-runtime
  - linux
  interval: 10
  timeout: 5
  output_metric_format: graphite_plaintext
  - influxdb

Sensu Core

Check definition
  "checks": {
    "metrics-openvpn": {
      "command": "metrics-openvpn.rb",
      "subscribers": ["openvpn"],
      "interval": 10,
      "refresh": 10,
      "handlers": ["influxdb"]

Additional information

This plugin can be configured in several ways. The following denotes the order of precedence for how values for this plugin are defined

  1. Values defined locally in /etc/sensu/conf.d/*.json

  2. Command line options passed via --host and --port

  3. Built-in defaults (displayed with --help)

Example configuration file

This plugin can be used with a configuration file living on disk as noted above. See the example below:

  "openvpn-metrics": {
    "host": "",
    "port": "12345",
    "service": "main"


  • bin/metrics-openvpn.rb


Sensu Go

See the instructions above for asset registration

Sensu Core

Install and setup plugins on Sensu Core

Are you sure you want to report this asset?

Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.


You must be signed in to report this asset.

Sign In with Github



Either download the source code:

Download Source

Or download the asset definition: