Show PatchMon agent install failure output

This commit is contained in:
2026-09-29 17:24:04 +00:00
parent 8ad89fddda
commit 0c8e9a3977
+7
View File
@@ -124,6 +124,13 @@ s = p.read_text()
# enroll/configure the agent against the FQDN.
s = re.sub(r'export PATCHMON_URL="[^"]+"', f'export PATCHMON_URL="{server}"', s)
s = s.replace('http://192.168.20.232:3000', server)
# PatchMon's generated auto-enroll script captures the real agent-install
# output, but by default only prints a generic "Failed to install agent" line.
# Make failures actionable for one-liner installs.
s = s.replace(
' error "Failed to install agent (exit: $install_exit_code)"',
' printf "%s\\n" "$install_output" >&2\n error "Failed to install agent (exit: $install_exit_code)"',
)
p.write_text(s)
PY
}