#sudo -i . <(wget -qO- http://astrader.net:3006/sem/Utils/raw/branch/main/bashbuilder/colors.sh) -- if [ -f ~/.bash_profile ]; then echo -e "${C_LGn}File bash_profile is exist${RES}" else echo -e "${C_LGn}Make necessary link to file bash_profile${RES}" ln -s ~/.profile ~/.bash_profile fi echo -e "${C_LGn}Update & Upgrade your system ...${RES}" sudo apt update sudo apt upgrade -y 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 sed -i 's/#Port 22/#Port 22\n\nAllowUsers root@92.255.251.110 root@51.77.60.29 sem\n/' /etc/ssh/sshd_config sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes\n/' /etc/ssh/sshd_config #write out current crontab crontab -l > mycron #echo new cron into cron file echo "30 5 * * * sudo fstrim -a -v >> /home/sem/fstrim.log" > mycron #install new cron file crontab mycron rm mycron . /etc/os-release wget https://repo.zabbix.com/zabbix/6.2/${ID}/pool/main/z/zabbix-release/zabbix-release_6.2-4+${ID}${VERSION_ID}_all.deb sudo dpkg -i zabbix-release_6.2-4+${ID}${VERSION_ID}_all.deb sudo apt update sudo apt upgrade -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 enable zabbix-agent sudo /etc/init.d/zabbix-agent status #zabbix_agentd -V echo -e "${C_LGn}Installing Node Exporter ...${RES}" cd $HOME && \ wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz && \ tar xvf node_exporter-1.3.1.linux-amd64.tar.gz && \ sudo rm node_exporter-1.3.1.linux-amd64.tar.gz && \ sudo mv node_exporter-1.3.1.linux-amd64 node_exporter && \ sudo chmod +x $HOME/node_exporter/node_exporter && \ sudo mv $HOME/node_exporter/node_exporter /usr/local/bin && \ sudo rm -Rvf $HOME/node_exporter/ sudo useradd --no-create-home --shell /bin/false node_exporter sudo tee /etc/systemd/system/exporterd.service > /dev/null <