A centralized SSH session monitoring system with real-time dashboard, Slack alerts, and multi-environment support.
- Real-time Dashboard - View active sessions across all environments
- Session History - Search and filter historical session data with CSV export
- Server Monitoring - Track server health and online status
- Slack Alerts - Configurable notifications for login/logout events
- Multi-Environment - Support for production, staging, dev, QA, etc.
- REST API - Full API for custom integrations and SIEM
# Clone the repository
git clone git@github.com:opsntech/infra-monitor.git
cd infra-monitor
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Start with Docker
docker-compose up -dOpen http://localhost:5000 in your browser.
Use the Ansible role in ansible/ssh-session-monitor to deploy agents to your servers:
ansible-playbook -i inventory/ ssh-session-monitor-playbook.yml --ask-vault-pass| Variable | Description | Default |
|---|---|---|
DB_PASSWORD |
PostgreSQL password | (required) |
SECRET_KEY |
Flask secret key | (required) |
API_KEY |
API key for agent authentication | (required) |
SLACK_WEBHOOK |
Global Slack webhook URL | (optional) |
| Variable | Description |
|---|---|
ssh_alert_central_mode |
Enable central server mode |
ssh_alert_central_url |
Central server URL |
ssh_alert_api_key |
API key for authentication |
ssh_alert_environment |
Environment name (production, staging, etc.) |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/stats |
GET | Dashboard statistics |
/api/v1/sessions |
GET | List sessions with filtering |
/api/v1/sessions/active |
GET | Active sessions |
/api/v1/servers |
GET | List servers |
/api/v1/environments |
GET | List environments |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/settings |
GET/POST | Global alert settings |
/api/v1/environments/<id> |
PUT | Update environment settings |
/api/v1/test-webhook |
POST | Test Slack webhook |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/event |
POST | Receive session events |
/api/v1/heartbeat |
POST | Agent heartbeat |
┌─────────────────────────────────────────────────────────────────┐
│ Central Server │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
│ │ Dashboard │ │ Sessions │ │ Servers │ │ Alerts │ │
│ └───────────┘ └───────────┘ └───────────┘ └───────────┘ │
│ │ │
│ PostgreSQL │
└─────────────────────────────────────────────────────────────────┘
▲
│ HTTPS + API Key
┌─────────────────────┼─────────────────────┐
│ │ │
[Production] [Staging] [Dev]
Agents Agents Agents
MIT