kuma-inventory.py printed the junk url field (https://) instead of the hostname for ping monitors — hid ~100 monitors from FQDN matching. kuma-add-ping.py: idempotent ping-monitor adds (exists-check by name and target). Matrix published to Discourse t/309 (canonical, #343). Detail: https://projects.knownelement.com/issues/343
This commit is contained in:
@@ -63,7 +63,8 @@ def main():
|
||||
mtype = m.get("type") or "?"
|
||||
active = "on" if m.get("active", True) else "PAUSED"
|
||||
name = (m.get("name") or "?").replace("\t", " ")
|
||||
target = (m.get("hostname") if m.get("type") == "dns" else None) or m.get("url") or m.get("hostname") or ""
|
||||
# hostname first: ping monitors carry a junk default url ("https://")
|
||||
target = m.get("hostname") or m.get("url") or ""
|
||||
target = str(target).replace("\t", " ")
|
||||
rows.append((mid, parent, mtype, active, name, target))
|
||||
rows.sort(key=lambda r: (r[1] == "-", r[1], r[4].lower()))
|
||||
|
||||
Reference in New Issue
Block a user