import { useState } from 'react' import { Copy, Check, Terminal, Monitor } from 'lucide-react' import { copyToClipboard } from '../utils/clipboard' import { useSettingsStore } from '../stores/settings' export default function InstallGuide({ agentName, platform: initialPlatform }) { const [platform, setPlatform] = useState(initialPlatform || 'freebsd') const [copied, setCopied] = useState(null) const { settings } = useSettingsStore() const BACKEND_URL = settings.backend_url_external || settings.backend_url_internal || '' const API_KEY = settings.api_key || '' const copyText = (text, id) => { copyToClipboard(text) setCopied(id) setTimeout(() => setCopied(null), 2000) } const CopyBtn = ({ text, id, className = '' }) => ( ) const CodeBlock = ({ text, id }) => (
        {text}
      
) const ConfigValue = ({ label, value, id, mono = false }) => (
{label}
{value}
) const opnInstallCmd = `fetch --no-verify-peer --no-verify-hostname -o /tmp/installer.zip \\ "${BACKEND_URL}/api/v1/installer/download?platform=freebsd&api_key=${API_KEY}" \\ && cd /tmp && unzip -o installer.zip && sh /tmp/install.sh` const linuxInstallCmd = `#!/bin/sh # RMM Agent + Updater Installation set -e BACKEND="${BACKEND_URL}" API_KEY="${API_KEY}" NAME="${agentName || ''}" # Download wget --no-check-certificate -O /tmp/rmm-bundle.zip \\ "$BACKEND/api/v1/firmware/download?platform=linux&api_key=$API_KEY" cd /tmp && unzip -o rmm-bundle.zip # Install binaries install -m 755 /tmp/rmm-agent-linux /usr/local/bin/rmm-agent install -m 755 /tmp/rmm-updater-linux /usr/local/bin/rmm-updater mkdir -p /etc/rmm # Config cat > /etc/rmm/config.yaml << EOF backend_url: "$BACKEND" api_key: "$API_KEY" agent_name: "$NAME" interval_seconds: 60 insecure: true EOF # Systemd services cat > /etc/systemd/system/rmm-agent.service << EOF [Unit] Description=RMM Agent After=network.target [Service] Type=simple ExecStart=/usr/local/bin/rmm-agent Restart=always RestartSec=10 [Install] WantedBy=multi-user.target EOF cat > /etc/systemd/system/rmm-updater.service << EOF [Unit] Description=RMM Updater After=network.target [Service] Type=simple ExecStart=/usr/local/bin/rmm-updater Restart=always RestartSec=30 [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable --now rmm-agent rmm-updater echo "Fertig! Agent verbindet sich automatisch mit Backend." ` return (
{/* Platform Tabs */} {!initialPlatform && (
)} {platform === 'freebsd' ? (
{/* Step 1: Install Plugin */}

1 Plugin installieren

Per SSH oder WebGUI-Shell auf der Firewall ausfuehren:

{/* Step 2: Configure via WebGUI */}

2 Im WebGUI konfigurieren

Services > RMM Agent > folgende Werte eintragen:

'} id="opn-name" />
{/* Step 3: Enable + Start */}

3 Aktivieren und starten

"Enabled" aktivieren, "Save & Apply", dann "Restart Service". Der Agent verbindet sich automatisch.

) : (
{/* Linux: Single script */}

1 Installscript ausfuehren

Als root auf dem Server ausfuehren. Script kopieren, als Datei speichern und starten:

{/* Config values for reference */}

2 Konfigurationswerte (Referenz)

'} id="linux-name" />
)}

Der Agent meldet sich nach Installation automatisch beim Backend. Name und IP werden beim ersten Heartbeat uebernommen.

) }