feat(sentinelone): count-agents can tell the active fleet from the dormant one

isActive splits a count that until now lumped both together. It is sent
only when the caller sets it: an unset boolean must not reach the console
as isActive=false and quietly count the dormant agents instead of all of
them.
This commit is contained in:
2026-08-14 23:30:47 +02:00
parent cebb3af796
commit a5095d3f0f
2 changed files with 7 additions and 2 deletions
@@ -38,6 +38,10 @@ def main():
"operationalStatesNin": ",".join(csv(inputs.get("operationalStatesNin"))),
"machineTypes": ",".join(csv(inputs.get("machineTypes"))),
}
# Only sent when the caller actually set it: an unset boolean must not become
# isActive=false and quietly count the inactive agents instead of all of them.
if inputs.get("isActive") not in (None, ""):
qs["isActive"] = "true" if inputs["isActive"] in (True, "true", "True", 1, "1") else "false"
url = base + "/agents/count?" + urllib.parse.urlencode({k: v for k, v in qs.items() if v not in (None, "")})
print(json.dumps(request("GET", url, headers)))
# === END ===