WhatsApp Watchdog is a Node.js application to monitor Python scripts/services on Windows and send alerts via WhatsApp if the script/service is down. It regularly checks if a specified service (like a Python script) is running on the system and sends an alert through WhatsApp if the service is down.
This project was born out of a personal need to monitor update_sheets.py
, a Python script on my Windows machine that neede to be running 24/7. Therefore, I created this project to monitor the script and send me a WhatsApp alert (because it's more convenient for me) if the script is down.
-
Clone the repository:
git clone https://github.com/MeshalAlamr/whatsapp-watchdog.git cd whatsapp-watchdog
-
Install dependencies:
npm ci
-
Set up alert recipient:
- Copy
.env.example
and rename it to.env
. - Update the
.env
file with the WhatsApp chat ID you want to send alerts to. (e.g.,966123456789@c.us
)
- Copy
-
Configure monitoring settings:
- Modify
config.js
to set the monitoring schedule and specific Python script/service to monitor. - The default configuration is set to check
main.py
every hour.
- Modify
-
Start the application:
npm start
-
Link WhatsApp:
- Scan the QR code in the terminal using WhatsApp on your phone (WhatsApp -> Linked Devices).
- Once you see "WhatsApp Watchdog is ready!", the monitoring starts.
Contributions to WhatsApp Watchdog are greatly appreciated. If you have suggestions for improvements or want to contribute to the project, please feel free to do so. Expanding the project to support other operating systems is a good place to start.
This project is licensed under the MIT License - see the LICENSE file for details.
This application is not affiliated with or endorsed by WhatsApp.