Skip to content

laikait/watchlaika

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Watch Laika

Watch Laika is a lightweight Linux shell application designed to continuously monitor critical system services and automatically recover them when failures occur. When a monitored service goes down, Watch Laika attempts to bring it back online and immediately notifies administrators via email or messaging channels.

Built for reliability, simplicity, and minimal overhead, Watch Laika is ideal for servers, VPS environments, and production systems where uptime is non-negotiable.

Features

  • Continuous monitoring of Linux services
  • Automatic service recovery on failure
  • Email notifications on service downtime and recovery
  • Messaging/alert support (configurable)
  • Minimal resource usage
  • Simple configuration and extensibility
  • Designed for cron or systemd execution

How It Works

  1. Watch Laika periodically checks the status of configured services.
  2. If a service is detected as stopped or failed:
  • The service is restarted automatically
  • A notification is sent with relevant details.
  1. If recovery succeeds or fails, the event is logged and reported.

Requirements

  • Linux (systemd-based distributions recommended)
  • Bash (v4+)
  • systemctl
  • mail / sendmail or configured email client
  • Optional: messaging API (Telegram, Slack, etc.)

Installation

git clone https://github.com/laikait/watchlaika.git
cd watchlaika
chmod +x laika

Configuration

nano laika
## Add Telegram Bot Token By Create Bot From botFather
BOT_TOKEN=""
## Add Telegram Chat ID / Group Chat ID With Bot You Created
CHAT_ID=""

Usage

./laika apache2 postfix mysql

or You can set cron:

* * * * * /path/to/laika apache2 postfix mysql >> /var/log/watchlaika.log 2>&1

Notifications

  • A service goes down
  • A service is successfully restarted
  • A restart attempt fails Notification channels can be extended by adding custom handlers in the script.

Logging

All actions and events are logged for auditing and troubleshooting. Example log output:

[2025-01-01 12:01:05] nginx is down. Attempting restart...
[2025-01-01 12:01:07] nginx restarted successfully.

About

Service Monitoring & Re-Initiate Service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages