Flag hosts whose reported hostname differs from their registered name
A note on the dashboard row and host page, not a status change, so a token copied to the wrong machine is visible. Only the first DNS label is compared, ignoring case, since registered names are usually hostname -s and the agent reports hostname -f. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
313961d70b
commit
63ca790779
4 files changed
+49
-3
No files matched your search
@@ -408,7 +408,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
|
||||
rows = []
|
||||
for h in hosts:
|
||||
h["status"] = evaluate(h["received_at"], h["report"], now, self.cfg)
|
||||
h["status"] = evaluate(h["received_at"], h["report"], now, self.cfg, h["host"])
|
||||
hosts.sort(key=lambda h: (h["status"].rank, h["host"]))
|
||||
|
||||
counts = {level: 0 for level in LEVELS}
|
||||
@@ -470,7 +470,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
return self.send(HTTPStatus.NOT_FOUND, page("Not found", "<main><p>Not found.</p></main>", user))
|
||||
|
||||
latest = history[0] if history else None
|
||||
status = evaluate(latest and latest["received_at"], latest and latest["report"], now, self.cfg)
|
||||
status = evaluate(latest and latest["received_at"], latest and latest["report"], now, self.cfg, name)
|
||||
r = latest["report"] if latest else {}
|
||||
|
||||
def field(label: str, value: Any, code: bool = False) -> str:
|
||||
|
||||
Reference in new issue
Block a user