mirror of https://github.com/tteck/Proxmox.git
Compare commits
7 Commits
2ca3e77bea
...
d51a8df90f
Author | SHA1 | Date |
---|---|---|
|
d51a8df90f | |
|
70ce72fcbf | |
|
e946f41890 | |
|
465cd75015 | |
|
1dc63002ad | |
|
15f5285120 | |
|
485444b07d |
|
@ -2,6 +2,14 @@
|
||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## 2023-04-30
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- **Proxmox VE Monitor-All**
|
||||||
|
- NEW Script
|
||||||
|
- Replaces Proxmox VE LXC Monitor
|
||||||
|
|
||||||
## 2023-04-28
|
## 2023-04-28
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -375,6 +375,9 @@ install_script() {
|
||||||
ssh_check
|
ssh_check
|
||||||
arch_check
|
arch_check
|
||||||
pve_check
|
pve_check
|
||||||
|
if systemctl is-active -q ping-instances.service; then
|
||||||
|
systemctl stop ping-instances.service
|
||||||
|
fi
|
||||||
NEXTID=$(pvesh get /cluster/nextid)
|
NEXTID=$(pvesh get /cluster/nextid)
|
||||||
timezone=$(cat /etc/timezone)
|
timezone=$(cat /etc/timezone)
|
||||||
header_info
|
header_info
|
||||||
|
@ -508,4 +511,7 @@ description() {
|
||||||
pct set "$CTID" -description "# ${APP} LXC
|
pct set "$CTID" -description "# ${APP} LXC
|
||||||
### https://tteck.github.io/Proxmox/
|
### https://tteck.github.io/Proxmox/
|
||||||
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
|
<a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/☕-Buy me a coffee-red' /></a>"
|
||||||
|
if [[ -f /etc/systemd/system/ping-instances.service ]]; then
|
||||||
|
systemctl start ping-instances.service
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ while true; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
clear
|
clear
|
||||||
containers=$(pct list | tail -n +2 | cut -f1 -d' ')
|
|
||||||
function clean_container() {
|
function clean_container() {
|
||||||
container=$1
|
container=$1
|
||||||
header_info
|
header_info
|
||||||
|
@ -43,7 +42,7 @@ function clean_container() {
|
||||||
pct exec $container -- bash -c "apt-get -y --purge autoremove && apt-get -y autoclean && bash <(curl -fsSL https://github.com/tteck/Proxmox/raw/main/misc/clean.sh) && rm -rf /var/lib/apt/lists/* && apt-get update"
|
pct exec $container -- bash -c "apt-get -y --purge autoremove && apt-get -y autoclean && bash <(curl -fsSL https://github.com/tteck/Proxmox/raw/main/misc/clean.sh) && rm -rf /var/lib/apt/lists/* && apt-get update"
|
||||||
}
|
}
|
||||||
|
|
||||||
for container in $containers; do
|
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||||
os=$(pct config "$container" | awk '/^ostype/ {print $2}')
|
os=$(pct config "$container" | awk '/^ostype/ {print $2}')
|
||||||
if [ "$os" != "debian" ] && [ "$os" != "ubuntu" ]; then
|
if [ "$os" != "debian" ] && [ "$os" != "ubuntu" ]; then
|
||||||
header_info
|
header_info
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
# Author: tteck (tteckster)
|
# Author: tteck (tteckster)
|
||||||
# License: MIT
|
# License: MIT
|
||||||
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||||
# Proxmox VE LXC Monitor All
|
|
||||||
# bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/monitor-all.sh)" -s add
|
|
||||||
|
|
||||||
clear
|
clear
|
||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
|
@ -32,17 +30,9 @@ echo '#!/usr/bin/env bash
|
||||||
excluded_instances=("$@")
|
excluded_instances=("$@")
|
||||||
echo "Excluded instances: ${excluded_instances[@]}"
|
echo "Excluded instances: ${excluded_instances[@]}"
|
||||||
|
|
||||||
while true
|
while true; do
|
||||||
do
|
|
||||||
# Get the list of containers and virtual machines
|
|
||||||
containers=$(pct list | tail -n +2 | cut -f1 -d" ")
|
|
||||||
virtual_machines=$(qm list | grep -oP "^\s*\K\d+(?=\s)")
|
|
||||||
|
|
||||||
# Combine the container and virtual machine lists
|
for instance in $(pct list | awk '\''{if(NR>1) print $1}'\''; qm list | awk '\''{if(NR>1) print $1}'\''); do
|
||||||
all_instances="$containers $virtual_machines"
|
|
||||||
|
|
||||||
for instance in $all_instances
|
|
||||||
do
|
|
||||||
# Skip excluded instances
|
# Skip excluded instances
|
||||||
if [[ " ${excluded_instances[@]} " =~ " ${instance} " ]]; then
|
if [[ " ${excluded_instances[@]} " =~ " ${instance} " ]]; then
|
||||||
continue
|
continue
|
||||||
|
@ -96,7 +86,7 @@ done >> /var/log/ping-instances.log 2>&1' >/usr/local/bin/ping-instances.sh
|
||||||
# Change file permissions to executable
|
# Change file permissions to executable
|
||||||
chmod +x /usr/local/bin/ping-instances.sh
|
chmod +x /usr/local/bin/ping-instances.sh
|
||||||
|
|
||||||
# Create ping-containers.service
|
# Create ping-instances.service
|
||||||
echo '[Unit]
|
echo '[Unit]
|
||||||
Description=Ping instances every 5 minutes and restarts if necessary
|
Description=Ping instances every 5 minutes and restarts if necessary
|
||||||
|
|
||||||
|
@ -112,7 +102,7 @@ StandardError=file:/var/log/ping-instances.log
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target' >/etc/systemd/system/ping-instances.service
|
WantedBy=multi-user.target' >/etc/systemd/system/ping-instances.service
|
||||||
|
|
||||||
# Reload daemon, enable and start ping-containers.service
|
# Reload daemon, enable and start ping-instances.service
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable -q --now ping-instances.service
|
systemctl enable -q --now ping-instances.service
|
||||||
clear
|
clear
|
||||||
|
|
|
@ -49,7 +49,7 @@ function update_container() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
header_info
|
header_info
|
||||||
for container in $(pct list | tail -n +2 | cut -f1 -d' '); do
|
for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||||
excluded=false
|
excluded=false
|
||||||
for excluded_container in "${excluded_containers[@]}"; do
|
for excluded_container in "${excluded_containers[@]}"; do
|
||||||
if [ "$container" == "$excluded_container" ]; then
|
if [ "$container" == "$excluded_container" ]; then
|
||||||
|
|
Loading…
Reference in New Issue