-
Start chat with Telegram Bot @slurm_603_bot.
-
Get your Telegram ID.
-
Run the installer on your HPC Login Node.
bash <(curl -sSL https://raw.githubusercontent.com/wyy603/SlurmBot/refs/heads/master/src/install.sh)SlurmBot is a lightweight background daemon that monitors your Slurm job queue on an HPC cluster and sends real-time Telegram notifications whenever your jobs change state — new jobs submitted, jobs completed, or state transitions (pending → running, etc.). Even if the daemon is killed, it will be restarted when you log in to the login node (via ~/.bashrc or ~/.zshrc).
You get a message on Telegram that looks like:
SlurmBot — jobs changed for yw10199
🆕 New jobs:
• train_gpt2_large
partition: gpu
reason: Priority
✅ Completed / gone:
• eval_baseline
partition: cpu
started: 2025-06-20T14:32:00
🔄 State changed:
• preprocess_data
partition: gpu
started: 2025-06-20T15:01:00
nodes: 2
No more squeue refreshing. SlurmBot watches for you.
- Open Telegram and search for @userinfobot
- Send
/start— it replies with your numeric chat ID - Paste that ID when the installer asks for it
Running the one-liner above will:
| Step | What happens |
|---|---|
| 1. Preflight | Checks that curl, jq, and squeue are available |
| 2. Prompts | Asks for your Slurm username and Telegram chat ID (interactively) |
| 3. Fetch | Downloads the server script and config template from GitHub |
| 4. Config | Writes ~/.slurmbot/config.json with your answers, locked to 600 |
| 5. Shell hooks | Appends a startup fragment to ~/.bashrc and ~/.zshrc so the server launches on every login |
| 6. Launch | Starts slurmbot-server.sh immediately as a background daemon |
~/.slurmbot/
├── slurmbot-server.sh # The monitoring daemon (fetched from GitHub)
├── config.json # Your user + Telegram config (permissions: 600)
├── server.log # Daemon logs (grows over time)
└── last_squeue.txt # Internal state snapshot
Every new shell (bash or zsh) checks if the server is running and starts it if not. This means SlurmBot launches on login and keeps running until the login node reboots — your next login will bring it back automatically.
- HPC login node with
squeueavailable curl,jq,bash- A Telegram bot token (already baked into the config template)
The config file at ~/.slurmbot/config.json contains your Telegram bot token and chat ID. The installer sets its permissions to 600 (owner read/write only). Keep it private.
src/
├── install.sh # One-liner installer (the entry point)
├── slurmbot-server.sh # Main daemon — polls squeue, diffs, sends Telegram messages
├── config.template.json # Config template with bot token pre-filled
├── .bashrc # Shell fragment appended to ~/.bashrc
└── .zshrc # Shell fragment appended to ~/.zshrc
