Skip to content

fix(monitor-all): reduce polling CPU overhead#15907

Draft
jomplox wants to merge 1 commit into
community-scripts:mainfrom
jomplox:fix/monitor-all-cpu-overhead
Draft

fix(monitor-all): reduce polling CPU overhead#15907
jomplox wants to merge 1 commit into
community-scripts:mainfrom
jomplox:fix/monitor-all-cpu-overhead

Conversation

@jomplox

@jomplox jomplox commented Jul 19, 2026

Copy link
Copy Markdown

✍️ Description

Monitor-All currently launches pct status plus up to three separate pct config or qm config commands for every guest during each polling cycle. Those repeated Proxmox CLI calls add avoidable CPU overhead.

This change:

  • determines the guest type from the authoritative pmxcfs config path;
  • reads the current config once per guest;
  • ignores snapshot sections, matching the current config exposed by pct config and qm config;
  • reuses that config for the existing onboot, template, and mon-restart tag checks.

The monitoring policy, exclusions, health checks, restart commands, messages, and 300-second pause are unchanged.

Validation:

  • bash -n tools/pve/monitor-all.sh
  • generated ping-instances.sh payload parses cleanly
  • ShellCheck error-level validation passes for the generated payload, excluding the two unchanged existing array findings SC2145 and SC2199
  • fixture harness confirms identical logs and recovery actions for healthy, excluded, onboot-disabled, template, VM-failure, and CT-failure cases
  • fixture harness confirms zero pct config or qm config launches after the change

Development disclosure: OpenAI Codex assisted the diagnosis, patch drafting, and fixture harness. The committed result was manually reviewed and validated before submission.

🔗 Related Issue

None.

✅ Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to website-related JSON files or metadata.
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant