diff --git a/agents/proxmox_auto_enroll.sh b/agents/proxmox_auto_enroll.sh index f999b90..01c4158 100755 --- a/agents/proxmox_auto_enroll.sh +++ b/agents/proxmox_auto_enroll.sh @@ -153,6 +153,32 @@ while IFS= read -r line; do ip_address=$(timeout 5 pct exec "$vmid" -- hostname -I 2>/dev/null /dev/null /dev/null $architecture" + # Get machine ID from container machine_id=$(timeout 5 pct exec "$vmid" -- bash -c "cat /etc/machine-id 2>/dev/null || cat /var/lib/dbus/machine-id 2>/dev/null || echo 'proxmox-lxc-$vmid-'$(cat /proc/sys/kernel/random/uuid)" /dev/null || echo "proxmox-lxc-$vmid-unknown") @@ -161,6 +187,7 @@ while IFS= read -r line; do info " Hostname: $hostname" info " IP Address: $ip_address" info " OS: $os_info" + info " Architecture: $architecture ($arch_raw)" info " Machine ID: ${machine_id:0:16}..." if [[ "$DRY_RUN" == "true" ]]; then @@ -244,12 +271,13 @@ while IFS= read -r line; do # Install PatchMon agent in container info " Installing PatchMon agent..." - # Build install URL with force flag if enabled - install_url="$PATCHMON_URL/api/v1/hosts/install" + # Build install URL with force flag and architecture if enabled + install_url="$PATCHMON_URL/api/v1/hosts/install?arch=$architecture" if [[ "$FORCE_INSTALL" == "true" ]]; then - install_url="$install_url?force=true" + install_url="$install_url&force=true" info " Using force mode - will bypass broken packages" fi + info " Using architecture: $architecture" # Reset exit code for this container install_exit_code=0 @@ -400,7 +428,7 @@ if [[ ${#dpkg_error_containers[@]} -gt 0 ]]; then -H \"X-API-ID: $api_id\" \ -H \"X-API-KEY: $api_key\" \ -o patchmon-install.sh \ - '$PATCHMON_URL/api/v1/hosts/install' && \ + '$PATCHMON_URL/api/v1/hosts/install?arch=$architecture' && \ bash patchmon-install.sh && \ rm -f patchmon-install.sh " 2>&1