README: Alle Beispiele mit echten Zugangsdaten (Backend, API-Key, Agent-ID)

This commit is contained in:
cynfo3000 2026-02-28 09:08:58 +01:00
parent 33c3b84d0f
commit f55536623e

View File

@ -142,57 +142,69 @@ daemon -f -p /var/run/rmm-agent.pid -o /usr/local/rmm/rmm-agent.log \
| DELETE | `/api/v1/agents/{id}/tunnel/{tid}` | Tunnel schliessen | | DELETE | `/api/v1/agents/{id}/tunnel/{tid}` | Tunnel schliessen |
| POST | `/api/v1/agents/{id}/exec` | Remote-Command ausfuehren | | POST | `/api/v1/agents/{id}/exec` | Remote-Command ausfuehren |
### Tunnel erstellen ### Tunnel-Beispiele
```bash ```bash
# SSH-Tunnel zur OPNsense # SSH-Tunnel zur OPNsense
curl -sk -H "X-API-Key: KEY" -X POST \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \
https://backend:8443/api/v1/agents/AGENT_ID/tunnel \ https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/tunnel \
-d '{"target_host":"127.0.0.1","target_port":22}' -d '{"target_host":"127.0.0.1","target_port":22}'
# Response: {"tunnel_id":"xxx","proxy_port":10000,...} # Response: {"tunnel_id":"xxx","proxy_port":10000,...}
# Verbinden: # Verbinden:
ssh -p 10000 root@backend-ip ssh -p 10000 root@192.168.85.13
```
```bash
# WebGUI-Tunnel (OPNsense auf Port 4444) # WebGUI-Tunnel (OPNsense auf Port 4444)
curl -sk -H "X-API-Key: KEY" -X POST \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \
https://backend:8443/api/v1/agents/AGENT_ID/tunnel \ https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/tunnel \
-d '{"target_host":"127.0.0.1","target_port":4444}' -d '{"target_host":"127.0.0.1","target_port":4444}'
# Response: {"tunnel_id":"xxx","proxy_port":10001,...} # Response: {"tunnel_id":"xxx","proxy_port":10001,...}
# Im Browser: https://192.168.85.13:10001/
# Im Browser: https://backend-ip:10001/ # Aktive Tunnel auflisten
curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \
https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/tunnels
# Tunnel schliessen
curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X DELETE \
https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/tunnel/TUNNEL_ID
```
### Zugangsdaten
```
Backend: https://192.168.85.13:8443
API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9
Agent-ID: e92e87a684b20db15d8d2344583c5887 (OPN-REP.intra.weidenhaupt.net)
``` ```
### Agent-Beispiele ### Agent-Beispiele
```bash ```bash
# Alle Agents auflisten (ID, Name, IP, Version, letzter Heartbeat) # Alle Agents auflisten (ID, Name, IP, Version, letzter Heartbeat)
curl -sk -H "X-API-Key: KEY" \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \
https://backend:8443/api/v1/agents https://192.168.85.13:8443/api/v1/agents
# Einzelner Agent mit Systemdaten # Einzelner Agent mit Systemdaten
curl -sk -H "X-API-Key: KEY" \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \
https://backend:8443/api/v1/agents/AGENT_ID https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887
# Nur Systemdaten (Hardware, CPU, RAM, Disks, Services, etc.) # Nur Systemdaten (Hardware, CPU, RAM, Disks, Services, etc.)
curl -sk -H "X-API-Key: KEY" \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \
https://backend:8443/api/v1/agents/AGENT_ID/system https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/system
# Agent loeschen # Agent loeschen
curl -sk -H "X-API-Key: KEY" -X DELETE \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X DELETE \
https://backend:8443/api/v1/agents/AGENT_ID https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887
# Hub-Status (verbundene Agents, aktive Tunnel) # Hub-Status (verbundene Agents, aktive Tunnel)
curl -sk -H "X-API-Key: KEY" \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" \
https://backend:8443/api/v1/hub/status https://192.168.85.13:8443/api/v1/hub/status
# Remote-Command ausfuehren # Remote-Command ausfuehren
curl -sk -H "X-API-Key: KEY" -X POST \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \
https://backend:8443/api/v1/agents/AGENT_ID/exec \ https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/exec \
-d '{"command":"uptime","timeout":30}' -d '{"command":"uptime","timeout":30}'
``` ```
@ -200,26 +212,26 @@ curl -sk -H "X-API-Key: KEY" -X POST \
```bash ```bash
# Verfuegbare Updates pruefen # Verfuegbare Updates pruefen
curl -sk -H "X-API-Key: KEY" -X POST \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \
https://backend:8443/api/v1/agents/AGENT_ID/update-check https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/update-check
# Normales Update (ohne Reboot) # Normales Update (ohne Reboot)
curl -sk -H "X-API-Key: KEY" -X POST \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \
https://backend:8443/api/v1/agents/AGENT_ID/update https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/update
# Normales Update mit Reboot # Normales Update mit Reboot
curl -sk -H "X-API-Key: KEY" -X POST \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \
https://backend:8443/api/v1/agents/AGENT_ID/update \ https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/update \
-d '{"reboot":true}' -d '{"reboot":true}'
# Major-Upgrade auf Version 26.7 # Major-Upgrade auf Version 26.7
curl -sk -H "X-API-Key: KEY" -X POST \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \
https://backend:8443/api/v1/agents/AGENT_ID/major-update \ https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/major-update \
-d '{"version":"26.7","reboot":true}' -d '{"version":"26.7","reboot":true}'
# Reboot (5s Verzoegerung default) # Reboot (5s Verzoegerung default)
curl -sk -H "X-API-Key: KEY" -X POST \ curl -sk -H "X-API-Key: 01532e5a7c9e70bf2757df77a2f5b9b9" -X POST \
https://backend:8443/api/v1/agents/AGENT_ID/reboot https://192.168.85.13:8443/api/v1/agents/e92e87a684b20db15d8d2344583c5887/reboot
``` ```
### WebSocket Commands (Backend → Agent) ### WebSocket Commands (Backend → Agent)