summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-07-02 08:44:53 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2024-07-02 08:44:53 +0000
commitebff0c481907ac0c2c0be9981c3c3d87caf3003b (patch)
tree82f56112456ce1a0adf9858fe35d28cd2e0ebb17 /src/conf_mode
parente270712f7ebd76e4e1be598766d999cef4f05e26 (diff)
downloadvyos-1x-ebff0c481907ac0c2c0be9981c3c3d87caf3003b.tar.gz
vyos-1x-ebff0c481907ac0c2c0be9981c3c3d87caf3003b.zip
T6523: Telegraf use nft scripts only if the firewall configured
If a firewall is not configured there is no reason to get and execute telegraf firewall custom scripts as there are no nft chain in the firewall nftables configuration
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/service_monitoring_telegraf.py3
1 files changed, 2 insertions, 1 deletions
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: