openvpn_status_log

package
v0.0.0-...-6ade924 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

README

OpenVPN monitoring with Netdata

Parses server log files and provides summary (client, traffic) metrics. Please note that this collector is similar to another OpenVPN collector. However, this collector requires status logs from OpenVPN in contrast to another collector that requires Management Interface enabled.

Requirements

  • make sure netdata user can read openvpn-status.log.

  • update_every interval must match the interval on which OpenVPN writes the operational status to the log file.

Metrics

All metrics have "openvpn." prefix.

user_* stats are disabled by default, see per_user_stats in the module config file.

Metric Scope Dimensions Units
active_clients global clients clients
total_traffic global in, out kilobits/s
user_traffic user in, out kilobits/s
user_connection_time user time seconds

Configuration

Edit the go.d/openvpn_status_log.conf configuration file using edit-config from the Netdata config directory, which is typically at /etc/netdata.

cd /etc/netdata   # Replace this path with your Netdata config directory, if different
sudo ./edit-config go.d/openvpn_status_log.conf

Configuration example:

jobs:
  - name: local
    log_path: '/var/log/openvpn/status.log'
    per_user_stats:
      includes:
        - "* *"

For all available options please see module configuration file.

Troubleshooting

To troubleshoot issues with the openvpn_status_log collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
    
  • Switch to the netdata user.

    sudo -u netdata -s
    
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m openvpn_status_log
    

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogPath      string             `yaml:"log_path"`
	PerUserStats matcher.SimpleExpr `yaml:"per_user_stats"`
}

type OpenVPNStatusLog

type OpenVPNStatusLog struct {
	module.Base

	Config `yaml:",inline"`
	// contains filtered or unexported fields
}

func New

func New() *OpenVPNStatusLog

func (OpenVPNStatusLog) Charts

func (o OpenVPNStatusLog) Charts() *module.Charts

func (*OpenVPNStatusLog) Check

func (o *OpenVPNStatusLog) Check() bool

func (*OpenVPNStatusLog) Cleanup

func (o *OpenVPNStatusLog) Cleanup()

func (*OpenVPNStatusLog) Collect

func (o *OpenVPNStatusLog) Collect() map[string]int64

func (*OpenVPNStatusLog) Init

func (o *OpenVPNStatusLog) Init() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL