fix(oam): kuma inventory target-field bug + add-ping tooling [#343][#435]

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:
2026-09-03 14:34:44 -05:00
parent a07d866116
commit ba4463c4d0
2 changed files with 94 additions and 1 deletions
+2 -1
View File
@@ -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()))