Add event-driven memory syscall telemetry
This commit is contained in:
parent
893409b549
commit
a51478fa22
18 changed files with 589 additions and 32 deletions
|
|
@ -187,10 +187,14 @@ def daemon_status(cfg: Config) -> dict:
|
|||
counts: dict[str, int] = {}
|
||||
for a in alerts:
|
||||
counts[a["severity"]] = counts.get(a["severity"], 0) + 1
|
||||
ebpf = "unknown"
|
||||
ebpf_exec = "unknown"
|
||||
ebpf_syscall = "unknown"
|
||||
for line in reversed(tail_events(cfg, 200)):
|
||||
if "eBPF exec monitor:" in line:
|
||||
ebpf = line.split("eBPF exec monitor:", 1)[1].strip()
|
||||
if ebpf_exec == "unknown" and "eBPF exec monitor:" in line:
|
||||
ebpf_exec = line.split("eBPF exec monitor:", 1)[1].strip()
|
||||
if ebpf_syscall == "unknown" and "eBPF syscall monitor:" in line:
|
||||
ebpf_syscall = line.split("eBPF syscall monitor:", 1)[1].strip()
|
||||
if ebpf_exec != "unknown" and ebpf_syscall != "unknown":
|
||||
break
|
||||
from .selfprotect import heartbeat_age
|
||||
age = heartbeat_age(cfg)
|
||||
|
|
@ -200,7 +204,9 @@ def daemon_status(cfg: Config) -> dict:
|
|||
"total_alerts": len(alerts),
|
||||
"counts": counts,
|
||||
"last_alert": alerts[0]["time"] if alerts else None,
|
||||
"ebpf": ebpf,
|
||||
"ebpf": ebpf_exec,
|
||||
"ebpf_exec": ebpf_exec,
|
||||
"ebpf_syscall": ebpf_syscall,
|
||||
"host": os.uname().nodename,
|
||||
"heartbeat_age": age,
|
||||
"heartbeat_stale": (age is not None and age > cfg.heartbeat_max_age),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue