Page MenuHomeVyOS Platform

Add configurable telegraf monitoring service
Needs testing, Requires assessmentPublicFEATURE REQUEST

Description

Adding configurable telegraf parameters.
Allow to configurre remote endpoint/port/login/token

Proposed CLI:

set service monitoring telegraf authentication login 'log@in.local'
set service monitoring telegraf authentication token 'footokenfoo'
set service monitoring telegraf url 'foo.local:8086'
set service monitoring telegraf metrics daemons 'keepalived'
set service monitoring telegraf metrics daemons 'sshd'

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

Viacheslav changed the task status from Open to Needs testing.Wed, Jan 12, 4:38 PM
Viacheslav claimed this task.

Incorrect custom scripts data if used 'tun' interface
https://github.com/vyos/vyos-1x/blob/current/src/etc/telegraf/custom_scripts/show_interfaces_input_filter.py

vyos@r11-roll:~$ /etc/telegraf/custom_scripts/show_interfaces_input_filter.py
show_interfaces,interface=dum0 ip_addresses="172.16.0.1/24",state=0i,link=0i,description="empty" 1642008162000000000
show_interfaces,interface=eth0 ip_addresses="192.168.122.11/24 169.254.0.2/27 192.0.2.55/24 192.168.222.222/24",state=0i,link=0i,description="outside" 1642008162000000000
show_interfaces,interface=eth1 ip_addresses="203.0.113.1/24 192.0.2.1/24 10.0.0.2/24",state=0i,link=0i,description="inside" 1642008162000000000
show_interfaces,interface=eth2 ip_addresses="198.51.100.111/24",state=0i,link=0i,description="empty" 1642008162000000000
show_interfaces,interface=lo ip_addresses="127.0.0.1/8 ::1/128",state=0i,link=0i,description="empty" 1642008162000000000
Traceback (most recent call last):
  File "/etc/telegraf/custom_scripts/show_interfaces_input_filter.py", line 42, in <module>
    f'ip_addresses="{gen_ip_list(index,interfaces)}",'
  File "/etc/telegraf/custom_scripts/show_interfaces_input_filter.py", line 26, in gen_ip_list
    while len(interfaces[index].split())==1:
IndexError: list index out of range
vyos@r11-roll:~$

Interfaces:

vyos@r11-roll:~$ show int
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
dum0             172.16.0.1/24                     u/u  
eth0             192.168.122.11/24                 u/u  outside
                 169.254.0.2/27                         
                 192.0.2.55/24                          
                 192.168.222.222/24                     
eth1             203.0.113.1/24                    u/u  inside
                 192.0.2.1/24                           
                 10.0.0.2/24                            
eth2             198.51.100.111/24                 u/u  
lo               127.0.0.1/8                       u/u  
                 ::1/128                                
tun0             -                                 u/u
  • Incorrect custom scripts data if used tunX interfaces
  • Allow inputs.ethtool only on Ethernet interfaces, by default it tries to get statistics from each interface, template
Jan 12 19:37:30 r11-roll telegraf[7703]: 2022-01-12T17:37:30Z E! [inputs.ethtool] Error in plugin: dum0 stats: operation not supported
Jan 12 19:37:30 r11-roll telegraf[7703]: 2022-01-12T17:37:30Z E! [inputs.ethtool] Error in plugin: gretap0 driver: operation not supported
Jan 12 19:37:30 r11-roll telegraf[7703]: 2022-01-12T17:37:30Z E! [inputs.ethtool] Error in plugin: gre0 driver: operation not supported
Jan 12 19:37:30 r11-roll telegraf[7703]: 2022-01-12T17:37:30Z E! [inputs.ethtool] Error in plugin: erspan0 driver: operation not supported

For example what we can use:

[[inputs.ethtool]]
  ## List of interfaces to pull metrics for
  # interface_include = ["eth0"]

  ## List of interfaces to ignore when pulling metrics.
  # interface_exclude = ["eth1"]
  • Iptables inputs should be rewritten [inputs.iptables] to nft plugin or correct format
Jan 12 19:37:30 r11-roll telegraf[7703]: 2022-01-12T17:37:30Z E! [inputs.iptables] Error in plugin: exit status 1
Jan 12 19:37:30 r11-roll telegraf[7703]: 2022-01-12T17:37:30Z E! [inputs.iptables] Error in plugin: exit status 1
Jan 12 19:37:30 r11-roll telegraf[7703]: 2022-01-12T17:37:30Z E! [inputs.iptables] Error in plugin: exit status 1

There is no official nft plugin at the moment