Page MenuHomeVyOS Platform

Monitoring influxdb template input exec plugin does not work
Closed, ResolvedPublicBUG

Description

Due to rewriting/migration there is a wrong dictionary check
We don't have influxdb_configured in the dictionary anymore
So this part of the template/config does not work
https://github.com/vyos/vyos-1x/blob/06d6386e5d9fb9812b23032516bbdc938dcc4a9f/data/templates/telegraf/telegraf.j2#L113-L122

{% if influxdb_configured is vyos_defined %}
[[inputs.exec]]
  commands = [
    "{{ custom_scripts_dir }}/show_firewall_input_filter.py",
    "{{ custom_scripts_dir }}/show_interfaces_input_filter.py",
    "{{ custom_scripts_dir }}/vyos_services_input_filter.py"
  ]
  timeout = "10s"
  data_format = "influx"
{% endif %}

To reproduce:

set service monitoring telegraf influxdb authentication organization '[email protected]'
set service monitoring telegraf influxdb authentication token 'GuRJc12tIzfjnYdKRAIYbxdWd2aTpOT9PVYNddzDnFV4HkAcD7u7-kndTFXjGuXzJN6TTxmrvPODB4mnFcseDV=='
set service monitoring telegraf influxdb port '8086'
set service monitoring telegraf influxdb url 'https://foo.local'

Dictionary:

vyos@r14# commit
[ service monitoring telegraf ]
{'custom_scripts_dir': '/etc/telegraf/custom_scripts',
 'influxdb': {'authentication': {'organization': '[email protected]',
                                 'token': 'GuRJc12tIzfjnYdKRAIYbxdWd2aTpOT9PVYNddzDnFV4HkAcD7u7-kndTFXjGuXzJN6TTxmrvPODB4mnFcseDV=='},
              'bucket': 'main',
              'port': '8086',
              'url': 'https://foo.local'},
 'interfaces_ethernet': ['eth0', 'eth1'],
 'nft_chains': [],
 'source': ['all']}

[edit]
vyos@r14#

Check config:

vyos@r14# cat /run/telegraf/telegraf.conf | grep show_firewall
[edit]
vyos@r14#

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.4-rolling-202210090955
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav changed the task status from Open to In progress.Oct 11 2022, 7:09 PM
Viacheslav claimed this task.

PR https://github.com/vyos/vyos-1x/pull/1584

vyos@r14# cat /run/telegraf/telegraf.conf | grep 'inputs.exec' -A 8
[[inputs.exec]]
  commands = [
    "/etc/telegraf/custom_scripts/show_firewall_input_filter.py",
    "/etc/telegraf/custom_scripts/show_interfaces_input_filter.py",
    "/etc/telegraf/custom_scripts/vyos_services_input_filter.py"
  ]
  timeout = "10s"
  data_format = "influx"
[edit]
vyos@r14#
Viacheslav changed the task status from In progress to Needs testing.Oct 11 2022, 9:00 PM
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.