Collector registry, fixes/optimizations

This commit is contained in:
Arseniy Kuznetsov
2021-02-14 09:03:08 +01:00
parent 6533a20d47
commit df84ada9c7
28 changed files with 237 additions and 234 deletions

View File

@@ -22,6 +22,9 @@ class DHCPCollector(BaseCollector):
'''
@staticmethod
def collect(router_entry):
if not router_entry.config_entry.dhcp:
return
dhcp_lease_labels = ['active_address', 'address', 'mac_address', 'host_name', 'comment', 'server', 'expires_after']
dhcp_lease_records = DHCPMetricsDataSource.metric_records(router_entry, metric_labels = dhcp_lease_labels)
if dhcp_lease_records: