Development
This commit is contained in:
parent
e8717710d4
commit
47a7c564ab
3 changed files with 4 additions and 4 deletions
|
|
@ -50,7 +50,7 @@
|
|||
"type": "stat_card",
|
||||
"label": "DHCP Leases",
|
||||
"value": "%STAT_LEASE_COUNT%",
|
||||
"sub": "%STAT_LEASES_LINK%",
|
||||
"sub": "active leases",
|
||||
"variant": "accent"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -253,7 +253,6 @@ def collect_tokens(cfg):
|
|||
|
||||
lease_count = len(live_dhcp_leases())
|
||||
tokens['STAT_LEASE_COUNT'] = str(lease_count)
|
||||
tokens['STAT_LEASES_LINK'] = f'<a href="/dhcpleases">{lease_count} active lease{"s" if lease_count != 1 else ""}</a>'
|
||||
tokens['STAT_VLAN_COUNT'] = str(len(non_vpn_vlans))
|
||||
tokens['STAT_PUBLIC_IP'] = ip_str
|
||||
tokens['STAT_DDNS_HOSTNAME'] = domains_sub
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ def collect_metrics(data):
|
|||
"servers": []
|
||||
}
|
||||
|
||||
t_signal = int(time.time())
|
||||
any_running = False
|
||||
for vlan in data["vlans"]:
|
||||
pid_file = shared.vlan_pid_file(vlan)
|
||||
|
|
@ -97,13 +98,13 @@ def collect_metrics(data):
|
|||
print("No dnsmasq instances are running.")
|
||||
return None
|
||||
|
||||
time.sleep(1)
|
||||
time.sleep(2)
|
||||
|
||||
server_map = {}
|
||||
for vlan in data["vlans"]:
|
||||
svc = shared.vlan_service_name(vlan, validation.derive_interface(vlan, data))
|
||||
result = subprocess.run(
|
||||
["journalctl", "-u", svc, "--since", "5 seconds ago",
|
||||
["journalctl", "-u", svc, f"--since=@{t_signal}",
|
||||
"--no-pager", "-o", "cat"],
|
||||
capture_output=True, text=True
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue