rmm2/backend/models/system.go
cynfo3000 7f9fbd257f Linux/Proxmox Agent + Plattform-Updater + Proxmox Frontend
- agent-linux/: Kompletter Linux/Proxmox RMM Agent
  - Collectors: CPU, Memory, Disk, Network, Services, Updates, Proxmox (VMs, Container, Storage, ZFS), Backups
  - Backup Collector: Jobs nach Node gefiltert (Cluster-aware)
  - WebSocket: Tunnel-Support, writeMux fuer stabile Verbindungen
  - Systemd Service Template

- updater/: Plattform-unabhaengiger Updater (FreeBSD + Linux)
  - runtime.GOOS erkennt Plattform automatisch
  - FreeBSD: /usr/local/rmm/, service rmm_agent
  - Linux: /usr/local/bin/, /etc/rmm/, systemctl rmm-agent
  - Firmware-Download mit ?platform= Parameter

- frontend/: Proxmox-Bereich
  - ProxmoxServers.jsx: Eigene Seite fuer PVE Server mit VM/CT Counts
  - ProxmoxPanel.jsx: Detail-Panel mit Uebersicht, VMs, Container, Storage, ZFS, Tunnel, Dienste, Updates, Backups
  - Agents.jsx: Filtert Linux-Agents raus (nur OPNsense)
  - Sidebar: Proxmox Navigationspunkt
  - Installationsanleitung mit rmm-agent-linux + rmm-updater-linux

- backend: Platform-Feld fuer Agents, Firmware multi-platform
2026-03-01 22:03:18 +01:00

198 lines
6.4 KiB
Go

package models
// SystemData - Alle Systemdaten die der Agent sendet
type SystemData struct {
AgentID string `json:"agent_id"`
Hostname string `json:"hostname"`
OPNsenseVersion string `json:"opnsense_version"`
FreeBSDVersion string `json:"freebsd_version"`
UptimeSeconds int64 `json:"uptime_seconds"`
Hardware HardwareInfo `json:"hardware"`
CPU CPUInfo `json:"cpu"`
Memory MemoryInfo `json:"memory"`
Disks []DiskInfo `json:"disks"`
NetworkInterfaces []NetworkInterface `json:"network_interfaces"`
Services []ServiceInfo `json:"services"`
WireGuard []WireGuardTunnel `json:"wireguard,omitempty"`
DHCP *DHCPInfo `json:"dhcp,omitempty"`
Routes []Route `json:"routes,omitempty"`
Gateways []GatewayInfo `json:"gateways,omitempty"`
Certificates []CertificateInfo `json:"certificates,omitempty"`
Plugins []PluginInfo `json:"plugins,omitempty"`
Updates *UpdateInfo `json:"updates,omitempty"`
CronJobs []CronJob `json:"cron_jobs,omitempty"`
License *LicenseInfo `json:"license,omitempty"`
Proxmox map[string]interface{} `json:"proxmox,omitempty"`
Backups map[string]interface{} `json:"backups,omitempty"`
}
type LicenseInfo struct {
IsBusinessEdition bool `json:"is_business_edition"`
ProductName string `json:"product_name,omitempty"`
Subscription string `json:"subscription,omitempty"`
ValidTo string `json:"valid_to,omitempty"`
DaysRemaining int `json:"days_remaining,omitempty"`
}
type WireGuardTunnel struct {
Interface string `json:"interface"`
PublicKey string `json:"public_key"`
ListenPort int `json:"listen_port"`
Peers []WireGuardPeer `json:"peers"`
}
type WireGuardPeer struct {
PublicKey string `json:"public_key"`
Endpoint string `json:"endpoint"`
AllowedIPs []string `json:"allowed_ips"`
LatestHandshake int64 `json:"latest_handshake_epoch"`
HandshakeAge string `json:"handshake_age"`
TransferRx int64 `json:"transfer_rx_bytes"`
TransferTx int64 `json:"transfer_tx_bytes"`
Keepalive int `json:"persistent_keepalive"`
Status string `json:"status"`
}
type DHCPInfo struct {
Server string `json:"server"`
Leases []DHCPLease `json:"leases"`
}
type DHCPLease struct {
IP string `json:"ip"`
MAC string `json:"mac"`
Hostname string `json:"hostname"`
Start string `json:"start,omitempty"`
End string `json:"end,omitempty"`
Status string `json:"status"`
Pool string `json:"pool,omitempty"`
}
type HardwareInfo struct {
Manufacturer string `json:"manufacturer"`
Model string `json:"model"`
Serial string `json:"serial"`
BIOSVersion string `json:"bios_version"`
}
type CPUInfo struct {
Model string `json:"model"`
Cores int `json:"cores"`
Threads int `json:"threads"`
FreqMHz int `json:"freq_mhz"`
UsagePercent float64 `json:"usage_percent"`
}
type MemoryInfo struct {
TotalBytes int64 `json:"total_bytes"`
UsedBytes int64 `json:"used_bytes"`
FreeBytes int64 `json:"free_bytes"`
}
type DiskInfo struct {
Filesystem string `json:"filesystem"`
TotalBytes int64 `json:"total_bytes"`
UsedBytes int64 `json:"used_bytes"`
FreeBytes int64 `json:"free_bytes"`
MountPoint string `json:"mount_point"`
}
type NetworkInterface struct {
Name string `json:"name"`
Role string `json:"role"`
IP string `json:"ip"`
MAC string `json:"mac"`
Status string `json:"status"`
RxBytes int64 `json:"rx_bytes"`
TxBytes int64 `json:"tx_bytes"`
}
type ServiceInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
}
type Route struct {
Destination string `json:"destination"`
Gateway string `json:"gateway"`
Flags string `json:"flags"`
Interface string `json:"interface"`
}
type GatewayInfo struct {
Name string `json:"name"`
Address string `json:"address"`
Status string `json:"status"`
Loss string `json:"loss,omitempty"`
Delay string `json:"delay,omitempty"`
Stddev string `json:"stddev,omitempty"`
Monitor string `json:"monitor,omitempty"`
}
type CertificateInfo struct {
Name string `json:"name"`
Subject string `json:"subject"`
Issuer string `json:"issuer"`
NotBefore string `json:"not_before"`
NotAfter string `json:"not_after"`
DaysLeft int `json:"days_left"`
Serial string `json:"serial"`
SAN string `json:"san,omitempty"`
KeyUsage string `json:"key_usage,omitempty"`
IsCA bool `json:"is_ca"`
Status string `json:"status"`
Source string `json:"source"`
}
type PluginInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
}
type UpdateInfo struct {
UpdateAvailable bool `json:"update_available"`
PendingCount int `json:"pending_count"`
Updates []PendingUpdateInfo `json:"updates"`
OPNsenseUpdate string `json:"opnsense_update,omitempty"`
}
type PendingUpdateInfo struct {
Package string `json:"package"`
CurrentVer string `json:"current_version"`
NewVer string `json:"new_version"`
}
type CronJob struct {
Source string `json:"source"`
Enabled bool `json:"enabled"`
Minutes string `json:"minutes"`
Hours string `json:"hours"`
Days string `json:"days"`
Months string `json:"months"`
Weekdays string `json:"weekdays"`
Command string `json:"command"`
Parameters string `json:"parameters,omitempty"`
Who string `json:"who,omitempty"`
Description string `json:"description,omitempty"`
UUID string `json:"uuid,omitempty"`
Origin string `json:"origin,omitempty"`
Schedule string `json:"schedule"`
}
// HeartbeatRequest
type HeartbeatRequest struct {
AgentID string `json:"agent_id"`
AgentVersion string `json:"agent_version,omitempty"`
SystemData SystemData `json:"system_data"`
}
// HeartbeatResponse
type HeartbeatResponse struct {
Message string `json:"message"`
UpdateAvailable bool `json:"update_available,omitempty"`
UpdateVersion string `json:"update_version,omitempty"`
UpdateHash string `json:"update_hash,omitempty"`
}