Development
This commit is contained in:
parent
eabded2ef2
commit
836f4557f2
4 changed files with 20 additions and 5 deletions
|
|
@ -84,7 +84,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"label": "Record",
|
||||
"label": "Recorded",
|
||||
"field": "dnsmasq_log_queries",
|
||||
"class": "col-narrow",
|
||||
"render": "badge_yes_no",
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
"type": "stat_card",
|
||||
"label": "Queries Blocked",
|
||||
"value": "%STAT_BLOCKED_TODAY%",
|
||||
"sub": "since midnight",
|
||||
"sub": "in last 24h",
|
||||
"variant": "warning"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from pages.dhcpleases.view import live_dhcp_leases
|
|||
|
||||
def get_dnsmasq_stats():
|
||||
stats = {'queries': '-', 'hits': '-', 'hit_rate': '-', 'forwarded': '-', 'auth': '-', 'tcp_peak': '-'}
|
||||
out = factory.run('journalctl -u dnsmasq -n 200 --no-pager 2>/dev/null')
|
||||
out = factory.run("journalctl -u 'dnsmasq-routlin-*' -n 200 --no-pager 2>/dev/null")
|
||||
for line in reversed(out.splitlines()):
|
||||
if 'queries forwarded' in line:
|
||||
m = re.search(r'queries forwarded (\d+)', line)
|
||||
|
|
@ -36,8 +36,8 @@ def get_dnsmasq_stats():
|
|||
|
||||
|
||||
def count_blocked_today():
|
||||
out = factory.run("journalctl -u dnsmasq --since today --no-pager 2>/dev/null | grep -c 'is NXDOMAIN'")
|
||||
return out or '0'
|
||||
out = factory.run("journalctl -u 'dnsmasq-routlin-*' --since '24 hours ago' --no-pager 2>/dev/null | grep -c ' is 0\\.0\\.0\\.0'")
|
||||
return out.strip() or '0'
|
||||
|
||||
|
||||
def count_blocked_domains():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue