π Smart WakeOnLan Script: Monitor UPS, automatic wake servers with WOL after power outage, and get Telegram alerts. Simple setup, customizable, and reliable. Keep your servers running seamlessly! πβ‘
- UPS Monitoring: Check UPS status and detect power loss.
- Server Wake-up: Use Wake-on-LAN to power up servers automatically only if UPS is in On-Line Mode. When on Battery it only send an alert without trying to start-up the servers.
- Telegram Notifications: Get real-time alerts for power events and server status.
- Power outages
- Server Wake ups
- Offline Server
- Customizable: Easily configure for different server setups.
- Bash Shell
- Wake-on-LAN (WOL) tool
- ping command
- NUT (Network UPS Tools) server (e.g., on a Synology NAS)
- Telegram Bot for notifications
-
UPS Configuration:
- Set the
UPS_IPvariable with your UPS's IP. - Set up Network UPS Tools (NUT) on your NAS or Server and connect the UPS.
- Set the
-
Server Configuration:
- Update
HOSTS,NICKNAMES, andMACADDRSarrays with your server details. - Ensure Wake-on-LAN (WOL) is enabled on your servers.
- Update
-
Telegram Bot Configuration:
- Create a Telegram bot using the BotFather on Telegram.
- Replace [Your Token] and [Your Chat ID] with your actual API token and chat ID.
-
Dependency Installation:
- Install the wakeonlan tool (e.g.,
sudo apt-get install wakeonlan). - Install the nut-client tool (e.g.,
sudo apt-get install nut-client). - Ensure the ping command is available.
- Install the wakeonlan tool (e.g.,
-
Execution:
- Make the script executable:
chmod +x power-on-server.sh - Run the script periodically (e.g., every 5 minutes) using a cron job or manually:
./SmartWOL.sh
- Make the script executable:
- Schedule the script to run periodically.
- Receive Telegram notifications for UPS and server status.
- Customize the script based on your server setup.
MrColo
This project is licensed under the MIT License.