Skip to content

Abhi183/sysadmin-dashboard

Repository files navigation

SysAdmin Command Center

Python Flask License WebSocket

Your infrastructure JARVIS — a configuration-driven SysAdmin monitoring dashboard with real-time health checks, voice commands, WebSocket updates, and one-click access to every tool in your stack.


What it does

  • Health monitoring — polls Grafana, Prometheus, Jamf, ManageEngine, and any HTTP endpoint; displays green/yellow/red status cards with response times
  • Command groups — open entire sets of tools with one click ("Start Day" opens Grafana + Jamf + AD + Zendesk simultaneously)
  • Voice commands — say "start the day", "show monitoring", "open Grafana", "check health", or "export status"
  • Real-time updates — Socket.io pushes status changes live; no page refresh needed
  • Activity log — structured JSON log of every health check, command execution, and voice command
  • CSV export — download current health statuses for reporting
  • Interactive setup wizardpython setup_wizard.py walks you through config in 5 minutes
  • Docker-ready — single docker compose up to deploy

Quick start

# 1. Clone
git clone https://github.com/Abhi183/sysadmin-dashboard.git
cd sysadmin-dashboard

# 2. Install dependencies
pip install -r requirements.txt

# 3. Configure (choose one)
python setup_wizard.py          # interactive wizard
# OR
cp config.example.yaml config.yaml && nano config.yaml

# 4. Run
python app.py

# 5. Open
open http://localhost:8000

Configuration reference

The entire dashboard is driven by config.yaml. No code changes needed.

dashboard:
  title: "SysAdmin Command Center"
  port: 8000
  refresh_interval: 5       # frontend poll interval (seconds)
  theme: "dark"             # "dark" | "light"
  organization: "Acme Corp"

commands:
  start-day:                # group name (appears in sidebar)
    - name: "Grafana"
      url: "https://grafana.yourorg.edu"
      category: "monitoring"    # monitoring | identity | helpdesk | endpoint-management

    - name: "Jamf Pro"
      url: "https://jamf.yourorg.edu"
      category: "endpoint-management"

  monitoring:
    - name: "Prometheus"
      url: "https://prometheus.yourorg.edu"
      category: "monitoring"

health_checks:
  - name: "Grafana"
    url: "https://grafana.yourorg.edu/api/health"
    expected_status: 200
    timeout: 5              # seconds before marking DEGRADED
    interval_seconds: 30    # how often to check

Status thresholds

Status Condition
HEALTHY HTTP 200-299, response time < 100ms
DEGRADED HTTP 300-399, OR response 100-500ms, OR timeout
DOWN HTTP 4xx/5xx, OR connection error

Environment variable substitution

health_checks:
  - name: "Internal API"
    url: "https://${INTERNAL_HOST}/health"   # resolved from env

Voice commands

Say Action
"start the day" Execute the start-day group
"show monitoring" Switch to the monitoring group
"check health" Refresh all health checks
"open Grafana" Fuzzy-match and open service
"export status" Download CSV

Click the microphone icon to activate. Falls back to a text input box if the Web Speech API is unavailable.


API reference

Method Endpoint Description
GET / Dashboard UI
GET /api/health Current health statuses + summary
GET /api/commands All configured command groups
POST /api/execute Execute a command group {command: "start-day"}
GET /api/logs Last 100 log entries
GET /api/config Sanitized config (no credentials)
POST /api/config/validate Test a URL {url: "https://..."}
GET /api/export/status Download CSV of current health statuses

WebSocket events (server → client)

Event Payload
health_update Single endpoint status change
status_summary Overall system health summary (every 5s)
command_executed Notification when a group is executed

Docker deployment

cp .env.example .env
nano .env                    # set SECRET_KEY

docker compose up -d
open http://localhost:8000

Logs are written to ./logs/sysadmin.log (mounted as a volume).


Development

make install       # install deps
make wizard        # run setup wizard
make run           # start dashboard
make dev           # start with debug/auto-reload
make test          # run pytest suite
make test-cov      # tests + coverage report
make lint          # syntax check
make docker        # build + start in Docker
make clean         # remove cache files

Project structure

sysadmin-dashboard/
├── app.py                  # Flask + Socket.io entry point
├── setup_wizard.py         # Interactive CLI setup
├── config.yaml             # Your configuration
├── config.example.yaml     # Documented reference config
├── src/
│   ├── config_parser.py    # YAML/JSON config loading + validation
│   ├── health_checker.py   # Parallel health checks (ThreadPoolExecutor)
│   ├── command_executor.py # Command group execution + logging
│   ├── logger.py           # Structured JSON logging (rotating file)
│   └── routes.py           # All Flask routes + Socket.io events
├── templates/index.html    # Single-page dashboard UI
├── static/
│   ├── css/dashboard.css   # Dark mode design system (pure CSS)
│   └── js/
│       ├── app.js          # Main app logic
│       ├── voice.js        # Web Speech API wrapper
│       ├── health.js       # Health card rendering
│       └── websocket.js    # Socket.io client + reconnection
├── tests/                  # pytest test suite
└── logs/                   # Runtime logs (gitignored)

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/my-feature
  3. Write tests first (TDD)
  4. Implement your change
  5. Ensure tests pass: make test
  6. Open a pull request

License

MIT — see LICENSE

About

Configuration-driven SysAdmin monitoring dashboard with voice commands, real-time health checks, and WebSocket updates — your infrastructure JARVIS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors