script: allow collecting management server and kvm agent logs - #13982
script: allow collecting management server and kvm agent logs#13982shwstppr wants to merge 2 commits into
Conversation
Adds a utility script to collect CloudStack logs for troubleshooting. * Collects management server and KVM agent logs. * Supports collecting logs for a specific date. * Discovers management servers and KVM hosts using CloudMonkey, with database fallback. * Supports limiting collection to specified KVM hosts. * Packages collected logs into a compressed archive. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds a new troubleshooting utility script to collect Apache CloudStack management server and KVM agent logs, optionally filtered to a specific date and/or a subset of KVM hosts, and packages the results into a tarball.
Changes:
- Introduces
cloudstack-collect-logs.shto detect node type (management vs KVM) and collect the relevant logs. - Implements discovery of management servers and KVM hosts via CloudMonkey (with
jq), with a MySQL/database fallback viadb.properties. - Supports date-scoped extraction across rotated logs and produces a compressed archive with a small
info.txtmanifest.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| SSH_USER="${SSH_USER:-root}" | ||
| REQUESTED_HOSTS=() | ||
| SSH_OPTS="${SSH_OPTS:--o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=no}" | ||
|
|
| get_property() { | ||
| local property="$1" | ||
|
|
||
| awk -F= -v property="$property" ' | ||
| $1 == property { | ||
| sub(/^[^=]*=/, "") | ||
| exit | ||
| } | ||
| ' "$DB_PROPERTIES" | ||
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13982 +/- ##
============================================
- Coverage 19.74% 19.74% -0.01%
+ Complexity 19960 19959 -1
============================================
Files 6371 6371
Lines 575784 575784
Branches 70478 70478
============================================
- Hits 113665 113660 -5
- Misses 449765 449772 +7
+ Partials 12354 12352 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19054 |
Description
Adds a utility script to collect CloudStack logs for troubleshooting.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?