On this page
📖 1. What is SysMonitor?
SysMonitor is a lightweight, self-hosted power & network outage monitoring tool built specifically for COX's Bazar CLS (COXCLS), a facility operated by BSCPLC that relies on grid power (PDB) with a generator + Automatic Transfer Switch (ATS) as backup.
It runs entirely on the local network and works passively — it only observes network reachability of monitoring points already on site. It does not connect to, control, or issue commands to the generator, ATS, or any power infrastructure. Its only job is to watch, record, and alert.
The idea is simple: instead of someone on shift having to notice a power drop, write it down on paper, and remember to log when the generator kicked in, SysMonitor watches two always-on network devices and infers the facility's power state from their reachability — then keeps a permanent, timestamped record of everything that happened, without anyone needing to touch a keyboard.
Detects outages automatically
No manual logging — the system notices the moment power drops.
Tracks exact durations
PDB outage time and generator runtime, down to the second.
Permanent history
Every outage cycle and event is preserved for reporting and audits.
Instant alerts
Telegram, WhatsApp, and email notifications the moment something changes.
⚙️ 2. How it works
SysMonitor is a Django web application paired with a lightweight background monitor process. The two run as separate, independent services and communicate only through the shared database — so a restart of one never takes down the other:
🏗️ 3. Architecture
SysMonitor is deliberately split into small, independent pieces, each
run as its own systemd service so a crash
or restart in one never brings down the rest of the system:
Three independent services, one shared database — that's the whole system:
| Service | Job |
|---|---|
sysmonitor-ping | Pings the Holder & NVR devices continuously, writes confirmed state changes to the database, and fires notifications the instant something changes. |
sysmonitor-web | The Django app — serves the dashboard, report, events, admin pages, and this documentation page, reading straight from the same database. |
sysmonitor-backup | A timer that snapshots the database on a daily schedule, so a bad write or disk issue never means losing the whole history. |
🧠 4. The detection logic
A full, healthy outage cycle looks like this — grid drops, generator picks up the load, grid comes back, and the ATS quietly switches the load back to grid power:
Every completed cycle is classified so abnormal situations stand out instead of getting lost in the log:
| Cycle Type | Meaning |
|---|---|
| 🟢 Normal | Clean cycle — outage, generator ran, power restored, ATS switched back cleanly. |
| 🔵 ATS-only | Just a brief ATS switch blip — not a real power outage. |
| 🟡 Incomplete | An outage is currently in progress. |
| 🟠 Alarm | Power was restored but the generator/ATS didn't switch back as expected — flagged for review. |
| 🔴 Critical | An extended total failure — both reference points unreachable for a long stretch. |
| ⚪ Manual | Entered or corrected by hand via System Tools — for an outage the automatic monitor missed. |
Why two devices instead of one?
Relying on a single ping target is unreliable — a device rebooting, a single WiFi hiccup, or a switch port flapping can all look identical to a real power outage. By requiring both the Holder and the NVR to agree before a state change is confirmed, one-off blips are filtered out automatically, and only genuine power events reach the log and the notification channels.
A maintenance mode can be switched on before planned network work (e.g. restarting a router), which pauses outage detection and notifications so planned downtime never gets logged as a false power outage.
✨ 5. Features
Live Dashboard
Auto-refreshing status, device health, and daily outage summary.
Event & Activity Logs
Full history of state changes plus an admin audit trail of every user action.
Generator Shifting Entry
Manual log of which generator is in auto mode and when it was switched.
System Tools
Live internal state viewer, journal inspection, and manual cycle correction for admins.
Reports
Daily / historical outage & generator runtime reporting.
Role-Based Access
Admin, User, Viewer, and Guest roles, each with a different set of visible pages.
Self-Service Profiles
Users manage their own contact details; sensitive fields need admin approval.
Automated Backups
The database is backed up daily on a schedule, automatically.
Multi-Channel Alerts
Telegram, WhatsApp, and email — configured independently per recipient.
Companion Android App
Auto-detects local vs external network and loads the right address.
Maintenance Mode
Pause detection during planned network work so it's never logged as an outage.
Public Docs Page
This page — readable by anyone, logged in or not, with no secrets exposed.
🧩 6. Tech stack
Built to be simple to operate on a single on-site machine — no external cloud dependency for the core monitoring loop:
Django (Python)
Serves the dashboard, admin pages, and internal APIs.
SQLite
Single-file database, backed up automatically every day.
Python ping loop
Independent background service, decoupled from the web app.
Vanilla HTML / CSS / JS
No build step or framework — fast to load, easy to audit.
pytz — Asia/Dhaka
All timestamps are normalised to local Bangladesh time.
Telegram · WhatsApp · SMTP
Telegram Bot API, Meta WhatsApp Cloud API, Gmail SMTP.
systemd services & timers
Web app, ping monitor, and backups each run as their own unit.
Native Android wrapper (Java)
WebView-based app with network auto-detection and retry logic.
📢 7. Notifications
SysMonitor can alert designated recipients the moment a power event happens, over multiple channels:
| Channel | Use case |
|---|---|
| 🤖 Telegram Bot | Instant push alerts to any number of subscribed chats. |
| Business API-based alerts to configured phone numbers. | |
| SMTP-based alerts for recipients who prefer email. |
What triggers an alert
- Outage start — sent once, the moment the Holder device goes down.
- Critical — sent once if both reference devices are unreachable for an extended period.
- Alarm — sent once per cycle if the generator or ATS doesn't behave as expected.
- Cycle complete — sent once the cycle closes cleanly (power restored, ATS switched back).
Each of these fires at most once per cycle — the dispatcher keeps track of what's already been sent, so recipients never get spammed with duplicate alerts for the same event.
@SysMonitorCOXCLS_bot.
Access to the dashboard itself, and the exact notification recipient list,
is managed privately by the COXCLS NOC team.
📱 8. Android App
A lightweight Android wrapper app is available for quick access to the SysMonitor dashboard from a phone — it automatically detects whether you're on the facility's local network or an external connection and loads the right address for you.
SysMonitor Android App Preview — mobile dashboard interface showing system status, device cards, and monitoring information.
⚡ SysMonitor for Android
Auto network detection · swipe-to-refresh · connection retry · in-app log viewer
🔐 9. Roles & Access Control
Access to the dashboard is account-based. Every account is assigned a role that determines exactly which pages appear in its navigation:
| Role | Can see |
|---|---|
| Admin | Everything — Dashboard, Report, Events, Generator Shifting Entry, plus Devices, Users, Notifications, Activity Log, and System Tools, including review/approval of pending profile changes. |
| User | Dashboard, Report, Events, and Generator Shifting Entry. |
| Viewer | Dashboard, Report, and Events (no Generator Shifting Entry). |
| Guest | Dashboard and Report only. |
When a user updates a sensitive field on their own profile (like their email or mobile number), the change is held as pending until an admin reviews and approves or rejects it — this page and its approval controls live right inside the admin's Users tab, so nothing changes silently.
This About & Docs page itself is the one exception to account-based access — it's intentionally public so anyone can understand what SysMonitor does before ever needing an account.
❓ 10. FAQ
Does SysMonitor control the generator or ATS?
What's the difference between Viewer and Guest?
How are false alarms like a brief WiFi drop filtered out?
What happens if I'm doing planned network maintenance?
Is my activity on the dashboard tracked?
How often is the database backed up?
How do I get an account?
Can I use the dashboard without installing the Android app?
👤 11. About Us
SysMonitor is built and maintained in-house for the COXCLS NOC team at BSCPLC, to reduce manual outage tracking and give the team real-time visibility into facility power health.
MD. Jikrul Sayeed Hossain
Designed, built, and maintains SysMonitor end-to-end — the Django backend, the outage-detection logic, the notification system, and the companion Android app.
Questions, feedback, or issues with SysMonitor?
jikrul.sayeed@gmail.com