GuruRMM - Complete Reference Documentation
Project: GuruRMM - Remote Monitoring and Management Platform
Version: Server 0.2.0 / Agent 0.3.5 (deployed as 0.5.1)
Last Updated: 2026-02-17
Table of Contents
- Project Overview
- Architecture
- API Endpoints
- WebSocket Protocol
- Command Execution
- Claude Code Integration
- Agent Configuration
- Deployed Agents
- Database
- Authentication
- Auto-Update System
- Known Issues
- Development
- File Structure
Project Overview
GuruRMM is a Remote Monitoring and Management (RMM) platform built entirely in Rust. It provides real-time agent monitoring, remote command execution, system metrics collection, and service watchdog capabilities for managed IT environments.
Technology Stack
| Component |
Technology |
Version |
| Server |
Rust (Axum 0.7, SQLx 0.8, PostgreSQL) |
0.2.0 |
| Agent |
Rust (cross-platform, native service) |
0.3.5 (deployed as 0.5.1) |
| Dashboard |
React + TypeScript + Vite |
-- |
| Real-time |
WebSocket (tokio-tungstenite) |
-- |
| Database |
PostgreSQL |
-- |
Architecture
Server
- Internal Address: 172.16.3.30:3001
- Production URL: https://rmm-api.azcomputerguru.com
- WebSocket Endpoint: wss://rmm-api.azcomputerguru.com/ws
- Database: PostgreSQL (same server)
- Service: systemd unit
gururmm-server
- Source:
D:\ClaudeTools\projects\msp-tools\guru-rmm\server\
Agent
- Windows Service Name: GuruRMM (uses native-service feature)
- Legacy Mode: NSSM wrapper for Windows 7 / Server 2008 R2
- Config Path:
C:\ProgramData\GuruRMM\agent.toml
- Binary Path:
C:\Program Files\GuruRMM\gururmm-agent.exe
- Source:
D:\ClaudeTools\projects\msp-tools\guru-rmm\agent\
Communication Model
- Primary: WebSocket -- persistent bidirectional connection between agent and server
- Legacy Fallback: REST heartbeat polling -- [WARNING] NOT FULLY IMPLEMENTED
- Auth: API key sent in initial WebSocket authentication message
- Site-Based Auth: WORD-WORD-NUMBER format site codes combined with device_id
API Endpoints
Authentication
| Method |
Path |
Description |
Auth Required |
| POST |
/api/auth/login |
User login (email/password -> JWT) |
No |
| POST |
/api/auth/register |
User registration |
No (disabled) |
| GET |
/api/auth/me |
Get current user info |
Yes |
Clients
| Method |
Path |
Description |
Auth Required |
| GET |
/api/clients |
List all clients |
Yes |
| POST |
/api/clients |
Create client |
Yes |
| GET |
/api/clients/:id |
Get client by ID |
Yes |
| PUT |
/api/clients/:id |
Update client |
Yes |
| DELETE |
/api/clients/:id |
Delete client |
Yes |
| GET |
/api/clients/:id/sites |
List client's sites |
Yes |
Sites
| Method |
Path |
Description |
Auth Required |
| GET |
/api/sites |
List all sites |
Yes |
| POST |
/api/sites |
Create site |
Yes |
| GET |
/api/sites/:id |
Get site by ID |
Yes |
| PUT |
/api/sites/:id |
Update site |
Yes |
| DELETE |
/api/sites/:id |
Delete site |
Yes |
| POST |
/api/sites/:id/regenerate-key |
Regenerate site API key |
Yes |
Agents
| Method |
Path |
Description |
Auth Required |
| GET |
/api/agents |
List all agents |
Yes |
| POST |
/api/agents |
Register agent (authenticated) |
Yes |
| GET |
/api/agents/stats |
Agent statistics |
Yes |
| GET |
/api/agents/unassigned |
List unassigned agents |
Yes |
| GET |
/api/agents/:id |
Get agent details |
Yes |
| DELETE |
/api/agents/:id |
Delete agent |
Yes |
| POST |
/api/agents/:id/move |
Move agent to different site |
Yes |
| GET |
/api/agents/:id/state |
Get agent state (network, metrics) |
Yes |
Commands
| Method |
Path |
Description |
Auth Required |
| POST |
/api/agents/:id/command |
Send command to agent |
Yes |
| GET |
/api/commands |
List recent commands |
Yes |
| GET |
/api/commands/:id |
Get command status/result |
Yes |
Metrics
| Method |
Path |
Description |
Auth Required |
| GET |
/api/agents/:id/metrics |
Get agent metrics history |
Yes |
| GET |
/api/metrics/summary |
Metrics summary |
Yes |
Legacy Agent Endpoints
These endpoints do not require JWT authentication. They are used by agents in legacy polling mode.
| Method |
Path |
Description |
Auth Required |
| POST |
/api/agent/register-legacy |
Register with site code |
No |
| POST |
/api/agent/heartbeat |
Agent heartbeat |
No |
| POST |
/api/agent/command-result |
Submit command result |
No |
[WARNING] Legacy heartbeat returns empty pending_commands -- not implemented (agents.rs line 334).
[WARNING] Legacy command-result endpoint does not store results (agents.rs lines 354-360).
WebSocket
| Method |
Path |
Description |
Auth Required |
| GET |
/ws |
WebSocket upgrade |
API key in auth msg |
WebSocket Protocol
Connection Flow
- Client initiates WebSocket upgrade to
wss://rmm-api.azcomputerguru.com/ws
- Agent sends authentication message with API key and device info
- Server validates API key (SHA256 hash match or site code lookup)
- On success, server registers the WebSocket connection for the agent
- Bidirectional message exchange begins
Message Types
Agent -> Server:
Auth -- Initial authentication payload (api_key, hostname, os_info, version)
Heartbeat -- Periodic keepalive
MetricsReport -- System metrics (CPU, memory, disk, network)
NetworkState -- Network configuration snapshot (hash-based change detection)
CommandResult -- Result of executed command (exit_code, stdout, stderr, duration)
WatchdogEvent -- Service monitoring event
Server -> Agent:
AuthResponse -- Success/failure of authentication
Command -- Command to execute (CommandPayload)
Update -- Auto-update instruction (download_url, checksum)
Ping -- Keepalive ping
Command Execution
Command Types
| Type |
Description |
Shell Used |
| shell |
System shell command |
cmd.exe (Windows), /bin/sh (Unix) |
| powershell |
PowerShell command |
powershell -NoProfile -NonInteractive -Command |
| python |
Python inline code |
python -c |
| script |
Custom interpreter |
Configurable |
| claude_task |
Claude Code task execution (special handler) |
Claude Code CLI |
Command Flow
Command States
| State |
Description |
| pending |
Created, agent offline or not yet sent |
| running |
Sent to agent via WebSocket, awaiting result |
| completed |
Agent reported exit_code = 0 |
| failed |
Agent reported exit_code != 0 |
[BUG] Server-Agent Command Type Mismatch
This is a critical known bug that prevents all remote command execution.
Root Cause:
The server's CommandPayload serializes command_type as a plain JSON string:
The agent's CommandPayload expects command_type as a Rust enum (CommandType::PowerShell), which serde deserializes from an object or tagged format, not a bare string.
Result: Serde deserialization fails silently on the agent side. Commands are never executed. All commands remain in "running" state permanently because no CommandResult is ever sent back.
Fix Required: Either:
- Change the server to serialize
command_type in the enum format the agent expects, OR
- Change the agent to accept plain string values for
command_type
Claude Code Integration
Architecture
The agent includes a built-in Claude Code executor for running AI-assisted tasks.
- Singleton: Global
ClaudeExecutor via once_cell::Lazy
- Working Directory: Restricted to
C:\Shares\test\ only
- Rate Limit: 10 tasks per hour (sliding window)
- Max Concurrent: 2 simultaneous tasks
- Default Timeout: 300 seconds (max 600)
- Input Sanitization: Blocks
& | ; $ ( ) < > \ \n \r`
Claude Task Command Format
The server sends:
[WARNING] This also suffers from the command type mismatch bug. The agent expects command_type to be an object for ClaudeTask:
Exit Codes
| Code |
Meaning |
| 0 |
Task completed successfully |
| 1 |
Task failed |
| 124 |
Task timed out |
| -1 |
Executor error (rate limit, validation) |
Agent Configuration
agent.toml Format
Hardcoded Intervals
These values are currently not configurable via agent.toml:
| Interval |
Value |
Notes |
| Heartbeat |
30 seconds |
|
| Network state check |
30 seconds |
Uses hash-based change detection |
| Connection idle timeout |
90 seconds |
|
| Auth timeout |
10 seconds |
|
| Reconnect delay |
10 seconds |
|
| Command execution timeout |
300 seconds |
Configurable per command |
Deployed Agents
| Hostname |
Agent ID (prefix) |
Version |
OS |
Status |
| ACG-M-L5090 |
97f63c3b-... |
0.5.1 |
Windows 11 (26200) |
online |
| AD2 |
d28a1c90-... |
0.5.1 |
Windows Server 2016 (14393) |
online |
| gururmm |
8cd0440f-... |
0.5.1 |
Ubuntu 22.04 |
offline |
| SL-SERVER |
2585f6d5-... |
0.5.1 |
unknown |
offline |
| SL-SERVER |
dff818e6-... |
0.5.1 |
unknown |
online |
Database
Connection Details
| Parameter |
Value |
| Host |
172.16.3.30 |
| Port |
5432 |
| Database |
gururmm |
| User |
gururmm |
| Password |
43617ebf7eb242e814ca9988cc4df5ad |
Key Tables
| Table |
Description |
| users |
User accounts (JWT auth, Argon2id hashing) |
| clients |
Client organizations |
| sites |
Physical locations with API keys |
| agents |
RMM agent instances |
| agent_state |
Latest agent state (network, metrics snapshot) |
| agent_updates |
Agent update tracking |
| alerts |
System alerts |
| commands |
Remote command execution log |
| metrics |
Performance metrics time series |
| policies |
Configuration policies |
| registration_tokens |
Agent registration tokens |
| watchdog_events |
Service monitoring events |
Authentication
API Authentication (JWT)
- Send
POST /api/auth/login with { email, password }
- Server validates credentials (Argon2id password hash)
- Returns JWT token (24-hour expiry)
- Include token in subsequent requests:
Authorization: Bearer <token>
Admin Credentials:
Agent Authentication (API Key)
Two authentication modes:
- Direct API Key -- Agent sends
grmm_xxxxx format key, server matches against api_key_hash (SHA256) in agents table
- Site-Based -- Agent sends site code (WORD-WORD-NUMBER format, e.g.,
DARK-GROVE-7839) combined with device_id, server looks up site and registers/matches agent
SSO (Optional)
- Provider: Microsoft Entra ID
- Client ID: 18a15f5d-7ab8-46f4-8566-d7b5436b84b6
Auto-Update System
Update Flow
Download Location
- Server Path:
/var/www/gururmm/downloads/
- Public URL:
https://rmm-api.azcomputerguru.com/downloads/
Known Issues
CRITICAL
| ID |
Type |
Description |
| 1 |
[BUG] |
Command type mismatch between server (String) and agent (Enum) -- commands never execute |
| 2 |
[TODO] |
Legacy heartbeat returns empty pending_commands (agents.rs line 334) |
| 3 |
[TODO] |
Legacy command-result endpoint does not store results (agents.rs lines 354-360) |
| 4 |
[SECURITY] |
CORS configured with AllowOrigin::Any -- should be restricted to known origins |
MAJOR
| ID |
Description |
| 1 |
No command timeout enforcement on server side |
| 2 |
No retry logic for failed WebSocket sends |
| 3 |
Database inconsistency: agent shows "online" but command sends fail silently |
| 4 |
Missing database indexes on frequently queried columns |
| 5 |
No rate limiting on command submissions |
MINOR
| ID |
Description |
| 1 |
Hardcoded intervals (heartbeat, network check) not configurable |
| 2 |
Watchdog events logged but not stored in database |
| 3 |
No log rotation configured |
| 4 |
Unicode characters in agent output (should use ASCII per coding guidelines) |
Development
Building
Testing
Deploying the Server
Deploying the Agent
File Structure
Quick Reference
Document generated 2026-02-17. Source of truth for GuruRMM project reference.