diff options
author | Christian Breunig <christian@breunig.cc> | 2024-07-02 15:37:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-02 15:37:24 +0200 |
commit | efe4e60f5b5620ad7ea342fc9ca1d069e8b9cc21 (patch) | |
tree | 82f56112456ce1a0adf9858fe35d28cd2e0ebb17 | |
parent | e270712f7ebd76e4e1be598766d999cef4f05e26 (diff) | |
parent | ebff0c481907ac0c2c0be9981c3c3d87caf3003b (diff) | |
download | vyos-1x-efe4e60f5b5620ad7ea342fc9ca1d069e8b9cc21.tar.gz vyos-1x-efe4e60f5b5620ad7ea342fc9ca1d069e8b9cc21.zip |
Merge pull request #3748 from sever-sever/T6523
T6523: Telegraf use nft scripts only if the firewall configured
-rw-r--r-- | data/templates/telegraf/telegraf.j2 | 2 | ||||
-rwxr-xr-x | src/conf_mode/service_monitoring_telegraf.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/data/templates/telegraf/telegraf.j2 b/data/templates/telegraf/telegraf.j2 index f382dbf2e..535e3a347 100644 --- a/data/templates/telegraf/telegraf.j2 +++ b/data/templates/telegraf/telegraf.j2 @@ -130,7 +130,9 @@ metric_name_label = "{{ loki.metric_name_label }}" {% if influxdb is vyos_defined %} [[inputs.exec]] commands = [ +{% if nft_chains is vyos_defined %} "{{ custom_scripts_dir }}/show_firewall_input_filter.py", +{% endif %} "{{ custom_scripts_dir }}/show_interfaces_input_filter.py", "{{ custom_scripts_dir }}/vyos_services_input_filter.py" ] diff --git a/src/conf_mode/service_monitoring_telegraf.py b/src/conf_mode/service_monitoring_telegraf.py index 9455b6109..db870aae5 100755 --- a/src/conf_mode/service_monitoring_telegraf.py +++ b/src/conf_mode/service_monitoring_telegraf.py @@ -86,7 +86,8 @@ def get_config(config=None): monitoring['custom_scripts_dir'] = custom_scripts_dir monitoring['hostname'] = get_hostname() monitoring['interfaces_ethernet'] = Section.interfaces('ethernet', vlan=False) - monitoring['nft_chains'] = get_nft_filter_chains() + if conf.exists('firewall'): + monitoring['nft_chains'] = get_nft_filter_chains() # Redefine azure group-metrics 'single-table' and 'table-per-metric' if 'azure_data_explorer' in monitoring: |