feat: add SYNC_SYSTEM_NAMES env var to sync system names with hostname (#1917)

This commit is contained in:
Sven van Ginkel
2026-09-24 23:45:59 +02:00
committed by GitHub
parent b5ef015451
commit 4d10ea2e03
2 changed files with 38 additions and 0 deletions

View File

@@ -279,6 +279,10 @@ func (sys *System) createRecords(data *system.CombinedData) (*core.Record, error
if err := createSystemDetailsRecord(txApp, data.Details, sys.Id); err != nil {
return err
}
// sync display name with hostname if enabled (details are fetched once per agent connection)
if syncNames, _ := utils.GetEnv("SYNC_SYSTEM_NAMES"); syncNames == "true" && data.Details.Hostname != "" {
systemRecord.Set("name", data.Details.Hostname)
}
}
if data.Monitors != nil {