From 33bf84e66677ea43cc26ae1ebd8b37e6c14ebbb7 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Thu, 13 Oct 2022 10:57:46 +0000 Subject: monitoring: T4746: Add exception if we do not have firewall rules Telegraf checks the firewall table 'vyos_filter' but it we don't have any firewall in the system we don't have this table by default It cause commit error for "service monitoring" Add exception if the table "vyos_filter" is not found --- src/etc/telegraf/custom_scripts/show_firewall_input_filter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/etc/telegraf') diff --git a/src/etc/telegraf/custom_scripts/show_firewall_input_filter.py b/src/etc/telegraf/custom_scripts/show_firewall_input_filter.py index cbc2bfe6b..d7eca5894 100755 --- a/src/etc/telegraf/custom_scripts/show_firewall_input_filter.py +++ b/src/etc/telegraf/custom_scripts/show_firewall_input_filter.py @@ -11,7 +11,10 @@ def get_nft_filter_chains(): """ Get list of nft chains for table filter """ - nft = cmd('/usr/sbin/nft --json list table ip vyos_filter') + try: + nft = cmd('/usr/sbin/nft --json list table ip vyos_filter') + except Exception: + return [] nft = json.loads(nft) chain_list = [] -- cgit v1.2.3