mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-06-27 01:34:57 +02:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca7bf1212a | |||
| 9bacda8c21 | |||
| dc26b8358e | |||
| 01a6c1ddec | |||
| 3e544b750d | |||
| 681924cb1a | |||
| 6ea04b7602 | |||
| b2d20799d8 | |||
| 324fa33d8c | |||
| 5aed3bdde5 |
@@ -486,6 +486,23 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
</details>
|
||||
|
||||
## 2026-06-26
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- Termix: Update Nginx configuration file paths [@xyzulu](https://github.com/xyzulu) ([#15397](https://github.com/community-scripts/ProxmoxVE/pull/15397))
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- fix databasus update/install errors [@asylumexp](https://github.com/asylumexp) ([#15403](https://github.com/community-scripts/ProxmoxVE/pull/15403))
|
||||
|
||||
### 💾 Core
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- fix(build.func): set /dev/kfd GID in fix_gpu_gids for AMD ROCm [@jamiej](https://github.com/jamiej) ([#15401](https://github.com/community-scripts/ProxmoxVE/pull/15401))
|
||||
- fix alpine mktmp error [@asylumexp](https://github.com/asylumexp) ([#15398](https://github.com/community-scripts/ProxmoxVE/pull/15398))
|
||||
|
||||
## 2026-06-25
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
+3
-3
@@ -52,11 +52,11 @@ function update_script() {
|
||||
[[ "$MONGO_ARCH" == "arm64" ]] && MONGO_DIST="ubuntu2204"
|
||||
fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-${MONGO_ARCH}-100.16.1.deb"
|
||||
fi
|
||||
ensure_dependencies mariadb-client
|
||||
mkdir -p /usr/local/mariadb-{10.6,12.1}/bin /usr/local/mysql-{5.7,8.0,8.4,9}/bin /usr/local/mongodb-database-tools/bin
|
||||
[[ -f /usr/bin/mongodump ]] && ln -sf /usr/bin/mongodump /usr/local/mongodb-database-tools/bin/mongodump
|
||||
[[ -f /usr/bin/mongorestore ]] && ln -sf /usr/bin/mongorestore /usr/local/mongodb-database-tools/bin/mongorestore
|
||||
# Create MariaDB and MySQL client symlinks for compatibility
|
||||
ensure_dependencies mariadb-client
|
||||
mkdir -p /usr/local/mariadb-{10.6,12.1}/bin /usr/local/mysql-{5.7,8.0,8.4,9}/bin /usr/local/mongodb-database-tools/bin
|
||||
for dir in /usr/local/mariadb-{10.6,12.1}/bin; do
|
||||
ln -sf /usr/bin/mariadb-dump "$dir/mariadb-dump"
|
||||
ln -sf /usr/bin/mariadb "$dir/mariadb"
|
||||
@@ -79,7 +79,7 @@ function update_script() {
|
||||
cd /opt/databasus/backend
|
||||
$STD go mod download
|
||||
$STD /root/go/bin/swag init -g cmd/main.go -o swagger
|
||||
$STD env CGO_ENABLED=0 GOOS=linux GOARCH=$(arch_resolve) go build -o databasus ./cmd/main.go
|
||||
$STD env CGO_ENABLED=0 GOOS=linux GOARCH=$(arch_resolve) go build -o databasus ./cmd
|
||||
mv /opt/databasus/backend/databasus /opt/databasus/databasus
|
||||
mkdir -p /opt/databasus/ui/build
|
||||
cp -r /opt/databasus/frontend/dist/* /opt/databasus/ui/build/
|
||||
|
||||
+1
-1
@@ -200,7 +200,7 @@ EOF
|
||||
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
|
||||
curl -fsSL "https://raw.githubusercontent.com/Termix-SSH/Termix/main/docker/nginx.conf" -o /etc/nginx/nginx.conf
|
||||
sed -i '/^master_process/d' /etc/nginx/nginx.conf
|
||||
sed -i 's|pid /tmp/nginx/nginx.pid;|pid /run/nginx.pid;|' /etc/nginx/nginx.conf
|
||||
sed -i '/^pid \/app\/nginx/d' /etc/nginx/nginx.conf
|
||||
sed -i 's|error_log /tmp/nginx/error.log|error_log /var/log/nginx/error.log|' /etc/nginx/nginx.conf
|
||||
sed -i 's|access_log /tmp/nginx/access.log|access_log /var/log/nginx/access.log|' /etc/nginx/nginx.conf
|
||||
sed -i 's|/app/html|/opt/termix/html|g' /etc/nginx/nginx.conf
|
||||
|
||||
@@ -33,7 +33,7 @@ done
|
||||
# Install MongoDB Database Tools via direct .deb (no APT repo for Debian 13)
|
||||
[[ "$(get_os_info id)" == "ubuntu" ]] && MONGO_DIST="ubuntu2204" || MONGO_DIST="debian12"
|
||||
# MongoDB only publishes arm64 builds for Ubuntu
|
||||
[[ "$MONGO_ARCH" == "arm64" ]] && MONGO_DIST="ubuntu2204"
|
||||
[[ "$(arch_resolve "x86_64" "arm64")" == "arm64" ]] && MONGO_DIST="ubuntu2204"
|
||||
MONGO_VERSION=$(get_latest_gh_tag "mongodb/mongo-tools" "100." || echo "100.16.1")
|
||||
fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-$(arch_resolve "x86_64" "arm64")-${MONGO_VERSION}.deb" ""
|
||||
mkdir -p /usr/local/mongodb-database-tools/bin
|
||||
@@ -65,7 +65,7 @@ $STD go mod tidy
|
||||
$STD go mod download
|
||||
$STD go install github.com/swaggo/swag/cmd/swag@latest
|
||||
$STD /root/go/bin/swag init -g cmd/main.go -o swagger
|
||||
$STD env CGO_ENABLED=0 GOOS=linux GOARCH=$(arch_resolve) go build -o databasus ./cmd/main.go
|
||||
$STD env CGO_ENABLED=0 GOOS=linux GOARCH=$(arch_resolve) go build -o databasus ./cmd
|
||||
mv /opt/databasus/backend/databasus /opt/databasus/databasus
|
||||
mkdir -p /databasus-data/{pgdata,temp,backups,data,logs}
|
||||
mkdir -p /opt/databasus/ui/build
|
||||
|
||||
@@ -5430,6 +5430,7 @@ fix_gpu_gids() {
|
||||
# Update dev entries with correct GIDs
|
||||
sed -i.bak -E "s|(dev[0-9]+: /dev/dri/renderD[0-9]+),gid=[0-9]+|\1,gid=${render_gid}|g" "$LXC_CONFIG"
|
||||
sed -i -E "s|(dev[0-9]+: /dev/dri/card[0-9]+),gid=[0-9]+|\1,gid=${video_gid}|g" "$LXC_CONFIG"
|
||||
sed -i -E "s|(dev[0-9]+: /dev/kfd),gid=[0-9]+|\1,gid=${render_gid}|g" "$LXC_CONFIG"
|
||||
|
||||
# Restart container
|
||||
pct start "$CTID" >/dev/null 2>&1
|
||||
@@ -5451,6 +5452,10 @@ fix_gpu_gids() {
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ -e /dev/kfd ]; then
|
||||
chgrp ${render_gid} /dev/kfd 2>/dev/null || true
|
||||
chmod 660 /dev/kfd 2>/dev/null || true
|
||||
fi
|
||||
" >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
Executable
+156
@@ -0,0 +1,156 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/refs/heads/main/misc/core.func)
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true
|
||||
load_functions
|
||||
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "disk-health" "pve"
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
____ _ __ __ __ ____ __
|
||||
/ __ \(_)____/ /__ / / / /__ ____ _/ / /_/ /_
|
||||
/ / / / / ___/ //_/ / /_/ / _ \/ __ `/ / __/ __ \
|
||||
/ /_/ / (__ ) ,< / __ / __/ /_/ / / /_/ / / /
|
||||
/_____/_/____/_/|_| /_/ /_/\___/\__,_/_/\__/_/ /_/
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
header_info
|
||||
|
||||
# Must run as root (SMART access requires it)
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
msg_error "This script must be run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v pveversion >/dev/null 2>&1; then
|
||||
msg_error "No Proxmox VE detected!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install required tooling on demand
|
||||
if ! command -v smartctl >/dev/null 2>&1; then
|
||||
msg_info "Installing smartmontools"
|
||||
apt-get update &>/dev/null
|
||||
if apt-get install -y smartmontools &>/dev/null; then
|
||||
msg_ok "Installed smartmontools"
|
||||
else
|
||||
msg_error "Failed to install smartmontools"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if ! command -v nvme >/dev/null 2>&1; then
|
||||
msg_info "Installing nvme-cli"
|
||||
if apt-get install -y nvme-cli &>/dev/null; then
|
||||
msg_ok "Installed nvme-cli"
|
||||
else
|
||||
msg_error "nvme-cli not available (NVMe details limited)"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Collect physical disks (exclude loop, zram and device-mapper devices)
|
||||
mapfile -t DISKS < <(lsblk -dn -o NAME,TYPE | awk '$2=="disk"{print $1}' | grep -vE '^(loop|zram|dm-)' | sort)
|
||||
|
||||
if [ "${#DISKS[@]}" -eq 0 ]; then
|
||||
msg_error "No physical disks found."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Pull a single attribute value out of "smartctl -A" output by attribute name
|
||||
sata_attr() {
|
||||
local output="$1" name="$2"
|
||||
echo "$output" | awk -v n="$name" '$2==n {print $10; exit}'
|
||||
}
|
||||
|
||||
report_disk() {
|
||||
local dev="$1"
|
||||
local path="/dev/${dev}"
|
||||
local model size health
|
||||
model=$(lsblk -dn -o MODEL "$path" 2>/dev/null | sed 's/[[:space:]]*$//')
|
||||
size=$(lsblk -dn -o SIZE "$path" 2>/dev/null | tr -d ' ')
|
||||
|
||||
echo -e "\n${BL}======================================================${CL}"
|
||||
echo -e "${GN}${path}${CL} ${YW}${size:-?}${CL} ${model:-Unknown model}"
|
||||
echo -e "${BL}======================================================${CL}"
|
||||
|
||||
# Overall SMART health verdict
|
||||
health=$(smartctl -H "$path" 2>/dev/null | grep -iE "SMART overall-health|SMART Health Status" | sed 's/.*: *//')
|
||||
if [ -z "$health" ]; then
|
||||
echo -e " Health: ${YW}SMART not available for this device${CL}"
|
||||
elif echo "$health" | grep -qiE "PASSED|OK"; then
|
||||
echo -e " Health: ${GN}${health}${CL}"
|
||||
else
|
||||
echo -e " Health: ${RD}${health}${CL}"
|
||||
fi
|
||||
|
||||
if [[ "$dev" == nvme* ]]; then
|
||||
local a
|
||||
a=$(smartctl -A "$path" 2>/dev/null)
|
||||
echo "$a" | grep -iE "Temperature:|Available Spare:|Percentage Used:|Data Units Written:|Power On Hours:|Unsafe Shutdowns:|Media and Data Integrity Errors:" |
|
||||
sed 's/^/ /'
|
||||
else
|
||||
local a poh temp realloc pending offline crc wear
|
||||
a=$(smartctl -A "$path" 2>/dev/null)
|
||||
poh=$(sata_attr "$a" "Power_On_Hours")
|
||||
temp=$(sata_attr "$a" "Temperature_Celsius")
|
||||
realloc=$(sata_attr "$a" "Reallocated_Sector_Ct")
|
||||
pending=$(sata_attr "$a" "Current_Pending_Sector")
|
||||
offline=$(sata_attr "$a" "Offline_Uncorrectable")
|
||||
crc=$(sata_attr "$a" "UDMA_CRC_Error_Count")
|
||||
wear=$(sata_attr "$a" "Wear_Leveling_Count")
|
||||
[ -z "$wear" ] && wear=$(sata_attr "$a" "Media_Wearout_Indicator")
|
||||
|
||||
[ -n "$temp" ] && echo -e " Temperature: ${temp} C"
|
||||
[ -n "$poh" ] && echo -e " Power On Hours: ${poh}"
|
||||
[ -n "$wear" ] && echo -e " Wear Leveling/Wearout: ${wear}"
|
||||
print_attr() {
|
||||
local label="$1" val="$2"
|
||||
[ -z "$val" ] && return
|
||||
if [ "$val" -gt 0 ] 2>/dev/null; then
|
||||
echo -e " ${label} ${RD}${val}${CL}"
|
||||
else
|
||||
echo -e " ${label} ${GN}${val}${CL}"
|
||||
fi
|
||||
}
|
||||
print_attr "Reallocated Sectors: " "$realloc"
|
||||
print_attr "Pending Sectors: " "$pending"
|
||||
print_attr "Offline Uncorrectable:" "$offline"
|
||||
print_attr "UDMA CRC Errors: " "$crc"
|
||||
fi
|
||||
}
|
||||
|
||||
header_info
|
||||
echo -e "${YW}Scanning ${#DISKS[@]} disk(s) for SMART health...${CL}"
|
||||
for d in "${DISKS[@]}"; do
|
||||
report_disk "$d"
|
||||
done
|
||||
echo
|
||||
|
||||
# Offer an optional, non-destructive short self-test
|
||||
if whiptail --backtitle "Proxmox VE Helper Scripts" --title "SMART Self-Test" \
|
||||
--yesno "Health report complete.\n\nDo you want to start a non-destructive SHORT SMART self-test on a disk?\n\n(The test runs in the background; check results later with: smartctl -a /dev/XXX)" 14 70; then
|
||||
TEST_MENU=()
|
||||
for d in "${DISKS[@]}"; do
|
||||
TEST_MENU+=("$d" "/dev/$d" "OFF")
|
||||
done
|
||||
sel=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Select Disk for Short Self-Test" \
|
||||
--radiolist "\nSelect a disk:\n" 16 60 6 "${TEST_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"')
|
||||
if [ -n "$sel" ]; then
|
||||
msg_info "Starting short self-test on /dev/$sel"
|
||||
if smartctl -t short "/dev/$sel" &>/dev/null; then
|
||||
msg_ok "Short self-test started on /dev/$sel"
|
||||
echo -e "${YW}Check progress/result with: ${GN}smartctl -a /dev/$sel${CL}"
|
||||
else
|
||||
msg_error "Could not start self-test on /dev/$sel"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "\n${GN}Disk health check complete.${CL}\n"
|
||||
Reference in New Issue
Block a user