Sentinel is a lightweight, multi-protocol service monitoring system written in Go. It monitors HTTP/HTTPS, TCP and gRPC services, providing real-time status updates and incident management with multi-provider notifications.
- Multi-Protocol Support: HTTP/HTTPS, TCP, gRPC
- Real-time Monitoring: Configurable check intervals and timeouts
- Incident Management: Automatic incident creation and resolution
- Multi-Provider Notifications: Alert and recovery notifications via multiple providers (Telegram, Discord, Slack, Email, Webhooks, etc.)
- Web Dashboard: Clean, responsive web interface with JSON configuration
- REST API: Full API for integration with other tools
- WebSocket Support: Real-time updates via WebSocket connections
- Persistent Storage: Incident history using SQLite with improved concurrency handling
- Configuration: YAML-based configuration with environment variable support
- Clean Logging: Minimal logging focused on check results and notifications
Install Sentinel automatically on Linux systems with systemd:
# Install with default settings
curl -L https://raw.githubusercontent.com/sxwebdev/sentinel/master/scripts/install.sh | sudo bash
# Install with custom options
curl -L https://raw.githubusercontent.com/sxwebdev/sentinel/master/scripts/install.sh | sudo bash -s -- \
--install-dir /opt/sentinel/bin \
--config-dir /etc/sentinel \
--data-dir /var/lib/sentinel \
--service-name sentinel-monitor \
--user sentinel
# Install specific version
curl -L https://raw.githubusercontent.com/sxwebdev/sentinel/master/scripts/install.sh | sudo bash -s -- \
--version v1.0.0
Installation Features:
- Automatic binary download for your platform (Linux amd64/arm64)
- System user creation
- Systemd service configuration with security hardening
- Configuration file creation with sensible defaults
- Automatic service startup and enablement
Post-Installation:
- Dashboard: http://localhost:8080
- Configuration:
/etc/sentinel/config.yaml
- Service:
systemctl status sentinel
- Logs:
journalctl -u sentinel -f
- Clone the repository:
git clone https://github.com/sxwebdev/sentinel
cd sentinel
- Create configuration file:
cp config.template.yaml config.yaml
# Edit config.yaml with your notification provider credentials
- Start the services:
docker-compose up -d
- Access the dashboard at http://localhost:8080
- Install Go 1.24 or later
- Clone and build:
git clone https://github.com/sxwebdev/sentinel
cd sentinel
go mod download
go build -o sentinel ./cmd/sentinel
- Configure your services in
config.yaml
- Set up notification providers (see Notification Setup section below)
- Run:
./sentinel
Create a config.yaml
file:
server:
port: 8080
host: "0.0.0.0"
auth:
enabled: false # Set to true to enable basic authentication
users:
- username: "admin"
password: "changeme"
monitoring:
global:
default_interval: 60s
default_timeout: 10s
default_retries: 5
database:
path: "./data/db.sqlite"
notifications:
enabled: true
urls:
# Telegram
- "telegram://token@telegram?chats=@channel-1[,chat-id-1,...]&preview=false"
# Discord (optional)
- "discord://token@id"
# Slack (optional)
- "slack://[botname@]token-a/token-b/token-c"
# Email (optional)
- "smtp://username:password@host:port/?from=fromAddress&to=recipient1[,recipient2,...]"
Note: Services are now managed through the web interface or API, not through static configuration in config.yaml
.
Sentinel supports HTTP Basic Authentication to protect your monitoring dashboard and API endpoints.
Set auth.enabled: true
in your config.yaml
and configure users:
server:
auth:
enabled: true
users:
- username: "admin"
password: "secure_password_123"
- HTTP Basic Auth: Industry-standard authentication method
- WebSocket Bypass: WebSocket connections bypass auth for real-time updates
- API Protection: All REST API endpoints require authentication when enabled
- Swagger Integration: API documentation includes authentication requirements
- Use strong, unique passwords for each user
- Consider using environment variables for passwords in production
- Enable authentication in production environments
- Regularly rotate passwords
- Use HTTPS in production (configure reverse proxy)
- Service Management: Add, edit, and delete services through the web interface
- JSON Configuration: Configure services using JSON format directly in the UI
- Real-time Status: Live status updates with WebSocket connections
- Manual Checks: Trigger manual health checks for any service
- Incident Management: View and resolve incidents
- Service Details: Detailed view with incident history and statistics
The HTTP monitor provides advanced capabilities for complex monitoring scenarios:
- Multi-Endpoint Monitoring: Monitor multiple endpoints within a single service and compare their responses
- JSON Path Extraction: Extract specific values from JSON responses using JSONPath syntax
- JavaScript Conditions: Set custom alert conditions using JavaScript to analyze responses from multiple endpoints
- Basic Authentication: Support for HTTP Basic Auth on per-endpoint basis
- Custom Headers: Configure custom HTTP headers for each endpoint
- Simple Connectivity: Basic TCP port connectivity checks
- Send/Expect Protocol: Send specific data and validate expected responses
- Custom Protocol Support: Monitor any TCP-based protocol (Redis, MySQL, custom protocols)
The gRPC monitor supports three types of checks:
- Health Check (
check_type: "health"
): Uses standard gRPC health service (grpc.health.v1.Health
) - Reflection Check (
check_type: "reflection"
): Checks gRPC reflection availability - Connectivity Check (
check_type: "connectivity"
): Simple connection test
Available check types:
health
- Standard gRPC health service checkreflection
- gRPC reflection service checkconnectivity
- Basic connectivity test
Sentinel uses Shoutrrr for notifications, which supports multiple providers
You can configure multiple notification providers simultaneously. If one provider fails, notifications will still be sent to the others:
notifications:
enabled: true
urls:
# Telegram
- "telegram://token@telegram?chats=@channel-1[,chat-id-1,...]&preview=false"
# Discord
- "discord://token@id"
# Slack
- "slack://[botname@]token-a/token-b/token-c"
# Email
- "smtp://username:password@host:port/?from=fromAddress&to=recipient1[,recipient2,...]"
Sentinel includes an upgrade script that automatically downloads and installs the latest release with zero-downtime deployment:
# Download and run the upgrade script
curl -L -o ./upgrade.sh https://raw.githubusercontent.com/sxwebdev/sentinel/master/scripts/upgrade.sh
chmod +x ./upgrade.sh
sudo ./upgrade.sh sentinel /usr/local/bin/sentinel
# Or if you have the repository cloned
sudo ./scripts/upgrade.sh sentinel /usr/local/bin/sentinel
- π Automatic Download: Fetches the latest release for your platform (Linux/macOS, amd64/arm64)
- π‘οΈ Safe Deployment: Creates backup and rollback on failure
- π§ Service Management: Handles systemd service stop/start automatically
- β Verification: Tests new binary before deployment
- π Status Check: Shows service status after upgrade
# For custom installation paths
sudo ./scripts/upgrade.sh sentinel-monitoring /opt/sentinel/bin/sentinel
- Download the latest release for your platform from GitHub Releases
- Stop the service:
sudo systemctl stop sentinel
- Replace the binary:
sudo cp sentinel /usr/local/bin/sentinel
- Start the service:
sudo systemctl start sentinel
- Check status:
systemctl status sentinel
After installation or upgrade, monitor service health:
# Check service status
systemctl status sentinel
# View recent logs
journalctl -u sentinel --since "10 minutes ago"
# Monitor in real-time
journalctl -u sentinel -f
# Check web interface
curl -f http://localhost:8080/health || echo "Service not responding"
Sentinel provides a comprehensive REST API and WebSocket support for programmatic access to all monitoring features.
Interactive API Documentation: http://localhost:8080/api/v1/swagger/index.html
The Swagger UI provides:
- Complete endpoint documentation with examples
- Request/response schemas
- Authentication setup
- Interactive testing interface
- WebSocket API documentation
- Health Checks: Each service is checked at configured intervals
- Retry Logic: Failed checks are retried with exponential backoff
- State Changes: Status changes trigger incident creation/resolution
- Notifications: Alerts sent only on status changes (UP β DOWN)
- Real-time Updates: WebSocket broadcasts for instant UI updates
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
Create /etc/systemd/system/sentinel.service
:
[Unit]
Description=Sentinel Service Monitor
After=network.target
[Service]
User=sentinel
WorkingDirectory=/opt/sentinel
ExecStart=/opt/sentinel/sentinel
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable sentinel
sudo systemctl start sentinel
# Build image
docker build -t sentinel .
# Or pull
docker pull sxwebdev/sentinel:latest
# Run container
docker run -d \
--name sentinel \
-p 8080:8080 \
-v ./data:/root/data \
-v config.yaml:/root/config.yaml
sentinel
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.
- GitHub Issues: https://github.com/sxwebdev/sentinel/issues
- Documentation: https://github.com/sxwebdev/sentinel/wiki