.-----.-----.----.--.--.|__|.----.-----.----.---.-.--| |.---.-.----.
|__ --| -__| _| | || || __| -__| _| _ | _ || _ | _|
|_____|_____|__| \___/ |__||____|_____|__| |___._|_____||___._|__|
ServiceRadar is a distributed network monitoring system designed for monitoring infrastructure and services in hard to reach places or constrained environments. It provides real-time monitoring of internal services, with cloud-based alerting capabilities to ensure you stay informed even during network or power outages.
https://docs.dusk.network/operator/overview/
ServiceRadar uses a distributed architecture with three main components:
graph TD
subgraph "Monitored Host"
A[Agent] --> P1[Process Checker]
A --> P2[Port Checker]
A --> P3[Dusk Checker]
end
subgraph "Local Network"
P[Poller] --> A
P --> A2[Agent 2]
P --> HTTP[HTTP Checks]
subgraph "Agent 2 Host"
A2 --> R[Redis Status]
A2 --> M[MySQL Status]
end
subgraph "Direct Checks"
HTTP --> WebApp[Web Application]
HTTP --> API[API Endpoint]
end
end
subgraph "Cloud/Internet"
P --> CS[Cloud Service]
CS --> WH[Webhook Alerts]
WH --> Discord[Discord]
WH --> Custom[Custom Webhooks]
end
style P fill:#f9f,stroke:#333
style CS fill:#bbf,stroke:#333
style WH fill:#fbf,stroke:#333
- Agent (runs on monitored hosts)
- Provides service status through gRPC
- Supports multiple checker types:
- Process checker (systemd services)
- Port checker (TCP ports)
- Custom checkers (e.g., Dusk node)
- Must run on each host you want to monitor
- Poller (runs anywhere in your network)
- Coordinates monitoring activities
- Can run on the same host as an agent or separately
- Polls agents at configurable intervals
- Reports status to cloud service
- Multiple pollers can report to the same cloud service
- Cloud Service (runs on a reliable host)
- Receives reports from pollers
- Provides web dashboard
- Sends alerts via webhooks (Discord, etc.)
- Should run on a reliable host outside your network
ServiceRadar components are distributed as Debian packages. Each component has its own package:
- Clone the repository:
git clone https://github.com/mfreeman451/serviceradar.git
cd serviceradar
- Build the agent package:
./setup-deb-agent.sh
- Build the poller package:
./setup-deb-poller.sh
- Build the cloud package:
./setup-deb-cloud.sh
- Agent Installation (on monitored hosts):
sudo dpkg -i serviceradar-dusk_1.0.0.deb # For Dusk nodes
# or
sudo dpkg -i serviceradar-agent_1.0.0.deb # For other hosts
- Poller Installation (on any host in your network):
sudo dpkg -i serviceradar-poller_1.0.0.deb
- Cloud Installation (on a reliable host):
sudo dpkg -i serviceradar-cloud_1.0.0.deb
Default location: /etc/serviceradar/checkers/
For Dusk nodes:
# /etc/serviceradar/checkers/dusk.json
{
"name": "dusk",
"node_address": "localhost:8080",
"timeout": "5m",
"listen_addr": ":50052"
}
# /etc/serviceradar/checkers/external.json
{
"name": "dusk",
"address": "localhost:50052"
}
Default location: /etc/serviceradar/poller.json
{
"agents": {
"local-agent": {
"address": "127.0.0.1:50051",
"checks": [
{
"type": "dusk"
}
]
}
},
"cloud_address": "cloud-host:50052",
"poll_interval": "30s",
"poller_id": "home-poller-1"
}
Default location: /etc/serviceradar/cloud.json
{
"listen_addr": ":8090",
"alert_threshold": "5m",
"known_pollers": ["home-poller-1"],
"webhooks": [
{
"enabled": true,
"url": "https://discord.com/api/webhooks/your-webhook-url",
"cooldown": "15m",
"template": "{\"embeds\":[{\"title\":\"{{.alert.Title}}\",\"description\":\"{{.alert.Message}}\",\"color\":{{if eq .alert.Level \"error\"}}15158332{{else if eq .alert.Level \"warning\"}}16776960{{else}}3447003{{end}},\"timestamp\":\"{{.alert.Timestamp}}\",\"fields\":[{\"name\":\"Node ID\",\"value\":\"{{.alert.NodeID}}\",\"inline\":true}{{range $key, $value := .alert.Details}},{\"name\":\"{{$key}}\",\"value\":\"{{$value}}\",\"inline\":true}{{end}}]}]}"
}
]
}
- Agent Deployment:
- Must run on each host you want to monitor
- For Dusk nodes, use the serviceradar-dusk package
- For other hosts, use the serviceradar-agent package
- Requires port 50051 to be accessible to the poller
- Poller Deployment:
- Can run on the same host as an agent or separately
- Must be able to reach all agents
- Must be able to reach the cloud service
- Multiple pollers can report to the same cloud service
- Each poller needs a unique poller_id
- Cloud Service Deployment:
- Should run on a reliable host outside your network
- Needs to be accessible by all pollers
- Provides web interface on port 8090
- Should have reliable internet for webhook alerts
If you're using UFW (Ubuntu's Uncomplicated Firewall), here are the required rules:
# On agent hosts
sudo ufw allow 50051/tcp # For agent gRPC server
sudo ufw allow 50052/tcp # For Dusk checker (if applicable)
# On cloud host
sudo ufw allow 50052/tcp # For poller connections
sudo ufw allow 8090/tcp # For web interface
The web interface is available at http://cloud-host:8090
and provides:
- Overall system status
- Individual node status
- Service status for each node
- Historical availability data
- Dusk node specific information
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.