[PVE-User] Request New Features for Web-UI
Toan Pham
tpham3783 at gmail.com
Wed Mar 21 20:29:04 CET 2018
@Thomas - thank you so much for sharing some of your insights about the
requested features. I'll look forward for the WakeOnLan feature. So, if
you have a git url (or something) of your development branch, please let me
know so that I can track it and also to learn more about the code for
myself.
@Mark, you have a good point about remote monitoring with Nagios or zabbix.
thanks, I'll take the Zabbix route since I already have an active
instance.
@Lutz - I have a very similar backup solution to yours except that i use
syncoid to backup an entire zpool to the remote proxmox server. On the
other hand backup gets initiated from cron but shutdown is initiated from
the remote proxmox server, that because I wanted the remote proxmox server
to shutdown based on various conditions. Here are my snipplets:
# part of the backup script to initiate backup
#############################################################
if ping -c 2 192.168.1.20; then
# raphson is dev machine
syncoid -r -sshkey
/usr/local/src/password/ssh/id_rsa.private.nopassword satapool
root at 192.168.1.20:satapool
bstatus=$?
else
# raphson is proxmox server
wol "48:5b:39:6c:22:58"
sleep 260;
syncoid -r -sshkey
/usr/local/src/password/ssh/id_rsa.private.nopassword satapool
root at 192.168.1.6:satapool
fi;
# auto shutdown proxmox if there's no active KVM
##############################################################
KVM_NOT_RUNNING_MINUTES_POWER_DOWN=30
LAST_TIME_FILE=/tmp/.kvm
MEMORY=$(free -m | awk 'NR==2{printf "%.2f%%\t\t", $3*100/$2 }')
DISK=$(df -h | awk '$NF=="/"{printf "%s\t\t", $5}')
CPU=$(top -bn1 | grep load | awk '{printf "%.2f%%\t\t\n", $(NF-2)}')
# Find out how many instances of kvm are running
kvm_number=$(ps -aux | grep "/usr/bin/kvm" | wc -l)
last_time=$(cat $LAST_TIME_FILE)
last_time=${last_time:-1}
this_time=$(date +%s);
logged_in_users=$(who | wc -l)
[ $logged_in_users -gt 0 ] && exit 0;
ssh_session_count=$(ps -aux | grep ssh: | wc -l)
[ $ssh_session_count -gt 1 ] && exit 0;
[ -f /tmp/do_not_shutdown ] && exit 0;
if [ $kvm_number -eq 1 ] ; then
echo "no kvm is running"
if [ $(($this_time-$last_time)) -gt
$((60*$KVM_NOT_RUNNING_MINUTES_POWER_DOWN)) ]; then
shutdown -h now
fi;
else
echo "kvm is still running";
fi;
if [ $(($this_time-$last_time)) -gt
$((60*$KVM_NOT_RUNNING_MINUTES_POWER_DOWN)) ]; then
echo "$this_time" > $LAST_TIME_FILE
elif [ $last_time -eq 1 ]; then
echo "$this_time" > $LAST_TIME_FILE
fi;
More information about the pve-user
mailing list