fix(exporter): dedup NICs by normalized MAC, fix garbage redis serial fallback

MAC-format mismatches between collector sources (dash vs colon separators)
were preventing duplicate NIC/PCIe entries from merging in the canonical
device dedup pass. Add MAC address normalization and merge devices that
share a normalized MAC before the existing serial/BDF-based dedup runs.

Also fix a bug in the Inspur redis-dump serial fallback parser: when a
field's inline value was the placeholder "N/A", the code incorrectly fell
through to a window-scan fallback that could pick up an unrelated adjacent
Redis key name (e.g. "AssetInfoPCIEMMIOSpace") as a fake serial number.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-08-13 18:09:49 +03:00
co-authored by Claude Sonnet 5
parent 399eca5f49
commit 93f0897b81
2 changed files with 157 additions and 4 deletions
+5 -2
View File
@@ -212,8 +212,11 @@ func extractRedisInlineValue(content []byte, start int) string {
}
func extractRedisCandidateValue(content []byte, start int) string {
// Fast-path for simple inline string values.
if v := extractRedisInlineValue(content, start); normalizeRedisValue(v) != "" {
// Fast-path for simple inline string values. A cleanly-read inline value is
// authoritative even when it normalizes to a placeholder like "N/A" —
// falling through to the window scan below in that case would risk
// mistaking an unrelated adjacent Redis key name for the real value.
if v := extractRedisInlineValue(content, start); v != "" {
return v
}