This commit is contained in:
60
proxDoc.sh
60
proxDoc.sh
@@ -79,10 +79,7 @@ check_requirements() {
|
|||||||
|
|
||||||
|
|
||||||
checkIfOnHypervisor() {
|
checkIfOnHypervisor() {
|
||||||
if ! command -v pveversion >/dev/null 2>&1; then
|
command -v pveversion >/dev/null 2>&1
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
###################
|
###################
|
||||||
@@ -91,10 +88,21 @@ checkIfOnHypervisor() {
|
|||||||
get_system_info() {
|
get_system_info() {
|
||||||
echo -e "\n${GREEN}=== System Information ===${NC}"
|
echo -e "\n${GREEN}=== System Information ===${NC}"
|
||||||
echo -e "\n${GREEN}=== Diagnostic Run: $(date '+%Y-%m-%d %H:%M:%S') ===${NC}"
|
echo -e "\n${GREEN}=== Diagnostic Run: $(date '+%Y-%m-%d %H:%M:%S') ===${NC}"
|
||||||
echo -e "${GREEN}Hostname:$(uname -n)${NC}"
|
echo -e "${GREEN}Hostname:${NC} $(uname -n)"
|
||||||
echo -e "${GREEN}Kernel:$(uname -r)${NC}"
|
echo -e "${GREEN}Kernel:${NC} $(uname -r)"
|
||||||
|
|
||||||
|
if checkIfOnHypervisor; then
|
||||||
echo -e "\n${GREEN}=== Proxmox Version ===${NC}"
|
echo -e "\n${GREEN}=== Proxmox Version ===${NC}"
|
||||||
pveversion || echo "Not available"
|
pveversion
|
||||||
|
else
|
||||||
|
echo -e "\n${GREEN}=== OS Information ===${NC}"
|
||||||
|
if [[ -f /etc/os-release ]]; then
|
||||||
|
source /etc/os-release
|
||||||
|
echo -e "${GREEN}Distribution:${NC} $PRETTY_NAME"
|
||||||
|
else
|
||||||
|
echo "OS information not available"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_temp_info() {
|
get_temp_info() {
|
||||||
@@ -445,10 +453,16 @@ quick_health_check() {
|
|||||||
# Proxmox Specific Functions
|
# Proxmox Specific Functions
|
||||||
###################
|
###################
|
||||||
check_services() {
|
check_services() {
|
||||||
|
if ! checkIfOnHypervisor; then
|
||||||
|
log_message warn "Not on Proxmox - skipping Proxmox service checks"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN}Checking critical services:${NC}"
|
echo -e "${GREEN}Checking critical services:${NC}"
|
||||||
services=("pvedaemon" "pveproxy" "pvecluster" "pve-cluster" "corosync")
|
local services=("pvedaemon" "pveproxy" "pvecluster" "pve-cluster" "corosync")
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
status=$(systemctl is-active "$service")
|
local status
|
||||||
|
status=$(systemctl is-active "$service" 2>/dev/null || echo "not-found")
|
||||||
echo -e "${GREEN}$service:${NC} $status"
|
echo -e "${GREEN}$service:${NC} $status"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -462,15 +476,25 @@ check_pve_version() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
list_vms() {
|
list_vms() {
|
||||||
|
if ! checkIfOnHypervisor; then
|
||||||
|
log_message info "Not on Proxmox - skipping VM list"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v qm >/dev/null 2>&1; then
|
if command -v qm >/dev/null 2>&1; then
|
||||||
echo -e "${GREEN}Virtual Machine Status:${NC}"
|
echo -e "${GREEN}Virtual Machine Status:${NC}"
|
||||||
qm list
|
qm list
|
||||||
else
|
else
|
||||||
handle_error "qm command not found"
|
log_message warn "qm command not found"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
list_containers() {
|
list_containers() {
|
||||||
|
if ! checkIfOnHypervisor; then
|
||||||
|
log_message info "Not on Proxmox - skipping container list"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v pct >/dev/null 2>&1; then
|
if command -v pct >/dev/null 2>&1; then
|
||||||
echo -e "\n${GREEN}=== LXC Container Status ===${NC}"
|
echo -e "\n${GREEN}=== LXC Container Status ===${NC}"
|
||||||
pct list
|
pct list
|
||||||
@@ -512,6 +536,16 @@ help() {
|
|||||||
###################
|
###################
|
||||||
runDiags() {
|
runDiags() {
|
||||||
log_message info "Beginning system examination..."
|
log_message info "Beginning system examination..."
|
||||||
|
|
||||||
|
# Check if running on Proxmox
|
||||||
|
local is_proxmox=false
|
||||||
|
if checkIfOnHypervisor; then
|
||||||
|
is_proxmox=true
|
||||||
|
log_message info "Detected Proxmox VE hypervisor"
|
||||||
|
else
|
||||||
|
log_message warn "Not running on Proxmox VE - some checks will be skipped"
|
||||||
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
get_system_info
|
get_system_info
|
||||||
get_cpu_info
|
get_cpu_info
|
||||||
@@ -529,14 +563,18 @@ runDiags() {
|
|||||||
get_system_status
|
get_system_status
|
||||||
get_node_exporter_status
|
get_node_exporter_status
|
||||||
get_hwmon_status
|
get_hwmon_status
|
||||||
|
|
||||||
|
# Only run Proxmox-specific checks if on Proxmox
|
||||||
|
if [[ "$is_proxmox" == true ]]; then
|
||||||
get_ceph_health
|
get_ceph_health
|
||||||
list_vms
|
list_vms
|
||||||
list_containers
|
list_containers
|
||||||
|
fi
|
||||||
) & show_progress $!
|
) & show_progress $!
|
||||||
|
|
||||||
log_message info "Examination complete"
|
log_message info "Examination complete"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
checkForInput() {
|
checkForInput() {
|
||||||
case $1 in
|
case $1 in
|
||||||
--help) help ;;
|
--help) help ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user