# amidaware/rmmagent architecture

> Architecture diagram of the GitHub repository amidaware/rmmagent, 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/amidaware/rmmagent
- Repository: https://github.com/amidaware/rmmagent

## Overview

Tactical RMM Agent is an endpoint-management agent: it checks in with the management backend, then receives remote work and returns results. Its runtime also reports monitoring checks and supports endpoint inventory, Windows administration, software/update management, and interactive terminals. The README only identifies the agent and its build command; the sampled sources expose some control and reporting paths, but not all dispatch wiring, so uncertain subsystem links are omitted or marked unverified.

Main entry points: [`agent/agent.go`](https://github.com/amidaware/rmmagent/blob/develop/agent/agent.go) (Agent core), [`agent/rpc.go`](https://github.com/amidaware/rmmagent/blob/develop/agent/rpc.go) (NATS RPC dispatch), [`agent/wmi_windows.go`](https://github.com/amidaware/rmmagent/blob/develop/agent/wmi_windows.go) (WMI inventory), [`main.go`](https://github.com/amidaware/rmmagent/blob/develop/main.go) (CLI entrypoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Agent runtime"]
  node_entry["CLI entrypoint<br/>[main.go]"]
  node_agent["Agent core<br/>[agent.go]"]
  node_platform["Platform runtime<br/>[agent_unix.go]"]
  node_winplatform["Windows runtime<br/>[agent_windows.go]"]
  node_shared["Agent data types<br/>[types.go]"]
end

subgraph group_remote["Remote operations"]
  node_rpc["NATS RPC dispatch<br/>[rpc.go]"]
  node_scripts["Script execution<br/>[agent_windows.go]"]
  node_terminal["Terminal sessions<br/>[agent.go]"]
end

subgraph group_monitoring["Monitoring and inventory"]
  node_checks["Monitoring checks<br/>[checks.go]"]
  node_wmi["WMI inventory<br/>[wmi_windows.go]"]
end

subgraph group_windows["Windows management"]
  node_services["Windows services"]
  node_eventlog["Windows event logs"]
  node_registry["Windows registry"]
  node_patches["Update workflow<br/>[patches_windows.go]"]
  node_wua["Windows Update API<br/>[wua_windows.go]"]
  node_software["Installed software"]
end

node_operator(("RMM operator"))
node_backend["RMM API"]
node_broker["NATS broker"]

node_operator -.->|"requests management"| node_backend
node_entry -->|"initializes"| node_agent
node_entry -->|"runs RPC mode"| node_rpc
node_agent -->|"sends API requests"| node_backend
node_agent -->|"uses data types"| node_shared
node_agent -->|"configures NATS"| node_broker
node_rpc -->|"connects and dispatches"| node_broker
node_rpc -->|"posts operation results"| node_backend
node_rpc -->|"runs scripts"| node_scripts
node_rpc -->|"starts sessions"| node_terminal
node_rpc -->|"requests update checks"| node_patches
node_patches -->|"queries and installs"| node_wua
node_checks -->|"fetches and reports checks"| node_backend
node_wmi -->|"collects host inventory"| node_wmi
node_rpc -.->|"may dispatch service work"| node_services
node_rpc -.->|"may dispatch event-log work"| node_eventlog
node_rpc -.->|"may dispatch registry work"| node_registry
node_agent -.->|"schedules check execution"| node_checks
node_agent -.->|"uses inventory"| node_wmi
node_agent -.->|"uses service controls"| node_services
node_agent -.->|"uses event logs"| node_eventlog
node_agent -.->|"reports installed software"| node_software
node_platform -.->|"provides Unix behavior"| node_agent
node_winplatform -.->|"provides Windows behavior"| node_agent

click node_entry "https://github.com/amidaware/rmmagent/blob/develop/main.go"
click node_agent "https://github.com/amidaware/rmmagent/blob/develop/agent/agent.go"
click node_platform "https://github.com/amidaware/rmmagent/blob/develop/agent/agent_unix.go"
click node_winplatform "https://github.com/amidaware/rmmagent/blob/develop/agent/agent_windows.go"
click node_shared "https://github.com/amidaware/rmmagent/blob/develop/shared/types.go"
click node_rpc "https://github.com/amidaware/rmmagent/blob/develop/agent/rpc.go"
click node_scripts "https://github.com/amidaware/rmmagent/blob/develop/agent/agent_windows.go"
click node_terminal "https://github.com/amidaware/rmmagent/blob/develop/agent/agent.go"
click node_checks "https://github.com/amidaware/rmmagent/blob/develop/agent/checks.go"
click node_wmi "https://github.com/amidaware/rmmagent/blob/develop/agent/wmi_windows.go"
click node_services "https://github.com/amidaware/rmmagent/blob/develop/agent/services_windows.go"
click node_eventlog "https://github.com/amidaware/rmmagent/blob/develop/agent/eventlog_windows.go"
click node_registry "https://github.com/amidaware/rmmagent/blob/develop/agent/registry_windows.go"
click node_patches "https://github.com/amidaware/rmmagent/blob/develop/agent/patches_windows.go"
click node_wua "https://github.com/amidaware/rmmagent/blob/develop/agent/wua_windows.go"
click node_software "https://github.com/amidaware/rmmagent/blob/develop/agent/software_windows_amd64.go"

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_entry,node_agent,node_platform,node_winplatform,node_shared toneBlue
class node_rpc,node_scripts,node_terminal toneAmber
class node_checks,node_wmi,node_backend toneMint
class node_services,node_eventlog,node_registry,node_patches,node_wua,node_software toneRose
class node_operator,node_broker toneIndigo
```

## Components

### Agent runtime

- [CLI entrypoint](https://github.com/amidaware/rmmagent/blob/develop/main.go): `main.go`
- [Agent core](https://github.com/amidaware/rmmagent/blob/develop/agent/agent.go): `agent/agent.go`
- [Platform runtime](https://github.com/amidaware/rmmagent/blob/develop/agent/agent_unix.go): `agent/agent_unix.go`
- [Windows runtime](https://github.com/amidaware/rmmagent/blob/develop/agent/agent_windows.go): `agent/agent_windows.go`
- [Agent data types](https://github.com/amidaware/rmmagent/blob/develop/shared/types.go): `shared/types.go`

### Remote operations

- [NATS RPC dispatch](https://github.com/amidaware/rmmagent/blob/develop/agent/rpc.go): `agent/rpc.go`
- [Script execution](https://github.com/amidaware/rmmagent/blob/develop/agent/agent_windows.go): `agent/agent_windows.go`
- [Terminal sessions](https://github.com/amidaware/rmmagent/blob/develop/agent/agent.go): `agent/agent.go`

### Monitoring and inventory

- [Monitoring checks](https://github.com/amidaware/rmmagent/blob/develop/agent/checks.go): `agent/checks.go`
- [WMI inventory](https://github.com/amidaware/rmmagent/blob/develop/agent/wmi_windows.go): `agent/wmi_windows.go`

### Windows management

- [Windows services](https://github.com/amidaware/rmmagent/blob/develop/agent/services_windows.go): `agent/services_windows.go`
- [Windows event logs](https://github.com/amidaware/rmmagent/blob/develop/agent/eventlog_windows.go): `agent/eventlog_windows.go`
- [Windows registry](https://github.com/amidaware/rmmagent/blob/develop/agent/registry_windows.go): `agent/registry_windows.go`
- [Update workflow](https://github.com/amidaware/rmmagent/blob/develop/agent/patches_windows.go): `agent/patches_windows.go`
- [Windows Update API](https://github.com/amidaware/rmmagent/blob/develop/agent/wua_windows.go): `agent/wua_windows.go`
- [Installed software](https://github.com/amidaware/rmmagent/blob/develop/agent/software_windows_amd64.go): `agent/software_windows_amd64.go`

### Other components

- **RMM operator**
- **RMM API**
- **NATS broker**

## Connections

- RMM operator → RMM API: requests management (evidence: `README.md`)
- CLI entrypoint → Agent core: initializes (evidence: `main.go`)
- CLI entrypoint → NATS RPC dispatch: runs RPC mode (evidence: `main.go`)
- Agent core → RMM API: sends API requests (evidence: `agent/agent.go`)
- Agent core → Agent data types: uses data types (evidence: `agent/agent.go`)
- Agent core → NATS broker: configures NATS (evidence: `agent/agent.go`)
- NATS RPC dispatch → NATS broker: connects and dispatches (evidence: `agent/rpc.go`)
- NATS RPC dispatch → RMM API: posts operation results (evidence: `agent/rpc.go`)
- NATS RPC dispatch → Script execution: runs scripts (evidence: `agent/rpc.go`)
- NATS RPC dispatch → Terminal sessions: starts sessions (evidence: `agent/rpc.go`)
- NATS RPC dispatch → Update workflow: requests update checks (evidence: `agent/rpc.go`)
- Update workflow → Windows Update API: queries and installs (evidence: `agent/patches_windows.go`)
- Monitoring checks → RMM API: fetches and reports checks (evidence: `agent/checks.go`)
- WMI inventory → WMI inventory: collects host inventory (evidence: `agent/wmi_windows.go`)
- NATS RPC dispatch → Windows services: may dispatch service work
- NATS RPC dispatch → Windows event logs: may dispatch event-log work
- NATS RPC dispatch → Windows registry: may dispatch registry work
- Agent core → Monitoring checks: schedules check execution
- Agent core → WMI inventory: uses inventory
- Agent core → Windows services: uses service controls
- Agent core → Windows event logs: uses event logs
- Agent core → Installed software: reports installed software
- Platform runtime → Agent core: provides Unix behavior
- Windows runtime → Agent core: provides Windows behavior
