# ctera/ctera-monitoring-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/ctera/ctera-monitoring-dashboard
- Repository: https://github.com/ctera/ctera-monitoring-dashboard

## Overview

CTERA Monitoring Dashboard collects health and inventory data from CTERA Portal/filers and PostgreSQL-backed servers, writes CSV datasets, and presents them through a Flask dashboard. The documented runtime is scheduled collector jobs feeding the dashboard; users configure environments and view results in the web UI. The sampled dashboard source also shows CSV loading, threshold evaluation, and environment-management endpoints. README documents the overall scheduled-collection relationship, but the job scripts and several dashboard capabilities were not sampled, so their internal wiring is not expanded.

Main entry points: [`portal_jobs.sh`](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/portal_jobs.sh) (Portal jobs), [`ctera_collect.py`](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/ctera_collect.py) (Portal and filer collector), [`ssh_collect_from_pg.py`](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/ssh_collect_from_pg.py) (Server health collector), [`dashboard/dashboard_csv.py`](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/dashboard/dashboard_csv.py) (Flask dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_portal_collect["Portal and filer collector<br/>[ctera_collect.py]"]
  node_server_collect["Server health collector"]
  node_pg_health["PostgreSQL health collector<br/>[pg_healthcheck.py]"]
  node_tenant_collect["Tenant collector"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_app["Flask dashboard<br/>[dashboard_csv.py]"]
  node_csv_data["CSV metric datasets"]
  node_thresholds["Threshold evaluation<br/>[dashboard_csv.py]"]
  node_environment_admin["Environment management<br/>[dashboard_csv.py]"]
end

subgraph group_operations["Runtime operations"]
  node_scheduler["Scheduled jobs<br/>[scheduler_jobs.sh]"]
  node_portal_jobs["Portal jobs<br/>[portal_jobs.sh]"]
  node_filer_jobs["Filer jobs<br/>[filer_jobs.sh]"]
end

subgraph group_targets["Monitored systems"]
  node_portal["CTERA Portal"]
  node_filers["Edge Filers"]
  node_maindb[("MainDB PostgreSQL")]
  node_linux_servers["Linux servers"]
end

node_user(("Dashboard user"))

node_user -->|"views dashboard"| node_dashboard_app
node_scheduler -->|"runs jobs"| node_portal_jobs
node_scheduler -->|"runs jobs"| node_filer_jobs
node_portal_jobs -.->|"schedules collection"| node_portal_collect
node_filer_jobs -.->|"schedules collection"| node_portal_collect
node_portal_collect -->|"collects metrics"| node_portal
node_portal_collect -->|"collects metrics"| node_filers
node_portal_jobs -.->|"schedules collection"| node_server_collect
node_portal_jobs -.->|"schedules collection"| node_pg_health
node_portal_jobs -.->|"schedules collection"| node_tenant_collect
node_server_collect -->|"queries inventory"| node_maindb
node_server_collect -->|"collects health"| node_linux_servers
node_pg_health -->|"checks health"| node_maindb
node_tenant_collect -->|"reads tenants"| node_maindb
node_portal_collect -->|"writes datasets"| node_csv_data
node_server_collect -->|"writes datasets"| node_csv_data
node_pg_health -->|"exports reports"| node_csv_data
node_tenant_collect -->|"writes tenants"| node_csv_data
node_dashboard_app -->|"reads datasets"| node_csv_data
node_dashboard_app -->|"evaluates rules"| node_thresholds
node_user -->|"configures environments"| node_environment_admin
node_environment_admin -->|"submits settings"| node_dashboard_app

click node_scheduler "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/scheduler_jobs.sh"
click node_portal_jobs "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/portal_jobs.sh"
click node_filer_jobs "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/filer_jobs.sh"
click node_portal_collect "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/ctera_collect.py"
click node_server_collect "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/ssh_collect_from_pg.py"
click node_pg_health "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/pg_healthcheck.py"
click node_tenant_collect "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/pg_collect_tenants.py"
click node_dashboard_app "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/dashboard/dashboard_csv.py"
click node_thresholds "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/dashboard/dashboard_csv.py"
click node_environment_admin "https://github.com/ctera/ctera-monitoring-dashboard/blob/main/dashboard/dashboard_csv.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_portal_collect,node_server_collect,node_pg_health,node_tenant_collect,node_user toneBlue
class node_dashboard_app,node_csv_data,node_thresholds,node_environment_admin toneAmber
class node_scheduler,node_portal_jobs,node_filer_jobs toneMint
class node_portal,node_filers,node_maindb,node_linux_servers toneRose
```

## Components

### Data collection

- [Portal and filer collector](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/ctera_collect.py): `ctera_collect.py`
- [Server health collector](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/ssh_collect_from_pg.py): `ssh_collect_from_pg.py`
- [PostgreSQL health collector](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/pg_healthcheck.py): `pg_healthcheck.py`
- [Tenant collector](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/pg_collect_tenants.py): `pg_collect_tenants.py`

### Dashboard

- [Flask dashboard](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/dashboard/dashboard_csv.py): `dashboard/dashboard_csv.py`
- **CSV metric datasets**
- [Threshold evaluation](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/dashboard/dashboard_csv.py): `dashboard/dashboard_csv.py`
- [Environment management](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/dashboard/dashboard_csv.py): `dashboard/dashboard_csv.py`

### Runtime operations

- [Scheduled jobs](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/scheduler_jobs.sh): `scheduler_jobs.sh`
- [Portal jobs](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/portal_jobs.sh): `portal_jobs.sh`
- [Filer jobs](https://github.com/ctera/ctera-monitoring-dashboard/blob/main/filer_jobs.sh): `filer_jobs.sh`

### Monitored systems

- **CTERA Portal**
- **Edge Filers**
- **MainDB PostgreSQL**
- **Linux servers**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Flask dashboard: views dashboard (evidence: `README.md`)
- Scheduled jobs → Portal jobs: runs jobs (evidence: `README.md`)
- Scheduled jobs → Filer jobs: runs jobs (evidence: `README.md`)
- Portal jobs → Portal and filer collector: schedules collection
- Filer jobs → Portal and filer collector: schedules collection
- Portal and filer collector → CTERA Portal: collects metrics (evidence: `README.md`)
- Portal and filer collector → Edge Filers: collects metrics (evidence: `README.md`)
- Portal jobs → Server health collector: schedules collection
- Portal jobs → PostgreSQL health collector: schedules collection
- Portal jobs → Tenant collector: schedules collection
- Server health collector → MainDB PostgreSQL: queries inventory (evidence: `README.md`)
- Server health collector → Linux servers: collects health (evidence: `README.md`)
- PostgreSQL health collector → MainDB PostgreSQL: checks health (evidence: `README.md`)
- Tenant collector → MainDB PostgreSQL: reads tenants (evidence: `README.md`)
- Portal and filer collector → CSV metric datasets: writes datasets (evidence: `README.md`)
- Server health collector → CSV metric datasets: writes datasets (evidence: `README.md`)
- PostgreSQL health collector → CSV metric datasets: exports reports (evidence: `pg_healthcheck.py`)
- Tenant collector → CSV metric datasets: writes tenants (evidence: `pg_collect_tenants.py`)
- Flask dashboard → CSV metric datasets: reads datasets (evidence: `dashboard/dashboard_csv.py`)
- Flask dashboard → Threshold evaluation: evaluates rules (evidence: `dashboard/dashboard_csv.py`)
- Dashboard user → Environment management: configures environments (evidence: `dashboard/dashboard_csv.py`)
- Environment management → Flask dashboard: submits settings (evidence: `dashboard/dashboard_csv.py`)
