This commit is contained in:
2022-09-23 01:36:43 +03:00
parent a506b16161
commit 3dfb794349
+17 -1
View File
@@ -1,3 +1,5 @@
sudo -i
. <(wget -qO- http://astrader.net:3006/sem/Utils/raw/branch/main/bashbuilder/colors.sh) -- . <(wget -qO- http://astrader.net:3006/sem/Utils/raw/branch/main/bashbuilder/colors.sh) --
if [ -f ~/.bash_profile ]; if [ -f ~/.bash_profile ];
@@ -14,18 +16,32 @@ sudo apt upgrade -y
echo -e "${C_LGn}Installation of necessary components ...${RES}" echo -e "${C_LGn}Installation of necessary components ...${RES}"
sudo apt install openssh-server mc htop qemu-guest-agent curl lsb-release wget -y sudo apt install openssh-server mc htop qemu-guest-agent curl lsb-release wget -y
sudo sed -i 's/#Port 22/Port 22321\n\nAllowUsers root@92.255.251.110 sem\n/' /etc/ssh/sshd_config
#write out current crontab
crontab -l > mycron
#echo new cron into cron file
echo "30 5 * * 6 sudo fstrim -a -v >> /home/sem/fstrim.log" >> mycron
#install new cron file
crontab mycron
rm mycron
. /etc/*-release . /etc/*-release
wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-1+${DISTRIB_ID,,}${DISTRIB_RELEASE}_all.deb wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-1+${DISTRIB_ID,,}${DISTRIB_RELEASE}_all.deb
sudo dpkg -i zabbix-release_6.2-1+${DISTRIB_ID,,}${DISTRIB_RELEASE}_all.deb sudo dpkg -i zabbix-release_6.2-1+${DISTRIB_ID,,}${DISTRIB_RELEASE}_all.deb
sudo apt update
sudo apt upgrade -y sudo apt upgrade -y
sudo apt install zabbix-agent -y sudo apt install zabbix-agent -y
sudo sed -i 's/Server=127.0.0.1/Server=zabbix.astrader.net/' /etc/zabbix/zabbix_agentd.conf
sudo sed -i 's/ServerActive=127.0.0.1/ServerActive==zabbix.astrader.net/' /etc/zabbix/zabbix_agentd.conf
#sudo sed -i 's/# UserParameter=/UserParameter=systemd.unit.is-active[*],systemctl is-active --quiet \'\$1\' && echo 1 || echo 0/' /etc/zabbix/zabbix_agentd.conf
sudo systemctl restart zabbix-agent sudo systemctl restart zabbix-agent
sudo systemctl enable zabbix-agent sudo systemctl enable zabbix-agent
sudo /etc/init.d/zabbix-agent status sudo /etc/init.d/zabbix-agent status
#zabbix_agentd -V #zabbix_agentd -V
echo -e "${C_LGn}Installing Node Exporter ...${RES}" echo -e "${C_LGn}Installing Node Exporter ...${RES}"
cd $HOME && \ cd $HOME && \
wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz && \ wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz && \