Monitoring

VyOS supports monitoring through Telegraf as well as through Prometheus exporters.

Telegraf

Telegraf is the open source server agent to help you collect metrics, events and logs from your routers.

The following Telegraf plugins are configurable to export metrics and logs:
  • Azure Data Explorer

  • Prometheus Client

  • Splunk

  • InfluxDB

  • Loki

Azure data explorer

Telegraf output plugin azure-data-explorer.

set service monitoring telegraf azure-data-explorer authentication client-id <client-id>

Authentication application client-id.

set service monitoring telegraf azure-data-explorer authentication client-secret <client-secret>

Authentication application client-secret.

set service monitoring telegraf azure-data-explorer authentication tenant-id <tenant-id>

Authentication application tenant-id

set service monitoring telegraf azure-data-explorer database <name>

Remote database name.

set service monitoring telegraf azure-data-explorer group-metrics <single-table | table-per-metric>

Type of metrics grouping when push to Azure Data Explorer. The default is table-per-metric.

set service monitoring telegraf azure-data-explorer table <name>

Name of the single table Only if set group-metrics single-table.

set service monitoring telegraf azure-data-explorer url <url>

Remote URL.

Prometheus client

Telegraf output plugin prometheus-client This plugin allows export of Telegraf metrics to Prometheus, for Prometheus native metrics through exporters see section below.

set service monitoring telegraf prometheus-client

Output plugin Prometheus client

set service monitoring telegraf prometheus-client allow-from <prefix>

Networks allowed to query this server

set service monitoring telegraf prometheus-client authentication username <username>

HTTP basic authentication username

set service monitoring telegraf prometheus-client authentication password <password>

HTTP basic authentication username

set service monitoring telegraf prometheus-client listen-address <address>

Local IP addresses to listen on

set service monitoring telegraf prometheus-client metric-version <1 | 2>

Metris version, the default is 2

set service monitoring telegraf prometheus-client port <port>

Port number used by connection, default is 9273

Example:

set service monitoring telegraf prometheus-client
vyos@r14:~$ curl --silent localhost:9273/metrics | egrep -v "#" |  grep cpu_usage_system
cpu_usage_system{cpu="cpu-total",host="r14"} 0.20040080160320556
cpu_usage_system{cpu="cpu0",host="r14"} 0.17182130584191915
cpu_usage_system{cpu="cpu1",host="r14"} 0.22896393817971655

Splunk

Telegraf output plugin splunk HTTP Event Collector.

set service monitoring telegraf splunk authentication insecure

Use TLS but skip host validation

set service monitoring telegraf splunk authentication token <token>

Authorization token

set service monitoring telegraf splunk authentication url <url>

Remote URL to Splunk collector

Example:

set service monitoring telegraf splunk authentication insecure
set service monitoring telegraf splunk authentication token 'xxxxf5b8-xxxx-452a-xxxx-43828911xxxx'
set service monitoring telegraf splunk url 'https://192.0.2.10:8088/services/collector'

InfluxDB

Telegraf output plugin influxdb to write metrics to InfluxDB via HTTP.

set service monitoring telegraf influxdb authentication organization <organization>

Authentication organization name

set service monitoring telegraf influxdb authentication token <token>

Authentication token

set service monitoring telegraf bucket <bucket>

Remote InfluxDB bucket name

set service monitoring telegraf influxdb port <port>

Remote port

set service monitoring telegraf influxdb url <url>

Remote URL

Example:

set service monitoring telegraf influxdb authentication organization 'vyos'
set service monitoring telegraf influxdb authentication token 'ZAml9Uy5wrhA...=='
set service monitoring telegraf influxdb bucket 'bucket_vyos'
set service monitoring telegraf influxdb port '8086'
set service monitoring telegraf influxdb url 'http://r1.influxdb2.local'

Loki

Telegraf can be used to send logs to loki using tags as labels.

set service monitoring telegraf loki port <port>

Remote Loki port

Default is 3100

set service monitoring telegraf loki url <url>

Remote Loki url

set service monitoring telegraf loki authentication username <username>
set service monitoring telegraf loki authentication password <password>

HTTP basic authentication.

If either is set both must be set.

set service monitoring telegraf loki metric-name-label <label>

Label to use for the metric name when sending metrics.

If set to an empty string, the label will not be added. This is NOT recommended, as it makes it impossible to differentiate between multiple metrics.

Prometheus

The following Prometheus exporters are configurable to export metrics:
  • Node Exporter

  • FRR Exporter

Node Exporter

Prometheus node_exporter which provides a wide range of hardware and OS metrics.

set service monitoring prometheus node-exporter listen-address <address>

Configure the address node_exporter is listening on.

set service monitoring prometheus node-exporter port <port>

Configure the port number node_exporter is listening on.

set service monitoring prometheus node-exporter vrf <name>

Configure name of the VRF instance.

FRR Exporter

Prometheus frr_exporter which provides free range routing metrics.

set service monitoring prometheus frr-exporter listen-address <address>

Configure the address frr_exporter is listening on.

set service monitoring prometheus frr-exporter port <port>

Configure the port number frr_exporter is listening on.

set service monitoring prometheus frr-exporter vrf <name>

Configure name of the VRF instance.