Skip to content

Latest commit

 

History

History

service_watcher

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Service Watcher

A simple bot that watches for Systemd services status. If it detects a service is down, it will send a message.

Setup

  1. Install telethon

    pip install telethon
  2. Create a new Telegram application and get the API ID and API hash. Save them in an environment variable called TG_API_ID and TG_API_HASH respectively. To do this, go to my.telegram.org and create a new application.

  3. Create a new Telegram bot and get the bot token. You can do this by following the instructions here. Save it in an environment variable called TG_BOT_SVCWATCH.

  4. Get your Telegram user ID and save it in an environment variable called TG_USER_ID. You can do this by sending message to userinfobot.

  5. Add services to watch in services.txt. Each service should be on a new line.

  6. Run the script

    python3 main.py