Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
add scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
finzzz committed Jul 4, 2021
1 parent 28a2ed4 commit 6ea0b56
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/proxmox_backup_notif.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash

# add "script: /root/proxmox_backup_notif.sh" to /etc/vzdump.conf

# $1 = variable "phase" : job-start|job-end|job-abort, backup-start|backup-end|backup-abort|log-end|pre-stop|pre-restart|post-restart
# $2 = mode : stop/suspend/snapshot
# $3 = vmid

if [ "$1" == "backup-end" ]; then
(cd "$(dirname $0)" && ./bucktrix send "Proxmox: VM $3 backup success")
fi
18 changes: 18 additions & 0 deletions scripts/smartctl_notif.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /bin/bash

DISK=("a" "b" "c")
ATTRS=("^SMART overall-health" "Reallocated_Sector_Ct" "Reported_Uncorrect" "Command_Timeout" "Current_Pending_Sector" "Offline_Uncorrectable")

echo "" > /dev/shm/smartstat

for i in "${DISK[@]}"; do
echo "/dev/sd$i" >> /dev/shm/smartstat
SMART=$(smartctl --attributes -H /dev/sd"$i")
for j in "${ATTRS[@]}"; do
echo "$SMART" | grep -E "$j" >> /dev/shm/smartstat
done
echo "---" >> /dev/shm/smartstat
done

(cd "$(dirname $0)" && ./bucktrix send "$(cat /dev/shm/smartstat)")
rm /dev/shm/smartstat

0 comments on commit 6ea0b56

Please sign in to comment.