From 0a35b1a5bb3bb8c61aa1e8f95e14048667263101 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 6 Jun 2024 22:24:44 -0400 Subject: [PATCH 1/9] Update iventoy-install.sh fix spacing in service file --- install/iventoy-install.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/install/iventoy-install.sh b/install/iventoy-install.sh index 3c3e39538..ea58b59d6 100644 --- a/install/iventoy-install.sh +++ b/install/iventoy-install.sh @@ -31,18 +31,18 @@ msg_ok "Installed iVentoy" msg_info "Creating Service" cat </etc/systemd/system/iventoy.service [Unit] -Description =iVentoy PXE Booter -Documentation =https://www.iventoy.com -Wants =network-online.target +Description=iVentoy PXE Booter +Documentation=https://www.iventoy.com +Wants=network-online.target [Service] -Type =forking -Environment =IVENTOY_API_ALL=1 -Environment =IVENTOY_AUTO_RUN=1 -Environment =LIBRARY_PATH=/opt/iventoy/lib/lin64 -Environment =LD_LIBRARY_PATH=/opt/iventoy/lib/lin64 -ExecStart =sh ./iventoy.sh -R start -WorkingDirectory =/opt/iventoy -Restart =on-failure +Type=forking +Environment=IVENTOY_API_ALL=1 +Environment=IVENTOY_AUTO_RUN=1 +Environment=LIBRARY_PATH=/opt/iventoy/lib/lin64 +Environment=LD_LIBRARY_PATH=/opt/iventoy/lib/lin64 +ExecStart=sh ./iventoy.sh -R start +WorkingDirectory=/opt/iventoy +Restart=on-failure [Install] WantedBy=multi-user.target EOF From 9ba59e0b561c9289aa712e7b9872432ec150b48b Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 9 Jun 2024 03:23:59 -0400 Subject: [PATCH 2/9] Correct ceph enterprise urls (#3157) --- misc/post-pve-install.sh | 4 ++-- misc/pve8-upgrade.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/post-pve-install.sh b/misc/post-pve-install.sh index ec8d7d989..f142b8509 100644 --- a/misc/post-pve-install.sh +++ b/misc/post-pve-install.sh @@ -105,9 +105,9 @@ EOF yes) msg_info "Correcting 'ceph package repositories'" cat </etc/apt/sources.list.d/ceph.list -# deb http://download.proxmox.com/debian/ceph-quincy bookworm enterprise +# deb https://enterprise.proxmox.com/debian/ceph-quincy bookworm enterprise # deb http://download.proxmox.com/debian/ceph-quincy bookworm no-subscription -# deb http://download.proxmox.com/debian/ceph-reef bookworm enterprise +# deb https://enterprise.proxmox.com/debian/ceph-reef bookworm enterprise # deb http://download.proxmox.com/debian/ceph-reef bookworm no-subscription EOF msg_ok "Corrected 'ceph package repositories'" diff --git a/misc/pve8-upgrade.sh b/misc/pve8-upgrade.sh index 86aaee2f0..360b339b1 100644 --- a/misc/pve8-upgrade.sh +++ b/misc/pve8-upgrade.sh @@ -73,7 +73,7 @@ EOF whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "PVE8 CEPH PACKAGE REPOSITORIES" "The 'Ceph Package Repositories' provides access to both the 'no-subscription' and 'enterprise' repositories." 10 58 msg_info "Enabling 'ceph package repositories'" cat </etc/apt/sources.list.d/ceph.list -# deb http://download.proxmox.com/debian/ceph-quincy bookworm enterprise +# deb https://enterprise.proxmox.com/debian/ceph-quincy bookworm enterprise deb http://download.proxmox.com/debian/ceph-quincy bookworm no-subscription EOF msg_ok "Enabled 'ceph package repositories'" From 21c1240c8cde15dad5d323275f6089db49c3eaa4 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 10 Jun 2024 17:17:58 -0400 Subject: [PATCH 3/9] Update umami-install.sh tweak --- install/umami-install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/umami-install.sh b/install/umami-install.sh index 943c0413d..8fd103b28 100644 --- a/install/umami-install.sh +++ b/install/umami-install.sh @@ -45,6 +45,8 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8' $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" echo "" >~/umami.creds +echo "Umami Database Credentials" >>~/umami.creds +echo "" >>~/umami.creds echo -e "umami Database User: \e[32m$DB_USER\e[0m" >>~/umami.creds echo -e "umami Database Password: \e[32m$DB_PASS\e[0m" >>~/umami.creds echo -e "umami Database Name: \e[32m$DB_NAME\e[0m" >>~/umami.creds From 9a3a05f75a0542fb5a74dc098546e263ae5eafd9 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 11 Jun 2024 13:30:12 -0400 Subject: [PATCH 4/9] Create zabbix.sh --- ct/zabbix.sh | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 ct/zabbix.sh diff --git a/ct/zabbix.sh b/ct/zabbix.sh new file mode 100644 index 000000000..3eb578d07 --- /dev/null +++ b/ct/zabbix.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + _____ __ __ _ +/__ / ____ _/ /_ / /_ (_) __ + / / / __ `/ __ \/ __ \/ / |/_/ + / /__/ /_/ / /_/ / /_/ / /> < +/____/\__,_/_.___/_.___/_/_/|_| + +EOF +} +header_info +echo -e "Loading..." +APP="Zabbix" +var_disk="6" +var_cpu="2" +var_ram="4096" +var_os="debian" +var_version="12" +variables +color +catch_errors + +function default_settings() { + CT_TYPE="1" + PW="" + CT_ID=$NEXTID + HN=$NSAPP + DISK_SIZE="$var_disk" + CORE_COUNT="$var_cpu" + RAM_SIZE="$var_ram" + BRG="vmbr0" + NET="dhcp" + GATE="" + APT_CACHER="" + APT_CACHER_IP="" + DISABLEIP6="no" + MTU="" + SD="" + NS="" + MAC="" + VLAN="" + SSH="no" + VERB="no" + echo_default +} + +function update_script() { +header_info +if [[ ! -f /etc/zabbix/zabbix_server.conf ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +msg_info "Updating $APP LXC" +apt-get update &>/dev/null +apt-get -y upgrade &>/dev/null +msg_ok "Updated $APP LXC" +exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${APP} should be reachable by going to the following URL. + ${BL}http://${IP}/zabbix${CL} \n" From 5bc0ddda2205acfa9f2afeaac7f089a26bd25b92 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 11 Jun 2024 13:31:22 -0400 Subject: [PATCH 5/9] Create zabbix-install.sh --- install/zabbix-install.sh | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 install/zabbix-install.sh diff --git a/install/zabbix-install.sh b/install/zabbix-install.sh new file mode 100644 index 000000000..31416f1d8 --- /dev/null +++ b/install/zabbix-install.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +msg_ok "Installed Dependencies" + +msg_info "Installing Zabbix" +wget -q https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-1+debian12_all.deb +$STD dpkg -i zabbix-release_7.0-1+debian12_all.deb +rm zabbix-release_7.0-1+debian12_all.deb +$STD apt-get update +$STD apt-get install -y zabbix-server-pgsql zabbix-frontend-php php8.2-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent +msg_ok "Installed Zabbix" + +msg_info "Setting up PostgreSQL" +$STD apt-get install -y postgresql +DB_NAME=zabbixdb +DB_USER=zabbix +DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" +$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" +$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" +$STD zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u $DB_USER psql $DB_NAME +sed -i "s/^DBName=.*/DBName=$DB_NAME/" /etc/zabbix/zabbix_server.conf +sed -i "s/^DBUser=.*/DBUser=$DB_USER/" /etc/zabbix/zabbix_server.conf +sed -i "s/^# DBPassword=.*/DBPassword=$DB_PASS/" /etc/zabbix/zabbix_server.conf +echo "" >~/zabbix.creds +echo "zabbix Database Credentials" >>~/zabbix.creds +echo "" >>~/zabbix.creds +echo -e "zabbix Database User: \e[32m$DB_USER\e[0m" >>~/zabbix.creds +echo -e "zabbix Database Password: \e[32m$DB_PASS\e[0m" >>~/zabbix.creds +echo -e "zabbix Database Name: \e[32m$DB_NAME\e[0m" >>~/zabbix.creds +msg_ok "Set up PostgreSQL" + +msg_info "Starting Services" +systemctl restart zabbix-server zabbix-agent apache2 +systemctl enable -q zabbix-server zabbix-agent apache2 +msg_ok "Started Services" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From fd114369e9bebc5031af83a90adc97edba3c6693 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 11 Jun 2024 13:50:59 -0400 Subject: [PATCH 6/9] Update zabbix-install.sh Escape Special Characters --- install/zabbix-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/zabbix-install.sh b/install/zabbix-install.sh index 31416f1d8..e70bbed9b 100644 --- a/install/zabbix-install.sh +++ b/install/zabbix-install.sh @@ -31,7 +31,8 @@ msg_info "Setting up PostgreSQL" $STD apt-get install -y postgresql DB_NAME=zabbixdb DB_USER=zabbix -DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" +RAW_PASS="$(openssl rand -base64 18 | cut -c1-13)" +DB_PASS=$(printf '%s\n' "$RAW_PASS" | sed 's/[&/\]/\\&/g') $STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" From 79b138cc6de0f102a9cf6d7998f96ad3c92aec84 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 11 Jun 2024 14:19:41 -0400 Subject: [PATCH 7/9] Update zabbix-install.sh tweak --- install/zabbix-install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install/zabbix-install.sh b/install/zabbix-install.sh index e70bbed9b..3648f99f3 100644 --- a/install/zabbix-install.sh +++ b/install/zabbix-install.sh @@ -31,8 +31,7 @@ msg_info "Setting up PostgreSQL" $STD apt-get install -y postgresql DB_NAME=zabbixdb DB_USER=zabbix -RAW_PASS="$(openssl rand -base64 18 | cut -c1-13)" -DB_PASS=$(printf '%s\n' "$RAW_PASS" | sed 's/[&/\]/\\&/g') +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) $STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" From 7ea8bdfb95253c0fba6d7118eb7d18712fa5f472 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 11 Jun 2024 15:25:47 -0400 Subject: [PATCH 8/9] Update zabbix-install.sh tweak --- install/zabbix-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/zabbix-install.sh b/install/zabbix-install.sh index 3648f99f3..c7123dea9 100644 --- a/install/zabbix-install.sh +++ b/install/zabbix-install.sh @@ -37,7 +37,7 @@ $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCO $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" -$STD zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u $DB_USER psql $DB_NAME +zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u $DB_USER psql $DB_NAME &>/dev/null sed -i "s/^DBName=.*/DBName=$DB_NAME/" /etc/zabbix/zabbix_server.conf sed -i "s/^DBUser=.*/DBUser=$DB_USER/" /etc/zabbix/zabbix_server.conf sed -i "s/^# DBPassword=.*/DBPassword=$DB_PASS/" /etc/zabbix/zabbix_server.conf From 5e5e2c96a509efccbc52c9a4dbfb71cf71ab4f9d Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 11 Jun 2024 15:47:26 -0400 Subject: [PATCH 9/9] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0a9c6726..99febfbdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ - All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment. +## 2024-06-11 + +### Changed + +- **Zabbix LXC** + - NEW Script + ## 2024-06-06 ### Changed