MC4Y-CMDB-Verteiler – Agenten und Crawler auf mehrere Geräte ausrollen
================================================================================

Wozu?
-----
Mit dem Verteiler richten Sie den CMDB-Agenten (oder Crawler) auf mehreren Geräten auf einmal ein –
von Ihrem Arbeitsplatz aus, ohne sich an jedem Gerät einzeln anzumelden. Windows-Rechner erreicht der
Verteiler über WinRM, Linux-, Raspberry-Pi- und macOS-Geräte über SSH. Home Assistant wird NICHT aus
der Ferne eingerichtet: Dort installieren Sie die Integration einmal am Gerät selbst – die Ansicht
„Geräte verbinden“ zeigt dafür eine Schritt-für-Schritt-Anleitung und den Download (Paket
„mc4y-cmdb-homeassistant“).

Was Sie brauchen
----------------
- Einen Windows-Arbeitsplatz (Windows 10/11 oder Server), von dem aus Sie die Ziele erreichen.
- Für Windows-Ziele: ein Administrator-Konto, das sich auf den Ziel-Rechnern anmelden darf (in einer
  Domäne meist das Domänen-Admin-Konto), und aktives WinRM auf den Zielen. In einer Domäne ist WinRM
  meist schon aktiv; sonst einmalig auf dem Ziel in einer Administrator-PowerShell:  winrm quickconfig
- Für Linux-, Raspberry-Pi- und macOS-Ziele: den OpenSSH-Client auf Ihrem Arbeitsplatz (ssh/scp – über
  „Optionale Features“ von Windows nachinstallierbar), einen SSH-Zugang (am besten per Schlüssel) sowie
  auf den Zielen python3 und Rootrechte für die Installation (als root anmelden, NOPASSWD-sudo einrichten
  oder im Formular ein sudo-Kennwort angeben – es bleibt nur im Arbeitsspeicher).
- Die Datei „verteiler.json“ neben diesem Programm (sie nennt die Adresse Ihrer Suite). Sie bekommen sie
  in der Suite: Verwaltung › CMDB › Erkennung › „Geräte verbinden“ › Knopf „Einrichtungsdatei
  (verteiler.json)“. Legen Sie die Datei in diesen Ordner.

Schritt für Schritt
-------------------
1. Dieses ZIP vollständig entpacken (die Ordner „windows“ und „python“ müssen daneben liegen bleiben).
2. „verteiler.json“ aus der Suite daneben legen (siehe oben).
3. „Verteiler-starten.bat“ doppelklicken. Ein Fenster öffnet sich; bitte offen lassen.
4. Der Browser öffnet die Ansicht „Geräte verbinden“ in Ihrer Suite – jetzt verbunden.
5. Dort: Agent oder Crawler wählen, das Betriebssystem der Ziele wählen (Windows, Linux/Raspberry Pi,
   macOS oder Home Assistant), die Rechner eintragen (einer je Zeile: Name, FQDN oder IP), das Konto
   angeben (bei Windows mit Kennwort, bei SSH den Benutzer und optional Schlüssel/sudo-Kennwort),
   „Verbindung prüfen“ und dann „Ausrollen“. Bei „Home Assistant“ erscheint statt des Formulars die
   Schritt-für-Schritt-Anleitung samt Download.
6. Sie sehen den Fortschritt je Gerät. Fertige Geräte erscheinen nach dem nächsten Lebenszeichen in
   der CMDB.

Sicherheit und Datenschutz
--------------------------
- Das Programm läuft nur auf Ihrem Rechner und ist von außen nicht erreichbar (nur 127.0.0.1,
  mit einem Zufallsschlüssel abgesichert).
- Kennwörter werden NICHT gespeichert: sie bleiben im Arbeitsspeicher und werden nur für die
  jeweilige Ausrollung verwendet – nie auf die Festplatte oder in eine Befehlszeile geschrieben.
- Das Ausrollen überträgt nur die Installationsdateien und richtet die geplante Aufgabe (Windows) bzw.
  den Dienst (Linux/macOS) auf dem Ziel ein. Es werden keine Angriffe oder Anmeldeversuche gegen
  Dritte durchgeführt; SSH übernimmt den Host-Schlüssel beim ersten Verbinden.

Hinweise
--------
- Lokale Administrator-Konten auf NICHT in eine Domäne eingebundenen Windows-Zielen können durch die
  Benutzerkontensteuerung über das Netz eingeschränkt sein. In einer Domäne mit Domänen-Admin
  tritt das nicht auf.
- Home Assistant: aus der Ferne wird nichts eingerichtet. Die Ansicht „Geräte verbinden“ zeigt die
  Anleitung; Sie kopieren die Integration „mc4y_cmdb“ einmal in das Konfigurationsverzeichnis von Home
  Assistant und fügen sie dort hinzu. Die vollständige Anleitung (Probleme, Aktualisieren, Entfernen)
  liegt als LIESMICH.txt im Paket „mc4y-cmdb-homeassistant“.
- Entfernen eines Agenten/Crawlers: auf dem Ziel im Ordner des Programms „deinstallieren.ps1“ (Windows)
  bzw. das Deinstallationsskript (Linux/macOS) ausführen (siehe Paket „mc4y-erkennung“), oder in der
  Suite unter Erkennung den Teilnehmer entfernen.

Lizenz: GPL-3.0-or-later – Peter Hoenig, MY COACHING FOR YOU (https://www.my-coaching4you.de)


================================================================================
MC4Y CMDB deployer – roll out agents and crawlers to several devices (English)
================================================================================

Purpose
-------
The deployer installs the CMDB agent (or crawler) on several devices at once, from your workstation,
without logging on to each machine individually. It reaches Windows computers via WinRM and Linux,
Raspberry Pi and macOS devices via SSH. Home Assistant is NOT set up remotely: there you install the
integration once on the device itself – the "Connect devices" view shows a step-by-step guide and the
download for it (package "mc4y-cmdb-homeassistant").

Requirements
------------
- A Windows workstation (Windows 10/11 or Server) that can reach the targets.
- For Windows targets: an administrator account allowed to log on to the target computers (in a domain
  usually the domain admin account) and WinRM enabled on the targets. In a domain WinRM is usually
  already on; otherwise run once on the target in an admin PowerShell:  winrm quickconfig
- For Linux, Raspberry Pi and macOS targets: the OpenSSH client on your workstation (ssh/scp – can be
  added via Windows "Optional features"), SSH access (preferably by key), and on the targets python3 and
  root rights for the install (log on as root, set up NOPASSWD sudo, or enter a sudo password in the form
  – it stays in memory only).
- The file "verteiler.json" next to this program (it holds your suite's address). Get it from the suite:
  Administration › CMDB › Discovery › "Connect devices" › button "Setup file (verteiler.json)". Put it
  into this folder.

Step by step
------------
1. Fully extract this ZIP (keep the "windows" and "python" folders next to the program).
2. Put "verteiler.json" (from the suite) next to it.
3. Double-click "Verteiler-starten.bat". A window opens; please leave it open.
4. The browser opens the "Connect devices" view in your suite – now connected.
5. There: pick agent or crawler, pick the target operating system (Windows, Linux/Raspberry Pi, macOS or
   Home Assistant), enter the computers (one per line: name, FQDN or IP), enter the account (for Windows
   with password, for SSH the user and optionally a key/sudo password), "Check connection" and then
   "Roll out". For "Home Assistant" the step-by-step guide with download appears instead of the form.
6. You see the progress per device. Finished devices appear in the CMDB after their next heartbeat.

Security and privacy
--------------------
- The program runs only on your computer and is not reachable from outside (127.0.0.1 only, protected by
  a random key).
- Passwords are NOT stored: they stay in memory and are used only for the current rollout – never written
  to disk or a command line.
- The rollout only transfers the installer files and sets up the scheduled task (Windows) or the service
  (Linux/macOS) on the target. No attacks or logon attempts against third parties are performed; SSH
  trusts the host key on first connect.

Notes
-----
- Local administrator accounts on Windows targets that are NOT joined to a domain can be restricted over
  the network by User Account Control. In a domain with a domain admin this does not happen.
- Home Assistant: nothing is set up remotely. The "Connect devices" view shows the guide; you copy the
  "mc4y_cmdb" integration once into the Home Assistant configuration directory and add it there. The full
  guide (problems, updating, removing) is in the LIESMICH.txt / README.txt of the "mc4y-cmdb-homeassistant"
  package.
- Removing an agent/crawler: run "deinstallieren.ps1" (Windows) or the uninstall script (Linux/macOS) in
  the program's folder on the target (see package "mc4y-erkennung"), or remove the participant under
  Discovery in the suite.

License: GPL-3.0-or-later – Peter Hoenig, MY COACHING FOR YOU (https://www.my-coaching4you.de)
