Skip to content

llapenna/vps-logger-bot

Repository files navigation

VPS Logger Bot 🤖

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)

Installation

  1. Clone the repository
git clone git@github.com:llapenna/vps-logger-bot.git
  1. Install dependencies
npm ci
  1. Create a .env, using the .env.template file 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

  1. 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-bot

And read its logs by running:

journalctl -u vps-logger-bot

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors