Botswana School of Business Sciences — ICT Department Real-time health monitoring for computer labs and projectors.
bac-lab-monitor/
├── agent/
│ ├── BACLabAgent.ps1 # Runs on each lab PC (PowerShell)
│ └── InstallAgent.ps1 # Deploys the agent as a Windows service
├── backend/
│ ├── server.py # Flask API + SQLite database
│ ├── projector_poller.py # Polls projectors via PJLink protocol
│ └── requirements.txt
└── dashboard/
└── index.html # Live monitoring dashboard (served by Flask)
# Install Python dependencies
pip install flask flask-cors requests
# Start the monitoring server
cd backend
python server.py
# Server runs at http://0.0.0.0:5000# Edit BACLabAgent.ps1: set SERVER_URL to your server's IP
# Then on each PC, open PowerShell as Administrator:
cd \\server\ICTShare\BACAgent # or copy files locally
.\InstallAgent.ps1 -LabName "Lab1" -ServerUrl "http://192.168.1.100:5000"
# Change -LabName for each lab: "Lab18", "Lab19", "Lab20", "Lab21"# Edit projector_poller.py: set IPs for each projector
python projector_poller.pyNavigate to http://192.168.1.100:5000 from any browser on the network.
| Metric | Warning | Critical |
|---|---|---|
| CPU | > 70% | > 90% |
| RAM | > 75% | > 90% |
| Disk | > 80% | > 95% |
| Offline | > 2 min | — |
Projectors are polled using the PJLink protocol (industry standard, TCP port 4352).
- Supported brands: Epson, BenQ, Sony, NEC, Hitachi, Panasonic
- Queries: power state, lamp hours, input signal, error codes
- Fallback: ICMP ping if PJLink is unavailable
To enable PJLink on your projectors: see the projector's network settings menu and enable "PJLink" (no password for simplicity on a private LAN, or set a password and update projector_poller.py).
Edit PROJECTORS dict in both server.py and projector_poller.py.
Run InstallAgent.ps1 on each PC with the correct -LabName.
The SQLite database (bac_monitor.db) can be queried directly by Power BI Desktop:
- Data Source: ODBC → SQLite ODBC Driver
- Tables:
device_reports,projector_reports,alerts - Refresh on a schedule to build utilization reports for management.
Set your API key as an environment variable before starting the server:
set ANTHROPIC_API_KEY=sk-ant-... # Windows
export ANTHROPIC_API_KEY=sk-ant-... # Linux
python server.pyInstall wfastcgi and configure IIS to serve the Flask app, or use a reverse proxy (nginx/Caddy) in front of python server.py.
Jason Lungisani Seretse — BAC ICT Department Work Placement, 2025/2026 Student ID: Bida23-141 | Mentor: Tshepho Kgopana