Add get_disk_list() function that caches the output of lsblk
on first call. Subsequent calls return the cached value,
reducing overhead when multiple functions need to iterate
over disk devices.
#8
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add optional logging to file via PROXDOC_LOGFILE environment
variable. Uses exec redirection with tee instead of subshells,
which is more efficient for long-running diagnostics.
Usage: PROXDOC_LOGFILE=/tmp/proxdoc.log ./proxDoc.sh --diags
#9
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add cleanup function called on EXIT trap
- Add ERRORS_OCCURRED and WARNINGS_OCCURRED counters
- Make handle_error support non-fatal errors with optional parameter
- Add proper exit codes for INT (130) and TERM (143) signals
- Add summary of errors/warnings at the end of diagnostics
- Redirect error messages to stderr
#10
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add fallback values for variables that might be empty when
system information is unavailable. Use parameter expansion
with default values (${var:-Default}) to ensure meaningful
output even when commands fail or return empty results.
Affected functions: get_cpu_info, get_ram_info, get_network_info
#11
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Define pattern constants at the top of the script for:
- VIRTUAL_IFACE_PATTERN: virtual/firewall interface patterns
- STORAGE_CONTROLLER_PATTERN: HBA/storage controller detection
- DISK_DEVICE_PATTERN: disk device name patterns
- EXCLUDED_PCI_PATTERN: PCI devices to exclude from listing
This improves maintainability and makes patterns easier to modify.
#12
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add the ability to run only specific diagnostic checks using
--checks=cpu,ram,disk syntax. This allows users to perform
targeted diagnostics without running the full suite.
Supported checks: cpu, ram, memory, storage, disk, network,
hardware, temps, services, ceph, vms, containers
#13
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a configurable CMD_TIMEOUT constant and apply timeouts to
smartctl and ceph commands that may hang on unresponsive disks
or network issues. This prevents the script from blocking
indefinitely.
#14
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Expand the help output to include practical usage examples
for common operations like full diagnostics, quick health
checks, service monitoring, and Ceph health checks.
#15
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement strict input validation using a whitelist approach.
Only accept options that match the expected pattern and are in
the approved list. This prevents injection attacks and invalid
inputs from being processed.
#16
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace unsafe for loops with properly quoted while loops when
iterating over disk devices. This prevents word splitting issues
with device names containing special characters.
#17
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- PCI: Exclude USB controller, Audio device, Encryption controller,
Multimedia controller (integrated motherboard devices)
- Network: Also filter fwbr*, fwln*, fwpr*, tap* interfaces
(firewall bridges and VM tap devices)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Filter out veth* interfaces from network statistics and NIC details
(these are container virtual interfaces that clutter the output)
- Show all interesting PCI devices instead of just VGA/ethernet/raid
(excludes Host bridge, PCI bridge, ISA bridge, SMBus, IOMMU, Dummy)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix memory slot counting: use grep on Locator/Size fields instead
of awk pattern that wasn't matching dmidecode output correctly
- Add SATA to HBA detection patterns - was missing SATA controllers
- Remove get_disk_health from runDiags - redundant with DriveAtlas
which shows the same info in a better format
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous grep-based counting was including Size: lines from
Physical Memory Array sections, causing incorrect counts (e.g., 5/4
instead of 4/4). Now uses awk to only count Size: lines within
Memory Device sections.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove interactive menu (requires stdin)
- Remove --connect option (requires stdin)
- Remove --save option (not practical for remote execution)
- Show help when run without arguments
- Update help to show curl usage example
- Update README for remote-only usage
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add interactive numbered menu when run without arguments
- Add DriveAtlas integration (--drives) for physical drive bay mapping
- Add Ceph cluster health monitoring (--ceph)
- Add Node Exporter status check (--node-exporter)
- Add hwmon daemon status check (--hwmon)
- Add quick health check mode (--quick)
- Add container list option (--ct-list)
- Full diagnostics now includes all monitoring checks
- Update README with new features and changelog
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>