Lightweight server monitoring with Slack & Email alerts!
OSM is a simple, lightweight monitoring tool that tracks CPU, RAM, and DISK usage on Linux Docker hosts.
It logs everything, sends alerts when usage spikes, and runs in a tiny Docker container.
πΎ No need for Prometheus, Grafana, or heavy setups β just plug and play!
π‘ Built for developers & sysadmins who want fast, easy monitoring.
π Made with β€οΈ in Senegal πΈπ³
β
Monitor your Linux host (not just the container)
β
Set usage thresholds for CPU, RAM, and DISK
β
Get real-time alerts on Slack & Email
β
Automatic log rotation & SQLite storage
β
Simple Docker Compose setup
β
Daily cleanup of old logs (>30 days)
β
Zero dependencies β just Docker!
By default, Orbit Simple Monitor (OSM) stores its database (osm.db) and logs inside the container at /data. To ensure data persistence, you should mount a directory from your host system.
Since the container runs as a non-root user (osm) with UID 100 and GID 101), the host directory must be pre-created and owned by UID 100 & GID 101 to avoid permission issues.
Run this command before starting the container to create a persistent storage folder:
mkdir -p ./osm_data
sudo chown -R 100:101 ./osm_data
sudo chmod -R 775 ./osm_dataThis ensures that the OSM container can write logs and store the database without permission errors.
Modify the volumes section to bind-mount the directory:
volumes:
- ./osm_data:/dataβοΈ Avoids permission errors when writing logs & database.
βοΈ Ensures data persistence across container restarts.
βοΈ Keeps the container running as a non-root user for security.
π¨ OSM requires
/procto monitor the host system.
It will NOT work on Windows.
The easiest way to start OSM:
version: '3.8'
services:
osm:
image: orbitturner/orbit-simple-monitor:latest
container_name: osm-monitor
environment:
YOUR_SERVER_NAME: "Sama Server"
DB_FILE: "/data/osm.db"
CPU_THRESHOLD: 80
RAM_THRESHOLD: 80
DISK_THRESHOLD: 80
CHECK_INTERVAL: 1
CHECK_INTERVAL_UNIT: "m"
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/XXX/YYY/ZZZ"
ALERT_EMAIL: "alerts@example.com" # Multiple: "user1@example,user2@example"
SMTP_SERVER: "smtp.example.com"
SMTP_PORT: 587
SMTP_USER: "user@example.com"
SMTP_PASS: "secret"
ALERT_CHANNELS: "SLACK,EMAIL"
volumes:
- ./osm_data:/data # optional: for logs & database persistence
- /proc:/host_proc:ro # Required for host-level monitoring
restart: unless-stoppedThen:
docker-compose up -d
docker-compose logs -fWant a quick one-liner? Run OSM like this:
docker run --rm -it \
-e YOUR_SERVER_NAME="Sama Server" \
-e DB_FILE="/data/osm.db" \
-e CPU_THRESHOLD=80 \
-e RAM_THRESHOLD=80 \
-e DISK_THRESHOLD=80 \
-e CHECK_INTERVAL=1 \
-e CHECK_INTERVAL_UNIT="m" \
-e SLACK_WEBHOOK_URL="https://hooks.slack.com/services/XXX/YYY/ZZZ" \
-e ALERT_EMAIL="alerts@example.com" \
-e SMTP_SERVER="smtp.example.com" \
-e SMTP_PORT=587 \
-e SMTP_USER="user@example.com" \
-e SMTP_PASS="secret" \
-e ALERT_CHANNELS="SLACK,EMAIL" \
--mount type=bind,source="$(pwd)/osm_data",target=/data \
--mount type=bind,source=/proc,target=/host_proc,readonly \
orbitturner/orbit-simple-monitor:latestπ Mounts:
/procβ Required for reading system metrics./dataβ Stores logs & the SQLite database.
| Variable | Default | Description |
|---|---|---|
YOUR_SERVER_NAME |
Sama Server |
Server name in alerts. |
DB_FILE |
/data/osm.db |
Path to database file. |
CPU_THRESHOLD |
90 |
Alert threshold for CPU usage (%) |
RAM_THRESHOLD |
90 |
Alert threshold for RAM (%) |
DISK_THRESHOLD |
90 |
Alert threshold for Disk (%) |
CHECK_INTERVAL |
1 |
Interval for checks (numeric) |
CHECK_INTERVAL_UNIT |
m |
Interval unit: s(sec), m(min), h(hour) |
SLACK_WEBHOOK_URL |
(empty) | Slack webhook URL for alerts. |
ALERT_EMAIL |
alerts@example.com |
Email or Emails (Comma separated list) for alerts. |
SMTP_SERVER |
smtp.example.com |
SMTP server. |
SMTP_PORT |
587 |
SMTP port (465 for SSL, 587 for TLS). |
SMTP_USER |
user@example.com |
SMTP username. |
SMTP_PASS |
secret |
SMTP password. |
ALERT_CHANNELS |
SLACK,EMAIL |
SLACK, EMAIL, or both. |
git clone https://github.com/orbitturner/orbit-simple-monitor.git
cd orbit-simple-monitor
python3 -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
python osm.pypip install pytest
pytestdocker build -t osm-monitor .
docker tag osm-monitor orbitturner/orbit-simple-monitor:latest
docker push orbitturner/orbit-simple-monitor:latest| OS | Supported? | Notes |
|---|---|---|
| Linux π’ | β Yes | Fully supported. Mount /proc for host monitoring. |
| Windows π΄ | β No | Not supported (/proc missing). |
| macOS π‘ | No host-level metrics (Docker limits access). |
If you're security-conscious and want to lock down OSM as much as possible, follow these additional hardening steps.
By default, Docker seccomp restricts syscalls. You can explicitly enforce a custom security profile:
security_opt:
- seccomp=your-seccomp-profile.json
- apparmor=your-apparmor-profileRecommended: Use the default seccomp profile unless you need extra restrictions.
Minimize privileges by dropping unneeded Linux capabilities:
cap_drop:
- ALL
cap_add:
- CHOWN # Allow changing file ownership if needed for logging
- SETUID # Allow user switching if absolutely required
- SETGIDIf you donβt need user switching, remove SETUID and SETGID.
For extra security, make the entire container read-only except the necessary data directory:
read_only: true
tmpfs:
- /tmp # Allow temporary files to exist
volumes:
- ./osm_data:/dataThis prevents unexpected writes to the container filesystem.
If you donβt need OSM to send alerts externally, disable networking:
network_mode: noneOtherwise, allow only outbound connections for SMTP/Slack alerts.
Ensure OSM cannot gain root privileges even if compromised:
privileged: false
user: "osm"This blocks dangerous privilege escalations.
- Monitor container logs (via external logging tools).
- Use Falco or Auditd to detect suspicious activity inside the container.
- Implement fail2ban rules for SMTP brute-force attacks (if public).
For maximum containment, run OSM inside Firejail:
firejail --noprofile --net=none docker run --rm --read-only orbitturner/orbit-simple-monitorThis isolates OSM even further from the host system.
These steps provide extra layers of security beyond what is necessary for most users. If OSM runs in a trusted internal network, these might be overkillβbut for public-facing environments, better safe than sorry! π
π‘ Found a bug? Need a feature? Open an issue!
π§ Pull requests welcome! Follow our contributing guide.
π Try it out & let us know!
Your server deserves simple, efficient monitoring without the bloat! π₯
- π Docker Hub: orbitturner/orbit-simple-monitor
- π GitHub: orbitturner/osm
Made with β€οΈ in Senegal. πΈπ³
