# karthikeyan131196/r-mon architecture

> Architecture diagram of the GitHub repository karthikeyan131196/r-mon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karthikeyan131196/r-mon
- Repository: https://github.com/karthikeyan131196/r-mon

## Overview

R-Mon is a self-hosted Linux and Windows server monitor. Agents collect host metrics and optional process, service, and event data, then report to the monitoring server; the server stores reports, evaluates alert rules, and serves authenticated dashboard views and settings. Alerts can be sent through email or webhooks. The README documents these product flows; source excerpts show key server, storage, alerting, and agent behavior, but do not expose every API route or internal call.

Main entry points: [`server/rmon_server/app.py`](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/app.py) (HTTP and WebSocket API), [`agent/rmon_agent.py`](https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py) (Agent collector), [`server/rmon_server/alerts.py`](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/alerts.py) (Alert engine), [`server/rmon_server/static/app.js`](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/static/app.js) (Web dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Agent collection"]
  node_agent["Agent collector<br/>[rmon_agent.py]"]
  node_metrics["Host metrics<br/>[rmon_agent.py]"]
  node_extras["Processes, services, events<br/>[rmon_agent.py]"]
  node_sender["Buffered sender<br/>[rmon_agent.py]"]
end

subgraph group_runtime["Server runtime"]
  node_api["HTTP and WebSocket API<br/>[app.py]"]
  node_configuration["Runtime configuration<br/>[config.py]"]
  node_authentication["Login and sessions<br/>[auth.py]"]
end

subgraph group_data["Storage and alerts"]
  node_database[("Monitoring database<br/>[db.py]")]
  node_alerting["Alert engine<br/>[alerts.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard["Web dashboard<br/>[app.js]"]
  node_login["Login page<br/>[login.js]"]
end

subgraph group_integrations["Tools and notifications"]
  node_networktools["Network checks<br/>[tools.py]"]
  node_notifier["Notification dispatcher<br/>[notify.py]"]
end

node_operator(("Operator"))
node_host(("Monitored host"))
node_channels(("Email and webhooks"))

node_host -->|"runs on"| node_agent
node_agent -->|"collects"| node_metrics
node_agent -->|"collects"| node_extras
node_agent -->|"submits reports"| node_sender
node_sender -->|"posts reports"| node_api
node_operator -->|"signs in"| node_login
node_login -->|"uses API"| node_api
node_operator -->|"views and configures"| node_dashboard
node_dashboard -->|"requests data"| node_api
node_api -->|"verifies sessions"| node_authentication
node_api -.->|"uses settings"| node_configuration
node_api -->|"reads and writes"| node_database
node_api -.->|"evaluates reports"| node_alerting
node_api -.->|"routes checks"| node_networktools
node_alerting -->|"stores alert state"| node_database
node_alerting -->|"queues events"| node_notifier
node_notifier -->|"sends alerts"| node_channels

click node_agent "https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py"
click node_metrics "https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py"
click node_extras "https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py"
click node_sender "https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py"
click node_api "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/app.py"
click node_configuration "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/config.py"
click node_authentication "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/auth.py"
click node_database "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/db.py"
click node_alerting "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/alerts.py"
click node_dashboard "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/static/app.js"
click node_login "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/static/login.js"
click node_networktools "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/tools.py"
click node_notifier "https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/notify.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agent,node_metrics,node_extras,node_sender toneBlue
class node_api,node_configuration,node_authentication toneAmber
class node_database,node_alerting,node_channels toneMint
class node_dashboard,node_login toneRose
class node_networktools,node_notifier,node_operator,node_host toneIndigo
```

## Components

### Agent collection

- [Agent collector](https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py): `agent/rmon_agent.py`
- [Host metrics](https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py): `agent/rmon_agent.py`
- [Processes, services, events](https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py): `agent/rmon_agent.py`
- [Buffered sender](https://github.com/karthikeyan131196/r-mon/blob/main/agent/rmon_agent.py): `agent/rmon_agent.py`

### Server runtime

- [HTTP and WebSocket API](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/app.py): `server/rmon_server/app.py`
- [Runtime configuration](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/config.py): `server/rmon_server/config.py`
- [Login and sessions](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/auth.py): `server/rmon_server/auth.py`

### Storage and alerts

- [Monitoring database](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/db.py): `server/rmon_server/db.py`
- [Alert engine](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/alerts.py): `server/rmon_server/alerts.py`

### Dashboard

- [Web dashboard](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/static/app.js): `server/rmon_server/static/app.js`
- [Login page](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/static/login.js): `server/rmon_server/static/login.js`

### Tools and notifications

- [Network checks](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/tools.py): `server/rmon_server/tools.py`
- [Notification dispatcher](https://github.com/karthikeyan131196/r-mon/blob/main/server/rmon_server/notify.py): `server/rmon_server/notify.py`

### Other components

- **Operator**
- **Monitored host**
- **Email and webhooks**

## Connections

- Monitored host → Agent collector: runs on (evidence: `README.md`)
- Agent collector → Host metrics: collects (evidence: `README.md`)
- Agent collector → Processes, services, events: collects (evidence: `README.md`)
- Agent collector → Buffered sender: submits reports (evidence: `agent/rmon_agent.py`)
- Buffered sender → HTTP and WebSocket API: posts reports (evidence: `README.md`)
- Operator → Login page: signs in (evidence: `README.md`)
- Login page → HTTP and WebSocket API: uses API (evidence: `README.md`)
- Operator → Web dashboard: views and configures (evidence: `README.md`)
- Web dashboard → HTTP and WebSocket API: requests data (evidence: `README.md`)
- HTTP and WebSocket API → Login and sessions: verifies sessions (evidence: `server/rmon_server/app.py`)
- HTTP and WebSocket API → Runtime configuration: uses settings (evidence: `server/rmon_server/app.py`)
- HTTP and WebSocket API → Monitoring database: reads and writes (evidence: `server/rmon_server/app.py`)
- HTTP and WebSocket API → Alert engine: evaluates reports (evidence: `server/rmon_server/app.py`)
- HTTP and WebSocket API → Network checks: routes checks (evidence: `server/rmon_server/app.py`)
- Alert engine → Monitoring database: stores alert state (evidence: `server/rmon_server/alerts.py`)
- Alert engine → Notification dispatcher: queues events (evidence: `README.md`)
- Notification dispatcher → Email and webhooks: sends alerts (evidence: `server/rmon_server/notify.py`)
