BASH monitoring server and alert in Telegram
Install
- Create folder:
mkdir /usr/local/tamagent- Create file tamagent.sh:
nano /usr/local/tamagent/tamagent.sh-
Write the data from the repository to the file.
-
Fill in the following variables with your data:
#VARIABLES
ID_USER="XXXXXXX" # ID USER in TELEGRAM
TOKEN_BOT="XXXXXXX:XXXXXXXXXXXXXXXXXXXX" # TOKEN BOT in TELEGRAM
#LIST SERVICES []
SERVICES_LIST='
wg-crypt-wg0
openvpn
sshd
postgres
nginx
docker-proxy
fail2ban-server
node
'- Create service file:
nano /lib/systemd/system/tamagent.service-
Write the data from the repository to the file.
-
Turn on the service:
systemctl daemon-reload
systemctl enable tamagent.service
systemctl start tamagent.serviceDone!