Remove interactive features for remote-only execution

- 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>
This commit is contained in:
2026-01-24 17:22:37 -05:00
parent 575c60b1fa
commit d9e546f75d
2 changed files with 24 additions and 79 deletions

View File

@@ -5,7 +5,6 @@ ProxDoc is a comprehensive diagnostic tool for Proxmox server health monitoring
## Features ## Features
- Complete system diagnostics and health checks - Complete system diagnostics and health checks
- **Interactive menu system** when run without arguments
- **DriveAtlas integration** for physical drive bay mapping - **DriveAtlas integration** for physical drive bay mapping
- **Ceph cluster health** monitoring (OSD tree, pool usage, disk usage) - **Ceph cluster health** monitoring (OSD tree, pool usage, disk usage)
- **Node Exporter status** check for Prometheus monitoring - **Node Exporter status** check for Prometheus monitoring
@@ -23,7 +22,6 @@ ProxDoc is a comprehensive diagnostic tool for Proxmox server health monitoring
- Hardware information - Hardware information
- Service status monitoring - Service status monitoring
- VM and Container status - VM and Container status
- Remote host diagnostics capability
## Requirements ## Requirements
@@ -41,11 +39,25 @@ Optional tools for enhanced diagnostics:
## Usage ## Usage
Run remotely via curl:
```bash ```bash
./proxdoc.sh [OPTIONS] curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh" | bash -s -- [OPTION]
``` ```
### Examples
```bash ```bash
# Full system diagnostics
curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh" | bash -s -- --diags
# Quick health check
curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh" | bash -s -- --quick
# Check services
curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh" | bash -s -- --services curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh" | bash -s -- --services
# Show drive bay mapping
curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh" | bash -s -- --drives
``` ```
### Available Options ### Available Options
@@ -61,16 +73,6 @@ curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh"
- `--vm-list`: Check VM vitals - `--vm-list`: Check VM vitals
- `--ct-list`: Check container vitals - `--ct-list`: Check container vitals
- `--backup`: Review backup health - `--backup`: Review backup health
- `--connect`: Connect to a remote Proxmox host
- `--save`: Save examination results to a log file
### Interactive Mode
Run without arguments to display an interactive menu:
```bash
./proxDoc.sh
```
## Output Information ## Output Information
@@ -90,19 +92,12 @@ The script provides detailed information about:
- Recent system errors - Recent system errors
- VM and container status - VM and container status
## Installation
1. Download the script
2. Make it executable:
```bash
chmod +x proxdoc.sh
```
## Note ## Note
This script must be run as root - This script must be run as root
Designed for Proxmox environments - Designed for Proxmox environments
Supports Proxmox version 6.0 and above - Supports Proxmox version 6.0 and above
- No local installation required - runs directly from Gitea
## Version ## Version
@@ -111,7 +106,6 @@ Current Version: 1.1.0
### Changelog ### Changelog
#### v1.1.0 #### v1.1.0
- Added interactive menu system when run without arguments
- Added DriveAtlas integration (`--drives`) for physical drive bay mapping - Added DriveAtlas integration (`--drives`) for physical drive bay mapping
- Added Ceph cluster health monitoring (`--ceph`) - Added Ceph cluster health monitoring (`--ceph`)
- Added Node Exporter status check (`--node-exporter`) - Added Node Exporter status check (`--node-exporter`)
@@ -120,6 +114,7 @@ Current Version: 1.1.0
- Added container list option (`--ct-list`) - Added container list option (`--ct-list`)
- Full diagnostics now include all monitoring checks - Full diagnostics now include all monitoring checks
- Improved error handling with graceful fallbacks - Improved error handling with graceful fallbacks
- Optimized for remote execution via curl
#### v1.0.0 #### v1.0.0
- Initial release - Initial release

View File

@@ -438,7 +438,9 @@ list_containers() {
################### ###################
help() { help() {
echo "ProxDoc - The Proxmox System Doctor v${VERSION}" echo "ProxDoc - The Proxmox System Doctor v${VERSION}"
echo "Usage: $0 [OPTIONS]" echo ""
echo "Usage: curl -sL \"http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh\" | bash -s -- [OPTION]"
echo ""
echo "A comprehensive diagnostic tool for Proxmox server health checks." echo "A comprehensive diagnostic tool for Proxmox server health checks."
echo "" echo ""
echo "Treatment Options:" echo "Treatment Options:"
@@ -453,61 +455,11 @@ help() {
echo " --vm-list Check VM vitals" echo " --vm-list Check VM vitals"
echo " --ct-list Check container vitals" echo " --ct-list Check container vitals"
echo " --backup Review backup health" echo " --backup Review backup health"
echo " --connect Make a house call to a remote Proxmox host"
echo " --save Save examination results to medical record"
echo ""
echo "Interactive mode: Run without arguments for menu"
exit 0 exit 0
} }
connectToHost() {
read -rp "Enter the address for house call (hostname/IP): " remote_host
echo -e "${YELLOW}Preparing for remote consultation with $remote_host...${NC}"
if ping -c 1 "$remote_host" >/dev/null 2>&1; then
ssh "root@$remote_host"
else
handle_error "Patient $remote_host is not responding"
fi
}
show_menu() {
echo ""
echo -e "${GREEN}Select a diagnostic option:${NC}"
echo ""
echo " 1) Full System Diagnostics"
echo " 2) Quick Health Check"
echo " 3) Drive Atlas (Physical Bay Mapping)"
echo " 4) Check Proxmox Services"
echo " 5) VM Status"
echo " 6) Container Status"
echo " 7) Ceph Cluster Health"
echo " 8) Node Exporter Status"
echo " 9) hwmon Daemon Status"
echo " 10) Backup Status"
echo " 11) Connect to Remote Host"
echo " 12) Save Full Report to File"
echo " 0) Exit"
echo ""
read -rp "Enter choice [0-12]: " choice
case $choice in
1) check_requirements; runDiags ;;
2) quick_health_check ;;
3) get_drive_atlas ;;
4) check_services ;;
5) list_vms ;;
6) list_containers ;;
7) get_ceph_health ;;
8) get_node_exporter_status ;;
9) get_hwmon_status ;;
10) echo -e "${GREEN}Backup Status:${NC}"; pvesm status 2>/dev/null || log_message warn "pvesm not available" ;;
11) connectToHost ;;
12) exec 1> >(tee "proxmox_diag_$(date '+%Y%m%d_%H%M%S').log"); runDiags ;;
0) echo "Goodbye!"; exit 0 ;;
*) echo -e "${RED}Invalid option${NC}"; show_menu ;;
esac
}
################### ###################
# Main Functions # Main Functions
@@ -549,12 +501,10 @@ checkForInput() {
--ceph) get_ceph_health ;; --ceph) get_ceph_health ;;
--node-exporter) get_node_exporter_status ;; --node-exporter) get_node_exporter_status ;;
--hwmon) get_hwmon_status ;; --hwmon) get_hwmon_status ;;
--connect) connectToHost ;;
--services) check_services ;; --services) check_services ;;
--vm-list) list_vms ;; --vm-list) list_vms ;;
--ct-list) list_containers ;; --ct-list) list_containers ;;
--backup) echo -e "${GREEN}Backup Status:${NC}"; pvesm status 2>/dev/null || log_message warn "pvesm not available" ;; --backup) echo -e "${GREEN}Backup Status:${NC}"; pvesm status 2>/dev/null || log_message warn "pvesm not available" ;;
--save) exec 1> >(tee "proxmox_diag_$(date '+%Y%m%d_%H%M%S').log"); check_requirements; runDiags ;;
*) echo -e "${RED}Invalid option: $1${NC}"; help ;; *) echo -e "${RED}Invalid option: $1${NC}"; help ;;
esac esac
} }
@@ -579,5 +529,5 @@ trap 'echo -e "${RED}Script interrupted.${NC}"; exit 1' INT TERM
if [[ -n $argOne ]]; then if [[ -n $argOne ]]; then
checkForInput "$argOne" checkForInput "$argOne"
else else
show_menu help
fi fi