A simple Telegram powered (using Telegraf) bot that logs the status of a VPS (or any other server) and sends it to you via Telegram.
The bot is capable of logging the following:
- 🔌 SSH connections
- ⛔ Failed SSH connections
- 📌 Attemps information (location, users, etc)
- Clone the repository
git clone git@github.com:llapenna/vps-logger-bot.git- Install dependencies
npm ci- Create a
.env, using the.env.templatefile as a base:
# Used by the application to work properly
BOT_TOKEN=YOUR_TELEGRAM_BOT_TOKEN
LOGFILE_PATH="/var/log/auth.log"
# Used by the installation scripts to install the service
SERVICE_PATH="/etc/systemd/system"
PROJECT_PATH="path/to/project/root"💡 You can get a Telegram bot token by talking to @BotFather
- Install the bot's service
npm run install-service💡 Super user privileges may be required to install the service. Try running the script using
sudo
After executing the install script, the service will be automatically started. You can check its status by running:
systemctl status vps-logger-botAnd read its logs by running:
journalctl -u vps-logger-bot