mirror of
https://github.com/KevinMidboe/mktxp-no-cli.git
synced 2025-10-29 17:50:23 +00:00
optional ipv6 firewall, disabled by default
This commit is contained in:
@@ -23,3 +23,4 @@
|
|||||||
bandwidth_test_interval = 420 # Interval for colllecting bandwidth metrics
|
bandwidth_test_interval = 420 # Interval for colllecting bandwidth metrics
|
||||||
|
|
||||||
verbose_mode = False # Set it on for troubleshooting
|
verbose_mode = False # Set it on for troubleshooting
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,11 @@ class FirewallCollector(BaseCollector):
|
|||||||
'''
|
'''
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def collect(router_entry):
|
def collect(router_entry):
|
||||||
if not router_entry.config_entry.firewall:
|
|
||||||
return
|
|
||||||
|
|
||||||
# Initialize all pool counts, including those currently not used
|
# Initialize all pool counts, including those currently not used
|
||||||
# These are the same for both IPv4 and IPv6
|
# These are the same for both IPv4 and IPv6
|
||||||
firewall_labels = ['chain', 'action', 'bytes', 'comment', 'log']
|
firewall_labels = ['chain', 'action', 'bytes', 'comment', 'log']
|
||||||
|
|
||||||
|
if router_entry.config_entry.firewall:
|
||||||
# ~*~*~*~*~*~ IPv4 ~*~*~*~*~*~
|
# ~*~*~*~*~*~ IPv4 ~*~*~*~*~*~
|
||||||
firewall_filter_records = FirewallMetricsDataSource.metric_records_ipv4(router_entry, metric_labels = firewall_labels)
|
firewall_filter_records = FirewallMetricsDataSource.metric_records_ipv4(router_entry, metric_labels = firewall_labels)
|
||||||
if firewall_filter_records:
|
if firewall_filter_records:
|
||||||
@@ -43,8 +41,7 @@ class FirewallCollector(BaseCollector):
|
|||||||
yield firewall_raw_metrics
|
yield firewall_raw_metrics
|
||||||
|
|
||||||
# ~*~*~*~*~*~ IPv6 ~*~*~*~*~*~
|
# ~*~*~*~*~*~ IPv6 ~*~*~*~*~*~
|
||||||
if not router_entry.config_entry.ipv6_firewall:
|
if router_entry.config_entry.ipv6_firewall:
|
||||||
return
|
|
||||||
firewall_filter_records_ipv6 = FirewallMetricsDataSource.metric_records_ipv6(router_entry, metric_labels = firewall_labels)
|
firewall_filter_records_ipv6 = FirewallMetricsDataSource.metric_records_ipv6(router_entry, metric_labels = firewall_labels)
|
||||||
if firewall_filter_records_ipv6:
|
if firewall_filter_records_ipv6:
|
||||||
metrics_records_ipv6 = [FirewallCollector.metric_record(router_entry, record) for record in firewall_filter_records_ipv6]
|
metrics_records_ipv6 = [FirewallCollector.metric_record(router_entry, record) for record in firewall_filter_records_ipv6]
|
||||||
|
|||||||
Reference in New Issue
Block a user