1 Commits
Author SHA1 Message Date
MrBlakeandClaude Opus 5.5 8dd9028db3 fix: unique memory slot names (DeviceLocator) instead of repeating bank labels
Build Windows agent / build (win-arm64) (push) Waiting to run
Build Windows agent / build (win-x64) (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 10:18:21 +01:00
4 changed files with 11 additions and 4 deletions

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<AssemblyName>agent</AssemblyName>
<RootNamespace>NetBoxWindowsAgent</RootNamespace>
<Version>0.2.1</Version>
<Version>0.2.2</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Management" Version="8.0.0" />
+1 -1
View File
@@ -340,7 +340,7 @@ Path: C:\Program Files\NetBox Windows Agent
File or folder: agent.exe
Detection method: String (version)
Operator: Greater than or equal to
Value: 0.2.1 (the version of agent.exe, see agent.exe --version)
Value: 0.2.2 (the version of agent.exe, see agent.exe --version)
Associated with a 32-bit app on 64-bit clients: No
```
+8 -1
View File
@@ -24,7 +24,7 @@ internal static class HardwareCollector
Strings(x, "IPAddress").Where(ip => !ip.StartsWith("169.254.")).ToList())).ToList();
var memoryModules = Query("Win32_PhysicalMemory", "BankLabel", "DeviceLocator", "Manufacturer", "PartNumber", "SerialNumber", "Capacity")
.Select(x => new MemoryInfo(
string.IsNullOrWhiteSpace(S(x, "BankLabel")) ? S(x, "DeviceLocator") : S(x, "BankLabel"),
MemorySlot(S(x, "DeviceLocator"), S(x, "BankLabel")),
S(x, "Manufacturer"), S(x, "PartNumber"), S(x, "SerialNumber"), U(x, "Capacity"))).ToList();
return new HardwareInfo
@@ -118,6 +118,13 @@ internal static class HardwareCollector
using var searcher = new ManagementObjectSearcher($"SELECT {string.Join(',', fields)} FROM {cls}");
foreach (ManagementBaseObject item in searcher.Get()) yield return item;
}
// BankLabel repeats per channel on many boards ("BANK 0" for channel A and B);
// DeviceLocator ("ChannelA-DIMM0") is the unique slot name.
private static string MemorySlot(string locator, string bank) =>
string.IsNullOrWhiteSpace(locator) ? bank
: string.IsNullOrWhiteSpace(bank) || locator.Contains(bank, StringComparison.OrdinalIgnoreCase) ? locator
: $"{locator} ({bank})";
private static string S(ManagementBaseObject x, string key) => Convert.ToString(x[key])?.Trim() ?? "";
private static ulong U(ManagementBaseObject x, string key) => ulong.TryParse(Convert.ToString(x[key]), out var n) ? n : 0;
private static List<string> Strings(ManagementBaseObject x, string key) =>
+1 -1
View File
@@ -4,7 +4,7 @@ namespace NetBoxWindowsAgent;
internal static class AgentInfo
{
public const string Version = "0.2.1";
public const string Version = "0.2.2";
public const int Protocol = 1;
}