Michael
19. Oktober 2026 um 08:05
1
Hallo.
Ich habe heute auf einem v7.3 Server den Befehl
linuxmuster-import-devices laufen lassen, der auch fehlerfrei durchgelaufen ist. Am Ende wurde wie gewohnt gemeldet:
------------------------------------------------------------------------------
#### Finally restarting dhcp service. ####
------------------------------------------------------------------------------
#### linuxmuster-import-devices finished at 2026-10-19 09:56:40 ####
------------------------------------------------------------------------------
Als ich einen ping auf den neu eingetragenen Host ausprobiert habe, wurde jedoch jedes Mal "No address associated with hostname" gemeldet, was mich natürlich stutzig werden ließ.
Daraufhin habe ich es mit sophomorix-device --dry-run versucht und siehe da:
LINE: fachraum;fr-pc529-notebook;win10;54:EF:71:0E:27:B2;10.30.51.3;---;---;;faculty-teachercomputer;---;0;;;;MIGRATION;;
ERROR: MAC >54:EF:71:0E:27:B2< is double in devices.csv!
Leider bricht der linuxmuster-import-devices Durchlauf also offenbar trotz des Fehlers nicht ab oder gibt eine Warnung aus. Das sollte so nicht sein, oder?
Hier laufen folgende Versionen (v7.3):
███ ███ linuxmuster.net packages:
█████ █████ -Base...........: 7.3.42-0
███ ███ -Linbo..........: 4.3.39-0
███ ███ -WebUI..........: 7.3.46
█████ █████ -Sophomorix.....: 7.3.16
Viele Grüße,
Michael
Arnaud
19. Oktober 2026 um 19:56
2
Hallo Michael,
Wir sind gerade dabei dieses Verhalten zu verbessern, aber in die 7.4:
7.4 ← feat/import-devices-lmntools-check
ouvert 10:43AM - 11 Oct 26 UTC
## Check devices.csv with linuxmuster-tools instead of `sophomorix-device --dry-… run`
When `sophomorix-device --dry-run` fails, `linuxmuster-import-devices` only says that it failed: the reason is in the log, and the check stops at the first problem. An admin with several mistakes in `devices.csv` has to run the import once per mistake.
This PR replaces the dry-run gate with `check_all_schools()` from linuxmuster-tools 7.4.19, which validates the `devices.csv` of every school at once and reports **every** problem with its file and line, on the console and in the log:
```
❌ hostname.too_long pc0123456789 (school2.devices.csv:12)
❌ mac.duplicate AA:BB:CC:DD:EE:01 (devices.csv:3,8)
⚠️ ip.multischool 10.0.0.1 (devices.csv:1, school2.devices.csv:1)
```
Each code is documented in the [devices README of linuxmuster-tools](https://github.com/linuxmuster/linuxmuster-tools/blob/lmn74/usr/lib/python3/dist-packages/linuxmusterTools/devices/README.md#rules).
### What changes
- `checkDevices()` runs before the sync and exits with status 1 if an error is found. Warnings are printed but do not stop the import.
- If linuxmuster-tools can not be loaded, the import stops with a readable message instead of falling back to sophomorix.
- `runSophomorixDeviceSync()` now only runs `sophomorix-device --sync`, unchanged otherwise.
- `debian/control`: new dependency `linuxmuster-tools7 (>= 7.4.19)`. It was already pulled in through linuxmuster-webui7.
### Differences with `sophomorix-device --dry-run`
| Check | `--dry-run` | This PR |
|---|---|---|
| Reporting | Stops at the first problem | Lists all problems, with file and line |
| Hostname longer than 15 characters (`<school>-<hostname>`), for roles getting a machine account | Not checked | Error ([AD naming rules](https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/naming-conventions-for-computer-domain-site-ou)) |
| Hostname made of digits only, starting with a non-alphanumeric character, ending with `-` | Not checked | Error |
| Same hostname twice | Not blocking | Error |
| Empty LINBO group | Accepted | Error |
| Same IP in two schools | Error at sync time | Warning only (see below) |
| Comparison with the AD | Yes | No, the files only |
Because of the new rules, **this check can block an import that passes today**. To be discussed: the 15 characters limit and the duplicate hostname in particular.
### Known limitation: same IP in two schools
The check lets an IP shared between two schools through, as a warning: a fileserver legitimately carries the same address in each school. But `sophomorix-device --sync` still stops on it, because `%ip_seen` (`sophomorix-device` line 125) is never cleared between the files of the schools (line 1937). Such an import would print "devices.csv check OK" and then fail at the sync. This has to be fixed in sophomorix.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Gruß
Arnaud