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:
45
README.md
45
README.md
@@ -5,7 +5,6 @@ ProxDoc is a comprehensive diagnostic tool for Proxmox server health monitoring
|
||||
## Features
|
||||
|
||||
- Complete system diagnostics and health checks
|
||||
- **Interactive menu system** when run without arguments
|
||||
- **DriveAtlas integration** for physical drive bay mapping
|
||||
- **Ceph cluster health** monitoring (OSD tree, pool usage, disk usage)
|
||||
- **Node Exporter status** check for Prometheus monitoring
|
||||
@@ -23,7 +22,6 @@ ProxDoc is a comprehensive diagnostic tool for Proxmox server health monitoring
|
||||
- Hardware information
|
||||
- Service status monitoring
|
||||
- VM and Container status
|
||||
- Remote host diagnostics capability
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -41,11 +39,25 @@ Optional tools for enhanced diagnostics:
|
||||
|
||||
## Usage
|
||||
|
||||
Run remotely via curl:
|
||||
```bash
|
||||
./proxdoc.sh [OPTIONS]
|
||||
curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh" | bash -s -- [OPTION]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```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
|
||||
|
||||
# Show drive bay mapping
|
||||
curl -sL "http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh" | bash -s -- --drives
|
||||
```
|
||||
|
||||
### 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
|
||||
- `--ct-list`: Check container vitals
|
||||
- `--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
|
||||
|
||||
@@ -90,19 +92,12 @@ The script provides detailed information about:
|
||||
- Recent system errors
|
||||
- VM and container status
|
||||
|
||||
## Installation
|
||||
|
||||
1. Download the script
|
||||
2. Make it executable:
|
||||
```bash
|
||||
chmod +x proxdoc.sh
|
||||
```
|
||||
|
||||
## Note
|
||||
|
||||
This script must be run as root
|
||||
Designed for Proxmox environments
|
||||
Supports Proxmox version 6.0 and above
|
||||
- This script must be run as root
|
||||
- Designed for Proxmox environments
|
||||
- Supports Proxmox version 6.0 and above
|
||||
- No local installation required - runs directly from Gitea
|
||||
|
||||
## Version
|
||||
|
||||
@@ -111,7 +106,6 @@ Current Version: 1.1.0
|
||||
### Changelog
|
||||
|
||||
#### v1.1.0
|
||||
- Added interactive menu system when run without arguments
|
||||
- Added DriveAtlas integration (`--drives`) for physical drive bay mapping
|
||||
- Added Ceph cluster health monitoring (`--ceph`)
|
||||
- Added Node Exporter status check (`--node-exporter`)
|
||||
@@ -120,6 +114,7 @@ Current Version: 1.1.0
|
||||
- Added container list option (`--ct-list`)
|
||||
- Full diagnostics now include all monitoring checks
|
||||
- Improved error handling with graceful fallbacks
|
||||
- Optimized for remote execution via curl
|
||||
|
||||
#### v1.0.0
|
||||
- Initial release
|
||||
58
proxDoc.sh
58
proxDoc.sh
@@ -438,7 +438,9 @@ list_containers() {
|
||||
###################
|
||||
help() {
|
||||
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 ""
|
||||
echo "Treatment Options:"
|
||||
@@ -453,61 +455,11 @@ help() {
|
||||
echo " --vm-list Check VM vitals"
|
||||
echo " --ct-list Check container vitals"
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
@@ -549,12 +501,10 @@ checkForInput() {
|
||||
--ceph) get_ceph_health ;;
|
||||
--node-exporter) get_node_exporter_status ;;
|
||||
--hwmon) get_hwmon_status ;;
|
||||
--connect) connectToHost ;;
|
||||
--services) check_services ;;
|
||||
--vm-list) list_vms ;;
|
||||
--ct-list) list_containers ;;
|
||||
--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 ;;
|
||||
esac
|
||||
}
|
||||
@@ -579,5 +529,5 @@ trap 'echo -e "${RED}Script interrupted.${NC}"; exit 1' INT TERM
|
||||
if [[ -n $argOne ]]; then
|
||||
checkForInput "$argOne"
|
||||
else
|
||||
show_menu
|
||||
help
|
||||
fi
|
||||
Reference in New Issue
Block a user