Skip to content

Conversation

@slibonati
Copy link

Summary

Adds Windows host support to the PatchMon agent, enabling monitoring of Windows servers alongside Linux hosts.

Changes

  • Windows Update detection: Query pending updates via PowerShell/COM interface (Microsoft.Update.Session)
  • Windows repository detection: Identify configured update sources
  • Platform-specific service management: Separate implementations for Windows (service_windows.go) and Unix (service_unix.go)
  • Cross-platform system info: OS version, hostname, uptime, reboot detection for Windows
  • Config handling: Platform-appropriate config file paths
  • Crontab: Gracefully skip on Windows (not applicable)

Testing

Tested on:

  • Windows Server 2022 (monopoly)
  • Windows 11 (jenga)
  • Linux test host (patchmon-test)

All three hosts reporting successfully to PatchMon server.

Related

Addresses PatchMon/PatchMon#11

- Add Windows Update package detection via PowerShell/COM interface
- Add Windows repository detection
- Add platform-specific service management (service_windows.go, service_unix.go)
- Add Windows system info collection (OS version, hostname, uptime)
- Add Windows reboot detection support
- Handle cross-platform differences in network, config paths, and crontab
- Update README with Windows installation instructions

Addresses PatchMon/PatchMon#11
- Fix getLatestKernelFromBoot(): Include kernels ending with '-generic' (valid versions)
- Fix getLatestKernelFromDpkg(): Better filter meta-packages, sort kernels properly
- Handle Alpine symlinks: Resolve /boot/vmlinuz-lts to actual kernel version
- Only include kernel versions that start with numbers (exclude meta-packages)

Fixes false positives where meta-packages like 'generic-hwe-24.04' or 'lts'
were incorrectly detected as kernel versions, causing false reboot alerts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant