diff --git a/insight.sln b/insight.sln
index c6e0266..4d81ecd 100644
--- a/insight.sln
+++ b/insight.sln
@@ -31,12 +31,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Insight.Server", "src\Serve
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Insight.Updater", "src\Updater\Insight.Updater\Insight.Updater.csproj", "{4875D70F-A96B-4EBA-99BE-218886D29BEB}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Insight.Web.Assets", "src\Web\Insight.Web.Assets\Insight.Web.Assets.csproj", "{EBB8A2A8-453B-4867-A8E2-072530391DD0}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Insight.Agent", "src\Agent\Insight.Agent\Insight.Agent.csproj", "{2A391CA2-F96B-4DB7-80AA-0668A5141640}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Insight.Agent.Assets", "src\Agent\Insight.Agent.Assets\Insight.Agent.Assets.csproj", "{4C2B66EA-4EE1-47BF-BAEE-DDBAF6FCB324}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -71,18 +67,10 @@ Global
{4875D70F-A96B-4EBA-99BE-218886D29BEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4875D70F-A96B-4EBA-99BE-218886D29BEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4875D70F-A96B-4EBA-99BE-218886D29BEB}.Release|Any CPU.Build.0 = Release|Any CPU
- {EBB8A2A8-453B-4867-A8E2-072530391DD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EBB8A2A8-453B-4867-A8E2-072530391DD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EBB8A2A8-453B-4867-A8E2-072530391DD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EBB8A2A8-453B-4867-A8E2-072530391DD0}.Release|Any CPU.Build.0 = Release|Any CPU
{2A391CA2-F96B-4DB7-80AA-0668A5141640}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A391CA2-F96B-4DB7-80AA-0668A5141640}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A391CA2-F96B-4DB7-80AA-0668A5141640}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A391CA2-F96B-4DB7-80AA-0668A5141640}.Release|Any CPU.Build.0 = Release|Any CPU
- {4C2B66EA-4EE1-47BF-BAEE-DDBAF6FCB324}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4C2B66EA-4EE1-47BF-BAEE-DDBAF6FCB324}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4C2B66EA-4EE1-47BF-BAEE-DDBAF6FCB324}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4C2B66EA-4EE1-47BF-BAEE-DDBAF6FCB324}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -95,9 +83,7 @@ Global
{EF3188D7-338D-43DA-BF6B-D26E5BDAC3A6} = {35BA5DCB-BECC-4F51-8DD0-694C555D205A}
{1E75F7E9-E6AA-44E7-A2F3-DB4CA85E0118} = {038C3821-E554-496D-B585-A3BC193B7913}
{4875D70F-A96B-4EBA-99BE-218886D29BEB} = {F2D241DB-7692-46DB-8A6A-958B365DAAF8}
- {EBB8A2A8-453B-4867-A8E2-072530391DD0} = {3F000016-069D-477E-ACA3-F643880B57E8}
{2A391CA2-F96B-4DB7-80AA-0668A5141640} = {140F73DD-29D3-4C44-809B-5B470880AA0D}
- {4C2B66EA-4EE1-47BF-BAEE-DDBAF6FCB324} = {140F73DD-29D3-4C44-809B-5B470880AA0D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F376A326-7590-4E7E-AB9B-76CED8527AB0}
diff --git a/src/Agent/Insight.Agent.Assets/Enums/CategoryEnum.cs b/src/Agent/Insight.Agent.Assets/Enums/CategoryEnum.cs
deleted file mode 100644
index 5ba8cb9..0000000
--- a/src/Agent/Insight.Agent.Assets/Enums/CategoryEnum.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace Insight.Agent.Enums
-{
- public enum CategoryEnum
- {
- Network = 1,
- System = 2,
- Application = 3,
- Security = 4,
- Monitoring = 5,
- Task = 6,
- Printer = 7,
- RDP = 8
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Enums/DispatchEnum.cs b/src/Agent/Insight.Agent.Assets/Enums/DispatchEnum.cs
deleted file mode 100644
index 2d824d4..0000000
--- a/src/Agent/Insight.Agent.Assets/Enums/DispatchEnum.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Insight.Agent.Enums
-{
- public enum DispatchEnum
- {
- Pending = 1,
- Failure = 2,
- Success = 3,
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Enums/StatusEnum.cs b/src/Agent/Insight.Agent.Assets/Enums/StatusEnum.cs
deleted file mode 100644
index 49b8e7d..0000000
--- a/src/Agent/Insight.Agent.Assets/Enums/StatusEnum.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Insight.Agent.Enums
-{
- public enum StatusEnum
- {
- Information = 1,
- Warning = 2,
- Error = 3
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Insight.Agent.Assets.csproj b/src/Agent/Insight.Agent.Assets/Insight.Agent.Assets.csproj
deleted file mode 100644
index 540ca66..0000000
--- a/src/Agent/Insight.Agent.Assets/Insight.Agent.Assets.csproj
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
- net7.0
- true
- enable
- Insight.Agent.Assets
- Insight.Agent
- Insight
- 2023.9.14.0
-
-
-
- none
-
-
-
- none
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Agent/Insight.Agent.Assets/Interfaces/IAgentMessageHandler.cs b/src/Agent/Insight.Agent.Assets/Interfaces/IAgentMessageHandler.cs
deleted file mode 100644
index a9e69a6..0000000
--- a/src/Agent/Insight.Agent.Assets/Interfaces/IAgentMessageHandler.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using Insight.Agent.Messages;
-
-namespace Insight.Agent.Interfaces
-{
- public partial interface IAgentMessageHandler
- {
- ValueTask HandleAsync(TSender sender, TMessage message, CancellationToken cancellationToken) where TMessage : IAgentMessage;
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Application/Application.cs b/src/Agent/Insight.Agent.Assets/Messages/Application/Application.cs
deleted file mode 100644
index ba3ad5c..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Application/Application.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using MemoryPack;
-using System.Runtime.InteropServices;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(120, typeof(Application))]
- [MemoryPackUnion(121, typeof(ApplicationList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Application : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Publisher { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Version { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Location { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Source { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Uninstall { get; set; }
-
- [MemoryPackOrder(6)]
- public DateTime? InstallDate { get; set; }
-
- [MemoryPackOrder(7)]
- public Architecture? Architecture { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class ApplicationList : List, IAgentMessage { }
-
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Authentication/Authentication.cs b/src/Agent/Insight.Agent.Assets/Messages/Authentication/Authentication.cs
deleted file mode 100644
index 84406f4..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Authentication/Authentication.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(1, typeof(Authentication))]
- [MemoryPackUnion(2, typeof(AuthenticationRequest))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Authentication : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public PlatformType? Platform { get; set; }
-
- [MemoryPackOrder(1)]
- public Guid Serial { get; set; }
-
- [MemoryPackOrder(2)]
- public Version? Version { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Hostname { get; set; }
-
- public enum PlatformType
- {
- Unknown = 0,
- Windows = 1,
- Unix = 2
- }
- }
-
- [MemoryPackable]
- public partial class AuthenticationRequest : IAgentMessage { }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Commands/Commands.cs b/src/Agent/Insight.Agent.Assets/Messages/Commands/Commands.cs
deleted file mode 100644
index b231232..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Commands/Commands.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(2000, typeof(GetInventory))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class GetInventory : IAgentMessage { }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Console/ConsoleQuery.cs b/src/Agent/Insight.Agent.Assets/Messages/Console/ConsoleQuery.cs
deleted file mode 100644
index 369304c..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Console/ConsoleQuery.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(1000, typeof(ConsoleQuery))]
- [MemoryPackUnion(1001, typeof(ConsoleQueryRequest))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class ConsoleQuery : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Id { get; set; }
-
- [MemoryPackOrder(1)]
- public string? HostId { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Query { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Data { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Errors { get; set; }
-
- [MemoryPackOrder(5)]
- public bool IsString { get; set; }
-
- [MemoryPackOrder(6)]
- public bool IsArray { get; set; }
-
- [MemoryPackOrder(7)]
- public bool HadErrors { get; set; }
- }
-
- [MemoryPackable]
- public partial class ConsoleQueryRequest : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Id { get; set; }
-
- [MemoryPackOrder(1)]
- public string? HostId { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Query { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Drive/Drive.cs b/src/Agent/Insight.Agent.Assets/Messages/Drive/Drive.cs
deleted file mode 100644
index 5a2f966..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Drive/Drive.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(50, typeof(Drive))]
- [MemoryPackUnion(51, typeof(DriveList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Drive : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public uint? Index { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Id { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Manufacturer { get; set; }
-
- [MemoryPackOrder(4)]
- public string? SerialNumber { get; set; }
-
- [MemoryPackOrder(5)]
- public ulong? Size { get; set; }
-
- [MemoryPackOrder(6)]
- public string? Status { get; set; }
-
- [MemoryPackOrder(7)]
- public string? InterfaceType { get; set; }
-
- [MemoryPackOrder(8)]
- public string? FirmwareRevision { get; set; }
-
- [MemoryPackOrder(9)]
- public string? PNPDeviceID { get; set; }
-
- [MemoryPackOrder(10)]
- public List? Volumes { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class DriveList : List, IAgentMessage { }
-
- [MemoryPackable]
- public partial class Volume : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public uint? Index { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Id { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(3)]
- public string? SerialNumber { get; set; }
-
- [MemoryPackOrder(4)]
- public ulong? Size { get; set; }
-
- [MemoryPackOrder(5)]
- public ulong? FreeSpace { get; set; }
-
- [MemoryPackOrder(6)]
- public string? Type { get; set; }
-
- [MemoryPackOrder(7)]
- public string? FileSystem { get; set; }
-
- [MemoryPackOrder(8)]
- public bool? Compressed { get; set; }
-
- [MemoryPackOrder(9)]
- public bool? Bootable { get; set; }
-
- [MemoryPackOrder(10)]
- public bool? PrimaryPartition { get; set; }
-
- [MemoryPackOrder(11)]
- public bool? BootPartition { get; set; }
-
- [MemoryPackOrder(12)]
- public ulong? BlockSize { get; set; }
-
- [MemoryPackOrder(13)]
- public ulong? NumberOfBlocks { get; set; }
-
- [MemoryPackOrder(14)]
- public ulong? StartingOffset { get; set; }
-
- [MemoryPackOrder(15)]
- public DriveType? DriveType { get; set; }
-
- [MemoryPackOrder(16)]
- public string? ProviderName { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Event/Event.cs b/src/Agent/Insight.Agent.Assets/Messages/Event/Event.cs
deleted file mode 100644
index edd3b61..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Event/Event.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(10, typeof(Event))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Event : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public DateTime? Timestamp { get; set; }
-
- [MemoryPackOrder(1)]
- public StatusType? Status { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Source { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Category { get; set; }
-
- [MemoryPackOrder(4)]
- public int? EventId { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Task { get; set; }
-
- [MemoryPackOrder(6)]
- public string? Message { get; set; }
-
- public enum StatusType
- {
- Unknown = 0,
- Information = 1,
- Warning = 2,
- Error = 3,
- Critical = 4
- }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/IAgentMessage.cs b/src/Agent/Insight.Agent.Assets/Messages/IAgentMessage.cs
deleted file mode 100644
index 3c3edf0..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/IAgentMessage.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackable]
- public partial interface IAgentMessage { }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Interface/Interface.cs b/src/Agent/Insight.Agent.Assets/Messages/Interface/Interface.cs
deleted file mode 100644
index 1c008c5..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Interface/Interface.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-using MemoryPack;
-using System.Net;
-using System.Net.NetworkInformation;
-using System.Net.Sockets;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(70, typeof(Interface))]
- [MemoryPackUnion(71, typeof(InterfaceList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Interface : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public uint? Index { get; set; }
-
- [MemoryPackOrder(1)]
- public Guid? Guid { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Mac { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Description { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Manufacturer { get; set; }
-
- [MemoryPackOrder(6)]
- public string? Suffix { get; set; }
-
- [MemoryPackOrder(7)]
- public bool? Physical { get; set; }
-
- [MemoryPackOrder(8)]
- public NetworkInterfaceType? Type { get; set; }
-
- [MemoryPackOrder(9)]
- public OperationalStatus? Status { get; set; }
-
- [MemoryPackOrder(10)]
- public long? Speed { get; set; }
-
- [MemoryPackOrder(11)]
- public long? Ipv4Mtu { get; set; }
-
- [MemoryPackOrder(12)]
- public bool? Ipv4Dhcp { get; set; }
-
- [MemoryPackOrder(13)]
- public bool? Ipv4Forwarding { get; set; }
-
- [MemoryPackOrder(14)]
- public long? Ipv6Mtu { get; set; }
-
- [MemoryPackOrder(15)]
- public long? Sent { get; set; }
-
- [MemoryPackOrder(16)]
- public long? Received { get; set; }
-
- [MemoryPackOrder(17)]
- public long? IncomingPacketsDiscarded { get; set; }
-
- [MemoryPackOrder(18)]
- public long? IncomingPacketsWithErrors { get; set; }
-
- [MemoryPackOrder(19)]
- public long? IncomingUnknownProtocolPackets { get; set; }
-
- [MemoryPackOrder(20)]
- public long? OutgoingPacketsDiscarded { get; set; }
-
- [MemoryPackOrder(21)]
- public long? OutgoingPacketsWithErrors { get; set; }
-
- [MemoryPackOrder(22)]
- public List? Addresses { get; set; }
-
- [MemoryPackOrder(23)]
- public List? Gateways { get; set; }
-
- [MemoryPackOrder(24)]
- public List? Dns { get; set; }
-
- [MemoryPackOrder(25)]
- public List? Dhcp { get; set; }
-
- [MemoryPackOrder(26)]
- public List? Routes { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class InterfaceList : List, IAgentMessage { }
-
- [MemoryPackable]
- public partial class Unicast : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public IPAddress2? IpAddress { get; set; }
-
- [MemoryPackOrder(1)]
- public IPAddress2? Ipv4Mask { get; set; }
-
- [MemoryPackOrder(2)]
- public long? AddressPreferredLifetime { get; set; }
-
- [MemoryPackOrder(3)]
- public long? AddressValidLifetime { get; set; }
-
- [MemoryPackOrder(4)]
- public long? DhcpLeaseLifetime { get; set; }
-
- [MemoryPackOrder(5)]
- public DuplicateAddressDetectionState? DuplicateAddressDetectionState { get; set; }
-
- [MemoryPackOrder(6)]
- public int? PrefixLength { get; set; }
-
- [MemoryPackOrder(7)]
- public PrefixOrigin? PrefixOrigin { get; set; }
-
- [MemoryPackOrder(8)]
- public SuffixOrigin? SuffixOrigin { get; set; }
- }
-
- [MemoryPackable]
- public partial class Route : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public uint? InterfaceIndex { get; set; }
-
- [MemoryPackOrder(1)]
- public IPAddress2? Destination { get; set; }
-
- [MemoryPackOrder(2)]
- public IPAddress2? Gateway { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Mask { get; set; }
-
- [MemoryPackOrder(4)]
- public int? Metric { get; set; }
- }
-
- [MemoryPackable]
- public partial class IPAddress2 : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public AddressFamily? AddressFamily { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Address { get; set; }
-
- [MemoryPackOrder(2)]
- public bool? IsIPv6Teredo { get; set; }
-
- [MemoryPackOrder(3)]
- public bool? IsIPv6SiteLocal { get; set; }
-
- [MemoryPackOrder(4)]
- public bool? IsIPv6Multicast { get; set; }
-
- [MemoryPackOrder(5)]
- public bool? IsIPv6LinkLocal { get; set; }
-
- [MemoryPackOrder(6)]
- public bool? IsIPv4MappedToIPv6 { get; set; }
-
- [MemoryPackOrder(7)]
- public bool? IsIPv6UniqueLocal { get; set; }
-
- [MemoryPackConstructor]
- public IPAddress2()
- {
-
- }
-
- public IPAddress2(IPAddress address)
- {
- AddressFamily = address.AddressFamily;
- Address = address.ToString();
- IsIPv4MappedToIPv6 = address.IsIPv4MappedToIPv6;
- IsIPv6LinkLocal = address.IsIPv6LinkLocal;
- IsIPv6Multicast = address.IsIPv6Multicast;
- IsIPv6SiteLocal = address.IsIPv6SiteLocal;
- IsIPv6Teredo = address.IsIPv6Teredo;
- IsIPv6UniqueLocal = address.IsIPv6UniqueLocal;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Keepalive/Keepalive.cs b/src/Agent/Insight.Agent.Assets/Messages/Keepalive/Keepalive.cs
deleted file mode 100644
index 63588dc..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Keepalive/Keepalive.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(0, typeof(Keepalive))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Keepalive : IAgentMessage { }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Mainboard/Mainboard.cs b/src/Agent/Insight.Agent.Assets/Messages/Mainboard/Mainboard.cs
deleted file mode 100644
index a86bc5b..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Mainboard/Mainboard.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(20, typeof(Mainboard))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Mainboard : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Manufacturer { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Model { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Serial { get; set; }
-
- [MemoryPackOrder(3)]
- public string? BiosManufacturer { get; set; }
-
- [MemoryPackOrder(4)]
- public string? BiosVersion { get; set; }
-
- [MemoryPackOrder(5)]
- public DateTime? BiosDate { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Memory/Memory.cs b/src/Agent/Insight.Agent.Assets/Messages/Memory/Memory.cs
deleted file mode 100644
index bb8e444..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Memory/Memory.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(40, typeof(Memory))]
- [MemoryPackUnion(41, typeof(MemoryList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Memory : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public uint? Index { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Tag { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Location { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Manufacturer { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Model { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Serial { get; set; }
-
- [MemoryPackOrder(6)]
- public ulong? Capacity { get; set; }
-
- [MemoryPackOrder(7)]
- public uint? Speed { get; set; }
-
- [MemoryPackOrder(8)]
- public uint? Voltage { get; set; }
-
- [MemoryPackOrder(9)]
- public uint? ConfiguredSpeed { get; set; }
-
- [MemoryPackOrder(10)]
- public uint? ConfiguredVoltage { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class MemoryList : List, IAgentMessage { }
-
- [MemoryPackable]
- public partial class MemoryMetric : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public DateTime? Timestamp { get; set; }
-
- [MemoryPackOrder(1)]
- public float? MemoryAvailable { get; set; }
-
- [MemoryPackOrder(2)]
- public float? MemoryAvailablePercentage { get; set; }
-
- [MemoryPackOrder(3)]
- public float? MemoryUsed { get; set; }
-
- [MemoryPackOrder(4)]
- public float? MemoryUsagePercentage { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/OperationSystem/OperationSystem.cs b/src/Agent/Insight.Agent.Assets/Messages/OperationSystem/OperationSystem.cs
deleted file mode 100644
index 0fe4ee5..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/OperationSystem/OperationSystem.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using MemoryPack;
-using System.Runtime.InteropServices;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(90, typeof(OperationSystem))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class OperationSystem : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Version { get; set; }
-
- [MemoryPackOrder(2)]
- public string? SerialNumber { get; set; }
-
- [MemoryPackOrder(3)]
- public Architecture? Architecture { get; set; }
-
- [MemoryPackOrder(4)]
- public bool? Virtual { get; set; }
-
- [MemoryPackOrder(5)]
- public DateTime? InstallDate { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Printer/Printer.cs b/src/Agent/Insight.Agent.Assets/Messages/Printer/Printer.cs
deleted file mode 100644
index 0478fc0..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Printer/Printer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(140, typeof(Printer))]
- [MemoryPackUnion(141, typeof(PrinterList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Printer : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Driver { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Port { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Location { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Comment { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class PrinterList : List, IAgentMessage { }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Processor/Processor.cs b/src/Agent/Insight.Agent.Assets/Messages/Processor/Processor.cs
deleted file mode 100644
index edd63af..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Processor/Processor.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(30, typeof(Processor))]
- [MemoryPackUnion(31, typeof(ProcessorList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Processor : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public uint? Index { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Manufacturer { get; set; }
-
- [MemoryPackOrder(3)]
- public string? SerialNumber { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Socket { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Version { get; set; }
-
- [MemoryPackOrder(6)]
- public string? DeviceId { get; set; }
-
- [MemoryPackOrder(7)]
- public uint? Cores { get; set; }
-
- [MemoryPackOrder(8)]
- public uint? LogicalCores { get; set; }
-
- [MemoryPackOrder(9)]
- public uint? CurrentSpeed { get; set; }
-
- [MemoryPackOrder(10)]
- public uint? MaxSpeed { get; set; }
-
- [MemoryPackOrder(11)]
- public uint? L1Size { get; set; }
-
- [MemoryPackOrder(12)]
- public uint? L2Size { get; set; }
-
- [MemoryPackOrder(13)]
- public uint? L3Size { get; set; }
-
- [MemoryPackOrder(14)]
- public bool? Virtualization { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class ProcessorList : List, IAgentMessage { }
-
- [MemoryPackable]
- public partial class ProcessorMetric : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public DateTime? Timestamp { get; set; }
-
- [MemoryPackOrder(1)]
- public float? ProcessorUsagePercentage { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Service/Service.cs b/src/Agent/Insight.Agent.Assets/Messages/Service/Service.cs
deleted file mode 100644
index 61aa86d..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Service/Service.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(130, typeof(Service))]
- [MemoryPackUnion(131, typeof(ServiceList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Service : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public uint? ProcessId { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Display { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Description { get; set; }
-
- [MemoryPackOrder(4)]
- public string? PathName { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Account { get; set; }
-
- [MemoryPackOrder(6)]
- public bool? Delay { get; set; }
-
- [MemoryPackOrder(7)]
- public ServiceStatus? Status { get; set; }
-
- [MemoryPackOrder(8)]
- public ServiceMode? StartMode { get; set; }
-
- public enum ServiceStatus
- {
- Unknown = -1,
- Stopped = 1,
- StartPending = 2,
- StopPending = 3,
- Running = 4,
- ContinuePending = 5,
- PausePending = 6,
- Paused = 7
- }
-
- public enum ServiceMode
- {
- Unknown = -1,
- Boot = 0,
- System = 1,
- Automatic = 2,
- Manual = 3,
- Disabled = 4
- }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class ServiceList : List, IAgentMessage { }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Session/Session.cs b/src/Agent/Insight.Agent.Assets/Messages/Session/Session.cs
deleted file mode 100644
index 625c4ef..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Session/Session.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(110, typeof(Session))]
- [MemoryPackUnion(111, typeof(SessionList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Session : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Sid { get; set; }
-
- [MemoryPackOrder(1)]
- public string? User { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Type { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Status { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Remote { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class SessionList : List, IAgentMessage { }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Status/Status.cs b/src/Agent/Insight.Agent.Assets/Messages/Status/Status.cs
deleted file mode 100644
index de31591..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Status/Status.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(3, typeof(Status))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Status : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public DateTime Timestamp { get; } = DateTime.Now;
-
- [MemoryPackOrder(1)]
- public TimeSpan Uptime { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/StoragePool/StoragePool.cs b/src/Agent/Insight.Agent.Assets/Messages/StoragePool/StoragePool.cs
deleted file mode 100644
index 6148979..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/StoragePool/StoragePool.cs
+++ /dev/null
@@ -1,302 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(160, typeof(StoragePool))]
- [MemoryPackUnion(161, typeof(StoragePoolList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class StoragePool : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? UniqueId { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(2)]
- public string? FriendlyName { get; set; }
-
- [MemoryPackOrder(3)]
- public List? States { get; set; }
-
- [MemoryPackOrder(4)]
- public HealthState? Health { get; set; }
-
- [MemoryPackOrder(5)]
- public RetireMissingPhysicalDisksEnum? RetireMissingPhysicalDisks { get; set; }
-
- [MemoryPackOrder(6)]
- public string? Resiliency { get; set; }
-
- [MemoryPackOrder(7)]
- public bool? IsPrimordial { get; set; }
-
- [MemoryPackOrder(8)]
- public bool? IsReadOnly { get; set; }
-
- [MemoryPackOrder(9)]
- public bool? IsClustered { get; set; }
-
- [MemoryPackOrder(10)]
- public ulong? Size { get; set; }
-
- [MemoryPackOrder(11)]
- public ulong? AllocatedSize { get; set; }
-
- [MemoryPackOrder(12)]
- public ulong? SectorSize { get; set; }
-
- [MemoryPackOrder(13)]
- public List? PhysicalDisks { get; set; }
-
- [MemoryPackOrder(14)]
- public List? VirtualDisks { get; set; }
-
- public enum OperationalState
- {
- Unknown = 0,
- Other = 1,
- OK = 2,
- Degraded = 3,
- Stressed = 4,
- Predictive_Failure = 5,
- Error = 6,
- Non_Recoverable_Error = 7,
- Starting = 8,
- Stopping = 9,
- Stopped = 10,
- In_Service = 11,
- No_Contact = 12,
- Lost_Communication = 13,
- Aborted = 14,
- Dormant = 15,
- Supporting_Entity_In_Error = 16,
- Completed = 17,
- Power_Mode = 18,
- Relocating = 19
- }
-
- public enum HealthState
- {
- Healthy = 0,
- Warning = 1,
- Unhealthy = 2,
- Unknown = 3
- }
-
- public enum RetireMissingPhysicalDisksEnum
- {
- Auto = 1,
- Always = 2,
- Never = 3
- }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class StoragePoolList : List, IAgentMessage { }
-
- [MemoryPackable]
- public partial class PhysicalDisk : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? UniqueId { get; set; }
-
- [MemoryPackOrder(1)]
- public string? DeviceId { get; set; }
-
- [MemoryPackOrder(2)]
- public string? FriendlyName { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Manufacturer { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Model { get; set; }
-
- [MemoryPackOrder(5)]
- public ushort? MediaType { get; set; }
-
- [MemoryPackOrder(6)]
- public ushort? BusType { get; set; }
-
- [MemoryPackOrder(7)]
- public List? States { get; set; }
-
- [MemoryPackOrder(8)]
- public HealthState? Health { get; set; }
-
- [MemoryPackOrder(9)]
- public List? SupportedUsages { get; set; }
-
- [MemoryPackOrder(10)]
- public ushort? Usage { get; set; }
-
- [MemoryPackOrder(11)]
- public string? PhysicalLocation { get; set; }
-
- [MemoryPackOrder(12)]
- public string? SerialNumber { get; set; }
-
- [MemoryPackOrder(13)]
- public string? FirmwareVersion { get; set; }
-
- [MemoryPackOrder(14)]
- public ulong? Size { get; set; }
-
- [MemoryPackOrder(15)]
- public ulong? AllocatedSize { get; set; }
-
- [MemoryPackOrder(16)]
- public ulong? LogicalSectorSize { get; set; }
-
- [MemoryPackOrder(17)]
- public ulong? PhysicalSectorSize { get; set; }
-
- [MemoryPackOrder(18)]
- public ulong? VirtualDiskFootprint { get; set; }
-
- public enum OperationalState
- {
- Unknown = 0,
- Other = 1,
- OK = 2,
- Degraded = 3,
- Stressed = 4,
- Predictive_Failure = 5,
- Error = 6,
- Non_Recoverable_Error = 7,
- Starting = 8,
- Stopping = 9,
- Stopped = 10,
- In_Service = 11,
- No_Contact = 12,
- Lost_Communication = 13,
- Aborted = 14,
- Dormant = 15,
- Supporting_Entity_In_Error = 16,
- Completed = 17,
- Power_Mode = 18,
- Relocating = 19
- }
-
- public enum HealthState
- {
- Healthy = 0,
- Warning = 1,
- Unhealthy = 2,
- Unknown = 3
- }
-
- public enum SupportedUsagesEnum
- {
- Unknown = 0,
- Auto_Select = 1,
- Manual_Select = 2,
- Hot_Spare = 3,
- Retired = 4,
- Journal = 5
- }
- }
-
- [MemoryPackable]
- public partial class VirtualDisk : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? UniqueId { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(2)]
- public string? FriendlyName { get; set; }
-
- [MemoryPackOrder(3)]
- public List? States { get; set; }
-
- [MemoryPackOrder(4)]
- public HealthState? Health { get; set; }
-
- [MemoryPackOrder(5)]
- public AccessTypeEnum? AccessType { get; set; }
-
- [MemoryPackOrder(6)]
- public ProvisioningTypeEnum? ProvisioningType { get; set; }
-
- [MemoryPackOrder(7)]
- public ushort? PhysicalDiskRedundancy { get; set; }
-
- [MemoryPackOrder(8)]
- public string? ResiliencySettingName { get; set; }
-
- [MemoryPackOrder(9)]
- public bool? Deduplication { get; set; }
-
- [MemoryPackOrder(10)]
- public bool? IsSnapshot { get; set; }
-
- [MemoryPackOrder(11)]
- public ulong? Size { get; set; }
-
- [MemoryPackOrder(12)]
- public ulong? AllocatedSize { get; set; }
-
- [MemoryPackOrder(13)]
- public ulong? FootprintOnPool { get; set; }
-
- [MemoryPackOrder(14)]
- public ulong? ReadCacheSize { get; set; }
-
- [MemoryPackOrder(15)]
- public ulong? WriteCacheSize { get; set; }
-
- public enum OperationalState
- {
- Unknown = 0,
- Other = 1,
- OK = 2,
- Degraded = 3,
- Stressed = 4,
- Predictive_Failure = 5,
- Error = 6,
- Non_Recoverable_Error = 7,
- Starting = 8,
- Stopping = 9,
- Stopped = 10,
- In_Service = 11,
- No_Contact = 12,
- Lost_Communication = 13,
- Aborted = 14,
- Dormant = 15,
- Supporting_Entity_In_Error = 16,
- Completed = 17,
- Power_Mode = 18,
- Relocating = 19
- }
-
- public enum HealthState
- {
- Healthy = 0,
- Warning = 1,
- Unhealthy = 2,
- Unknown = 3
- }
-
- public enum AccessTypeEnum
- {
- Unknown = 0,
- Readable = 1,
- Writeable = 2,
- Read_Write = 3,
- Write_Once = 4
- }
-
- public enum ProvisioningTypeEnum
- {
- Unknown = 0,
- Thin = 1,
- Fixed = 2
- }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/SystemInfo/SystemInfo.cs b/src/Agent/Insight.Agent.Assets/Messages/SystemInfo/SystemInfo.cs
deleted file mode 100644
index 8ec0441..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/SystemInfo/SystemInfo.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(80, typeof(SystemInfo))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class SystemInfo : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public DateTime? LastBootUpTime { get; set; }
-
- [MemoryPackOrder(1)]
- public DateTime? LocalDateTime { get; set; }
-
- [MemoryPackOrder(2)]
- public uint? Processes { get; set; }
-
- [MemoryPackOrder(3)]
- public string? License { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Trap/Trap.cs b/src/Agent/Insight.Agent.Assets/Messages/Trap/Trap.cs
deleted file mode 100644
index d0a66db..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Trap/Trap.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(11, typeof(Trap))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Trap : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public DateTime? Timestamp { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Endpoint { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Hostname { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Version { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Community { get; set; }
-
- [MemoryPackOrder(5)]
- public List>? Data { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Update/Update.cs b/src/Agent/Insight.Agent.Assets/Messages/Update/Update.cs
deleted file mode 100644
index ecc84c1..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Update/Update.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(100, typeof(Update))]
- [MemoryPackUnion(101, typeof(UpdateList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Update : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Id { get; set; }
-
- [MemoryPackOrder(1)]
- public DateTime? Date { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Description { get; set; }
-
- [MemoryPackOrder(4)]
- public string? SupportUrl { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Hotfix { get; set; }
-
- // if installed
- [MemoryPackOrder(6)]
- public OsUpdateResultCodeEnum? Result { get; set; }
-
- // if pending
- [MemoryPackOrder(7)]
- public OsUpdateTypeEnum? Type { get; set; }
-
- [MemoryPackOrder(8)]
- public decimal? Size { get; set; }
-
- [MemoryPackOrder(9)]
- public bool? IsDownloaded { get; set; }
-
- [MemoryPackOrder(10)]
- public bool? CanRequestUserInput { get; set; }
-
- [MemoryPackOrder(11)]
- public OsUpdateRebootBehaviorEnum? RebootBehavior { get; set; }
-
- public enum OsUpdateRebootBehaviorEnum
- {
- NeverReboots = 1,
- AlwaysRequiresReboot = 2,
- CanRequestReboot = 3
- }
-
- public enum OsUpdateResultCodeEnum
- {
- NotStarted = 1,
- InProgress = 2,
- Succeeded = 3,
- SucceededWithErrors = 4,
- Failed = 5,
- Aborted = 6
- }
-
- public enum OsUpdateTypeEnum
- {
- Software = 1,
- Driver = 2
- }
- }
-
- [MemoryPackable]
- public partial class UpdateList : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public List? Installed { get; set; }
-
- [MemoryPackOrder(1)]
- public List? Pending { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/User/User.cs b/src/Agent/Insight.Agent.Assets/Messages/User/User.cs
deleted file mode 100644
index 968c4bb..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/User/User.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(150, typeof(User))]
- [MemoryPackUnion(151, typeof(UserList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class User : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Sid { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Domain { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(3)]
- public string? FullName { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Description { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Status { get; set; }
-
- [MemoryPackOrder(6)]
- public bool? LocalAccount { get; set; }
-
- [MemoryPackOrder(7)]
- public bool? Disabled { get; set; }
-
- [MemoryPackOrder(8)]
- public bool? Lockout { get; set; }
-
- [MemoryPackOrder(9)]
- public bool? PasswordChangeable { get; set; }
-
- [MemoryPackOrder(10)]
- public bool? PasswordExpires { get; set; }
-
- [MemoryPackOrder(11)]
- public bool? PasswordRequired { get; set; }
-
- [MemoryPackOrder(12)]
- public List? Groups { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class UserList : List, IAgentMessage { }
-
- [MemoryPackable]
- public partial class Group : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Sid { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Domain { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Description { get; set; }
-
- [MemoryPackOrder(4)]
- public bool? LocalAccount { get; set; }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/Videocard/Videocard.cs b/src/Agent/Insight.Agent.Assets/Messages/Videocard/Videocard.cs
deleted file mode 100644
index 151d441..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/Videocard/Videocard.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(60, typeof(Videocard))]
- [MemoryPackUnion(61, typeof(VideocardList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class Videocard : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? DeviceId { get; set; }
-
- [MemoryPackOrder(1)]
- public string? Model { get; set; }
-
- [MemoryPackOrder(2)]
- public ulong Memory { get; set; }
-
- [MemoryPackOrder(3)]
- public DateTime DriverDate { get; set; }
-
- [MemoryPackOrder(4)]
- public string? DriverVersion { get; set; }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class VideocardList : List, IAgentMessage { }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent.Assets/Messages/VirtualMaschine/VirtualMaschine.cs b/src/Agent/Insight.Agent.Assets/Messages/VirtualMaschine/VirtualMaschine.cs
deleted file mode 100644
index a91dc44..0000000
--- a/src/Agent/Insight.Agent.Assets/Messages/VirtualMaschine/VirtualMaschine.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-using MemoryPack;
-
-namespace Insight.Agent.Messages
-{
- [MemoryPackUnion(170, typeof(VirtualMaschine))]
- [MemoryPackUnion(171, typeof(VirtualMaschineList))]
- public partial interface IAgentMessage { }
-
- [MemoryPackable]
- public partial class VirtualMaschine : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public Guid? Id { get; set; }
-
- [MemoryPackOrder(1)]
- public uint? ProcessId { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Caption { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(4)]
- public string? Notes { get; set; }
-
- [MemoryPackOrder(5)]
- public EnabledEnum? Enabled { get; set; }
-
- [MemoryPackOrder(6)]
- public EnabledDefaultEnum? EnabledDefault { get; set; }
-
- [MemoryPackOrder(7)]
- public HealthStatusEnum? HealthState { get; set; }
-
- [MemoryPackOrder(8)]
- public string? Status { get; set; }
-
- [MemoryPackOrder(9)]
- public ulong? OnTime { get; set; }
-
- [MemoryPackOrder(10)]
- public uint? ReplicationMode { get; set; }
-
- [MemoryPackOrder(11)]
- public ReplicationStateEnum? ReplicationState { get; set; }
-
- [MemoryPackOrder(12)]
- public ReplicationHealthEnum? ReplicationHealth { get; set; }
-
- [MemoryPackOrder(13)]
- public string? ConfigurationVersion { get; set; }
-
- [MemoryPackOrder(14)]
- public IntegrationServicesVersionStateEnum? IntegrationServicesVersionState { get; set; }
-
- [MemoryPackOrder(15)]
- public uint? NumberOfProcessors { get; set; }
-
- [MemoryPackOrder(16)]
- public uint? ProcessorLoad { get; set; }
-
- [MemoryPackOrder(17)]
- public int? MemoryAvailable { get; set; }
-
- [MemoryPackOrder(18)]
- public ulong? MemoryUsage { get; set; }
-
- [MemoryPackOrder(19)]
- public DateTime? InstallDate { get; set; }
-
- [MemoryPackOrder(20)]
- public DateTime? TimeOfLastConfigurationChange { get; set; }
-
- [MemoryPackOrder(21)]
- public DateTime? TimeOfLastStateChange { get; set; }
-
- [MemoryPackOrder(22)]
- public DateTime? LastReplicationTime { get; set; }
-
- [MemoryPackOrder(23)]
- public string? GuestOperatingSystem { get; set; }
-
- [MemoryPackOrder(24)]
- public List? Configurations { get; set; }
-
- public enum EnabledEnum
- {
- Unbekannt = 0,
- Andere = 1,
- Aktiviert = 2,
- Deaktiviert = 3,
- Herunterfahren = 4,
- Nicht_Verfügbar = 5,
- Aktiviert_Offline = 6,
- In_Test = 7,
- Latent = 8,
- Eingeschränkt = 9,
- Wird_gestartet = 10
- }
-
- public enum EnabledDefaultEnum
- {
- Aktiviert = 2,
- Deaktiviert = 3,
- Aktiviert_Offline = 6
- }
-
- public enum HealthStatusEnum
- {
- OK = 5,
- Hauptfehler = 20,
- Kritischer_Fehler = 25
- }
-
- public enum ReplicationStateEnum
- {
- Deaktiviert = 0,
- Bereit = 1,
- Warten_auf_Erstreplikation = 2,
- Replikat = 3,
- Synchronisierte_Replication_abgeschlossen = 4,
- Wiederhergestellt = 5,
- Commit = 6,
- Angehalten = 7,
- Kritisch = 8,
- Warten_auf_die_Neusynchronisierung = 9,
- Resynchronisierung = 10,
- Resynchronisierung_angehalten = 11,
- Failover_in_Bearbeitung = 12,
- Failback_in_Fortschritt = 13,
- Failback_abgeschlossen = 14,
- Datenträgerupdate_in_Bearbeitung = 15,
- Datenträgeraktualisierung_kritisch = 16,
- Unbekannt = 17,
- Repurpose_Replikation_in_Bearbeitung = 18,
- Vorbereitet_für_die_Synchronisierungsreplikation = 19,
- Vorbereitet_für_die_Umgekehrte_Replikation_der_Gruppe = 20,
- Failover_in_Fortschritt = 21
- }
-
- public enum ReplicationHealthEnum
- {
- OK = 1,
- Warnung = 2,
- Kritisch = 3
- }
-
- public enum IntegrationServicesVersionStateEnum
- {
- Unknown = 0,
- UpToDate = 1,
- Mismatch = 2
- }
- }
-
- [MemoryPackable(GenerateType.Collection)]
- public partial class VirtualMaschineList : List, IAgentMessage { }
-
- [MemoryPackable]
- public partial class VirtualMaschineConfiguration : IAgentMessage
- {
- [MemoryPackOrder(0)]
- public string? Id { get; set; }
-
- [MemoryPackOrder(1)]
- public string? ParentId { get; set; }
-
- [MemoryPackOrder(2)]
- public string? Type { get; set; }
-
- [MemoryPackOrder(3)]
- public string? Name { get; set; }
-
- [MemoryPackOrder(4)]
- public DateTime? CreationTime { get; set; }
-
- [MemoryPackOrder(5)]
- public string? Generation { get; set; }
-
- [MemoryPackOrder(6)]
- public string? Architecture { get; set; }
-
- [MemoryPackOrder(7)]
- public AutomaticStartupActionEnum? AutomaticStartupAction { get; set; }
- //public DateTime? AutomaticStartupActionDelay { get; set; }
-
- [MemoryPackOrder(8)]
- public AutomaticShutdownActionEnum? AutomaticShutdownAction { get; set; }
-
- [MemoryPackOrder(9)]
- public AutomaticRecoveryActionEnum? AutomaticRecoveryAction { get; set; }
-
- [MemoryPackOrder(10)]
- public bool? AutomaticSnapshotsEnabled { get; set; }
-
- [MemoryPackOrder(11)]
- public string? BaseBoardSerialNumber { get; set; }
-
- [MemoryPackOrder(12)]
- public string? BIOSGUID { get; set; }
-
- [MemoryPackOrder(13)]
- public string? BIOSSerialNumber { get; set; }
-
- [MemoryPackOrder(14)]
- public ushort[]? BootOrder { get; set; }
-
- [MemoryPackOrder(15)]
- public string? ConfigurationDataRoot { get; set; }
-
- [MemoryPackOrder(16)]
- public string? ConfigurationFile { get; set; }
-
- [MemoryPackOrder(17)]
- public string? GuestStateDataRoot { get; set; }
-
- [MemoryPackOrder(18)]
- public string? GuestStateFile { get; set; }
-
- [MemoryPackOrder(19)]
- public string? SnapshotDataRoot { get; set; }
-
- [MemoryPackOrder(20)]
- public string? SuspendDataRoot { get; set; }
-
- [MemoryPackOrder(21)]
- public string? SwapFileDataRoot { get; set; }
-
- [MemoryPackOrder(22)]
- public bool? SecureBootEnabled { get; set; }
-
- [MemoryPackOrder(23)]
- public bool? IsAutomaticSnapshot { get; set; }
-
- [MemoryPackOrder(24)]
- public string[]? Notes { get; set; }
-
- [MemoryPackOrder(25)]
- public List? Childs { get; set; }
-
- //public string[]? HostResource { get; set; }
-
- public enum AutomaticStartupActionEnum
- {
- Nothing = 2,
- RestartIfLastStateActive = 3,
- Alway = 4
- }
-
- public enum AutomaticShutdownActionEnum
- {
- Ausschalten = 2,
- Speichern = 3,
- Herunterfahren = 4
- }
-
- public enum AutomaticRecoveryActionEnum
- {
- Keine = 2,
- Neustart = 3,
- Rollback = 4
- }
- }
-}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent/Insight.Agent.csproj b/src/Agent/Insight.Agent/Insight.Agent.csproj
index 59ff570..fbcdb18 100644
--- a/src/Agent/Insight.Agent/Insight.Agent.csproj
+++ b/src/Agent/Insight.Agent/Insight.Agent.csproj
@@ -6,7 +6,7 @@
Insight.Agent
Insight
agent
- 2023.9.14.0
+ 2023.9.21.0
enable
enable
@@ -27,10 +27,11 @@
+
-
+
diff --git a/src/Agent/Insight.Agent.Assets/Models/Config.cs b/src/Agent/Insight.Agent/Models/Config.cs
similarity index 100%
rename from src/Agent/Insight.Agent.Assets/Models/Config.cs
rename to src/Agent/Insight.Agent/Models/Config.cs
diff --git a/src/Agent/Insight.Agent/Network/AgentSession.cs b/src/Agent/Insight.Agent/Network/AgentSession.cs
index 84678ea..2fcd017 100644
--- a/src/Agent/Insight.Agent/Network/AgentSession.cs
+++ b/src/Agent/Insight.Agent/Network/AgentSession.cs
@@ -1,57 +1,56 @@
-using Insight.Agent.Interfaces;
-using Insight.Agent.Messages;
+using Insight.Domain.Interfaces;
+using Insight.Domain.Messages;
using Microsoft.Extensions.Logging;
using Vaitr.Network;
-namespace Insight.Agent.Network
+namespace Insight.Agent.Network;
+
+public class AgentSession : TcpSession
{
- public class AgentSession : TcpSession
+ private readonly IEnumerable> _handlers;
+
+ public AgentSession(IEnumerable> handlers, ISerializer serializer, ILogger logger) : base(serializer, logger)
{
- private readonly IEnumerable> _handlers;
+ _handlers = handlers;
+ }
- public AgentSession(IEnumerable> handlers, ISerializer serializer, ILogger logger) : base(serializer, logger)
+ protected override ValueTask OnConnectedAsync(CancellationToken cancellationToken)
+ {
+ _logger.LogInformation("Agent ({ep?}) connected", RemoteEndPoint);
+ return default;
+ }
+
+ protected override ValueTask OnDisconnectedAsync(CancellationToken cancellationToken)
+ {
+ _logger.LogInformation("Agent ({ep?}) disconnected", RemoteEndPoint);
+ return default;
+ }
+
+ protected override ValueTask OnSentAsync(IPacketContext context, CancellationToken cancellationToken)
+ {
+ return base.OnSentAsync(context, cancellationToken);
+ }
+
+ protected override async ValueTask OnReceivedAsync(IPacketContext context, CancellationToken cancellationToken)
+ {
+ await base.OnReceivedAsync(context, cancellationToken);
+
+ foreach (var handler in _handlers)
{
- _handlers = handlers;
- }
-
- protected override ValueTask OnConnectedAsync(CancellationToken cancellationToken)
- {
- _logger.LogInformation("Agent ({ep?}) connected", RemoteEndPoint);
- return default;
- }
-
- protected override ValueTask OnDisconnectedAsync(CancellationToken cancellationToken)
- {
- _logger.LogInformation("Agent ({ep?}) disconnected", RemoteEndPoint);
- return default;
- }
-
- protected override ValueTask OnSentAsync(IPacketContext context, CancellationToken cancellationToken)
- {
- return base.OnSentAsync(context, cancellationToken);
- }
-
- protected override async ValueTask OnReceivedAsync(IPacketContext context, CancellationToken cancellationToken)
- {
- await base.OnReceivedAsync(context, cancellationToken);
-
- foreach (var handler in _handlers)
+ try
{
- try
- {
- await handler.HandleAsync(this, context.Packet, cancellationToken);
- }
- catch (Exception ex)
- {
- _logger.LogWarning("Agent ({ep?}) {ex}", RemoteEndPoint, ex.ToString());
- }
+ await handler.HandleAsync(this, context.Packet, cancellationToken);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogWarning("Agent ({ep?}) {ex}", RemoteEndPoint, ex.ToString());
}
}
+ }
- protected override ValueTask OnHeartbeatAsync(CancellationToken cancellationToken)
- {
- _logger.LogInformation("Agent ({ep?}) Heartbeat", RemoteEndPoint);
- return default;
- }
+ protected override ValueTask OnHeartbeatAsync(CancellationToken cancellationToken)
+ {
+ _logger.LogInformation("Agent ({ep?}) Heartbeat", RemoteEndPoint);
+ return default;
}
}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent/Network/Handlers/AuthenticationHandler.cs b/src/Agent/Insight.Agent/Network/Handlers/AuthenticationHandler.cs
index 4247693..027b0c2 100644
--- a/src/Agent/Insight.Agent/Network/Handlers/AuthenticationHandler.cs
+++ b/src/Agent/Insight.Agent/Network/Handlers/AuthenticationHandler.cs
@@ -1,38 +1,38 @@
-using Insight.Agent.Interfaces;
-using Insight.Agent.Messages;
-using Insight.Agent.Models;
+using Insight.Agent.Models;
using Insight.Agent.Services;
using Insight.Domain.Constants;
+using Insight.Domain.Interfaces;
+using Insight.Domain.Messages;
+using Insight.Domain.Messages.Agent;
-namespace Insight.Agent.Network.Handlers
+namespace Insight.Agent.Network.Handlers;
+
+public class AuthenticationHandler : IMessageHandler
{
- public class AuthenticationHandler : IAgentMessageHandler
+ public async ValueTask HandleAsync(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IMessage
{
- public async ValueTask HandleAsync(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IAgentMessage
+ if (message is AuthenticationRequest)
{
- if (message is AuthenticationRequest)
+ Config? config = null;
+
+ try
{
- Config? config = null;
-
- try
- {
- config = await Configurator.ReadAsync(Configuration.DefaultConfig, cancellationToken).ConfigureAwait(false);
- }
- catch (Exception) { }
-
- if (config is null)
- {
- config = new Config { Serial = Guid.NewGuid() };
- await Configurator.WriteAsync(config, Configuration.DefaultConfig, cancellationToken).ConfigureAwait(false);
- }
-
- await sender.SendAsync(new Authentication
- {
- Serial = config.Serial ?? throw new InvalidDataException(nameof(config.Serial)),
- Version = Configuration.Version,
- Hostname = Configuration.Hostname
- }, cancellationToken);
+ config = await Configurator.ReadAsync(Configuration.DefaultConfig, cancellationToken).ConfigureAwait(false);
}
+ catch (Exception) { }
+
+ if (config is null)
+ {
+ config = new Config { Serial = Guid.NewGuid() };
+ await Configurator.WriteAsync(config, Configuration.DefaultConfig, cancellationToken).ConfigureAwait(false);
+ }
+
+ await sender.SendAsync(new Authentication
+ {
+ Serial = config.Serial ?? throw new InvalidDataException(nameof(config.Serial)),
+ Version = Configuration.Version,
+ Hostname = Configuration.Hostname
+ }, cancellationToken);
}
}
}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent/Network/Handlers/ConsoleHandler.cs b/src/Agent/Insight.Agent/Network/Handlers/ConsoleHandler.cs
index 267bb5d..71097df 100644
--- a/src/Agent/Insight.Agent/Network/Handlers/ConsoleHandler.cs
+++ b/src/Agent/Insight.Agent/Network/Handlers/ConsoleHandler.cs
@@ -1,13 +1,14 @@
-using Insight.Agent.Interfaces;
-using Insight.Agent.Messages;
+using Insight.Domain.Interfaces;
+using Insight.Domain.Messages;
+using Insight.Domain.Messages.Agent;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
namespace Insight.Agent.Network.Handlers;
-public class ConsoleHandler : IAgentMessageHandler
+public class ConsoleHandler : IMessageHandler
{
- public async ValueTask HandleAsync(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IAgentMessage
+ public async ValueTask HandleAsync(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IMessage
{
if (message is ConsoleQueryRequest consoleQueryRequest)
{
diff --git a/src/Agent/Insight.Agent/Network/Handlers/DriveHandler.cs b/src/Agent/Insight.Agent/Network/Handlers/DriveHandler.cs
index 13fafe8..14dba70 100644
--- a/src/Agent/Insight.Agent/Network/Handlers/DriveHandler.cs
+++ b/src/Agent/Insight.Agent/Network/Handlers/DriveHandler.cs
@@ -1,178 +1,178 @@
-using Insight.Agent.Interfaces;
-using Insight.Agent.Messages;
+using Insight.Domain.Interfaces;
+using Insight.Domain.Messages;
+using Insight.Domain.Messages.Agent;
using System.Management;
using System.Runtime.Versioning;
-namespace Insight.Agent.Network.Handlers
+namespace Insight.Agent.Network.Handlers;
+
+[SupportedOSPlatform("windows")]
+public class DriveHandler : IMessageHandler
{
- [SupportedOSPlatform("windows")]
- public class DriveHandler : IAgentMessageHandler
+ public async ValueTask HandleAsync(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IMessage
{
- public async ValueTask HandleAsync(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IAgentMessage
+ if (message is InventoryRequest)
{
- if (message is GetInventory)
- {
- var result = new DriveList();
- result.AddRange(GetDrives());
+ var result = new DriveList();
+ result.AddRange(GetDrives());
- await sender.SendAsync(result, cancellationToken);
- }
- }
-
- private static List GetDrives()
- {
- using var searcher = new ManagementObjectSearcher
- {
- Scope = new ManagementScope(@"root\cimv2"),
- Query = new ObjectQuery("select index, name, caption, model, manufacturer, serialNumber, size, status, interfacetype, firmwarerevision, deviceid, pnpdeviceid from win32_diskdrive")
- };
-
- if (searcher.TryGet(out var collection) is false)
- {
- searcher.Query = new ObjectQuery("select * from win32_diskdrive");
-
- if (searcher.TryGet(out collection) is false) throw new InvalidOperationException("WMI Collection NULL");
- }
-
- var drives = new List();
-
- using (collection)
- {
- foreach (ManagementObject @object in collection.Cast())
- {
- var drive = new Drive();
-
- var properties = @object.GetPropertyHashes();
-
- drive.Index = @object.GetValue(properties, "index");
- drive.Id = @object.GetValue(properties, "deviceid")?.Trim();
- drive.Name = @object.GetValue(properties, "model")?.Trim();
- drive.Manufacturer = @object.GetValue(properties, "manufacturer")?.Trim();
- drive.SerialNumber = @object.GetValue(properties, "serialnumber")?.Trim();
- drive.Size = @object.GetValue(properties, "size");
- drive.Status = @object.GetValue(properties, "status")?.Trim();
- drive.InterfaceType = @object.GetValue(properties, "interfacetype")?.Trim();
- drive.FirmwareRevision = @object.GetValue(properties, "firmwarerevision")?.Trim();
- drive.PNPDeviceID = @object.GetValue(properties, "pnpdeviceid")?.Trim();
- drive.Volumes = new List();
-
- var diskpartition = @object.GetRelated("win32_diskpartition");
- using (diskpartition)
- {
- foreach (ManagementObject dp in diskpartition.Cast())
- {
- var volume = new Volume();
- var dpProperties = dp.GetPropertyHashes();
-
- volume.NumberOfBlocks = dp.GetValue(dpProperties, "numberofblocks");
- volume.BootPartition = dp.GetValue(dpProperties, "bootpartition");
- volume.PrimaryPartition = dp.GetValue(dpProperties, "primarypartition");
- volume.Size = dp.GetValue(dpProperties, "size");
- volume.Index = dp.GetValue(dpProperties, "index");
- volume.Type = dp.GetValue(dpProperties, "type")?.Trim();
- volume.Bootable = dp.GetValue(dpProperties, "bootable");
- volume.BlockSize = dp.GetValue(dpProperties, "blocksize");
- volume.StartingOffset = dp.GetValue(dpProperties, "startingoffset");
-
- var logicaldisk = dp.GetRelated("win32_logicaldisk");
- using (logicaldisk)
- {
- foreach (ManagementObject ld in logicaldisk.Cast())
- {
- var ldProperties = ld.GetPropertyHashes();
-
- volume.Id = ld.GetValue(ldProperties, "deviceid")?.Trim();
- volume.Name = ld.GetValue(ldProperties, "volumename")?.Trim();
- volume.SerialNumber = ld.GetValue(ldProperties, "volumeserialnumber")?.Trim();
- volume.DriveType = (DriveType)ld.GetValue(ldProperties, "drivetype");
- volume.FileSystem = ld.GetValue(ldProperties, "filesystem")?.Trim();
- volume.Compressed = ld.GetValue(ldProperties, "compressed");
- volume.Size = ld.GetValue(ldProperties, "size");
- volume.FreeSpace = ld.GetValue(ldProperties, "freespace");
- volume.ProviderName = ld.GetValue(ldProperties, "providername")?.Trim();
- }
- }
-
- drive.Volumes.Add(volume);
- }
- }
-
- drives.Add(drive);
- }
- }
-
- return drives;
- }
-
- private static List GetVolumes()
- {
- using var searcher = new ManagementObjectSearcher
- {
- Scope = new ManagementScope(@"root\cimv2"),
- Query = new ObjectQuery("select deviceid, volumename, volumeserialnumber, drivetype, filesystem, compressed, size, freeSpace, providername from win32_logicaldisk")
- };
-
- // per device query
- // "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" + driveDeviceId + "'} WHERE AssocClass=Win32_DiskDriveToDiskPartition"
-
- if (searcher.TryGet(out var collection) is false)
- {
- searcher.Query = new ObjectQuery("select * from win32_logicaldisk");
-
- if (searcher.TryGet(out collection) is false) throw new InvalidOperationException("WMI Collection NULL");
- }
-
- var volumes = new List();
-
- using (collection)
- {
- foreach (ManagementObject @object in collection.Cast())
- {
- var volume = new Volume();
-
- var properties = @object.GetPropertyHashes();
-
- //volume.DeviceId = @object.GetValue(properties, "deviceid")?.Trim();
- //volume.VolumeName = @object.GetValue(properties, "volumename")?.Trim();
- //volume.VolumeSerialNumber = @object.GetValue(properties, "volumeserialnumber")?.Trim();
- volume.DriveType = (DriveType)@object.GetValue(properties, "drivetype");
- volume.FileSystem = @object.GetValue(properties, "filesystem")?.Trim();
- volume.Compressed = @object.GetValue(properties, "compressed");
- volume.Size = @object.GetValue(properties, "size");
- volume.FreeSpace = @object.GetValue(properties, "freespace");
- volume.ProviderName = @object.GetValue(properties, "providername")?.Trim();
-
- if (volume.Id is not null)
- {
- searcher.Query = new ObjectQuery("associators of {win32_logicaldisk.deviceid='" + volume.Id + "'} where assocclass=win32_logicaldisktopartition");
-
- if (searcher.TryGet(out var collection2))
- {
- using (collection2)
- {
- foreach (ManagementObject @object2 in collection2)
- {
- var properties2 = @object2.GetPropertyHashes();
-
- volume.Index = @object2.GetValue(properties2, "index");
- //volume.DiskIndex = @object2.GetValue(properties2, "diskindex");
- volume.Type = @object2.GetValue(properties2, "type")?.Trim();
- volume.Bootable = @object2.GetValue(properties2, "bootable");
- volume.PrimaryPartition = @object2.GetValue(properties2, "primarypartition");
- volume.BootPartition = @object2.GetValue(properties2, "bootpartition");
- volume.BlockSize = @object2.GetValue(properties2, "blocksize");
- volume.NumberOfBlocks = @object2.GetValue(properties2, "numberofblocks");
- volume.StartingOffset = @object2.GetValue(properties2, "startingoffset");
- }
- }
- }
- }
-
- volumes.Add(volume);
- }
- }
-
- return volumes;
+ await sender.SendAsync(result, cancellationToken);
}
}
+
+ private static List GetDrives()
+ {
+ using var searcher = new ManagementObjectSearcher
+ {
+ Scope = new ManagementScope(@"root\cimv2"),
+ Query = new ObjectQuery("select index, name, caption, model, manufacturer, serialNumber, size, status, interfacetype, firmwarerevision, deviceid, pnpdeviceid from win32_diskdrive")
+ };
+
+ if (searcher.TryGet(out var collection) is false)
+ {
+ searcher.Query = new ObjectQuery("select * from win32_diskdrive");
+
+ if (searcher.TryGet(out collection) is false) throw new InvalidOperationException("WMI Collection NULL");
+ }
+
+ var drives = new List();
+
+ using (collection)
+ {
+ foreach (ManagementObject @object in collection.Cast())
+ {
+ var drive = new Drive();
+
+ var properties = @object.GetPropertyHashes();
+
+ drive.Index = @object.GetValue(properties, "index");
+ drive.Id = @object.GetValue(properties, "deviceid")?.Trim();
+ drive.Name = @object.GetValue(properties, "model")?.Trim();
+ drive.Manufacturer = @object.GetValue(properties, "manufacturer")?.Trim();
+ drive.SerialNumber = @object.GetValue(properties, "serialnumber")?.Trim();
+ drive.Size = @object.GetValue(properties, "size");
+ drive.Status = @object.GetValue(properties, "status")?.Trim();
+ drive.InterfaceType = @object.GetValue(properties, "interfacetype")?.Trim();
+ drive.FirmwareRevision = @object.GetValue(properties, "firmwarerevision")?.Trim();
+ drive.PNPDeviceID = @object.GetValue(properties, "pnpdeviceid")?.Trim();
+ drive.Volumes = new List();
+
+ var diskpartition = @object.GetRelated("win32_diskpartition");
+ using (diskpartition)
+ {
+ foreach (ManagementObject dp in diskpartition.Cast())
+ {
+ var volume = new Volume();
+ var dpProperties = dp.GetPropertyHashes();
+
+ volume.NumberOfBlocks = dp.GetValue(dpProperties, "numberofblocks");
+ volume.BootPartition = dp.GetValue(dpProperties, "bootpartition");
+ volume.PrimaryPartition = dp.GetValue(dpProperties, "primarypartition");
+ volume.Size = dp.GetValue(dpProperties, "size");
+ volume.Index = dp.GetValue(dpProperties, "index");
+ volume.Type = dp.GetValue(dpProperties, "type")?.Trim();
+ volume.Bootable = dp.GetValue(dpProperties, "bootable");
+ volume.BlockSize = dp.GetValue(dpProperties, "blocksize");
+ volume.StartingOffset = dp.GetValue(dpProperties, "startingoffset");
+
+ var logicaldisk = dp.GetRelated("win32_logicaldisk");
+ using (logicaldisk)
+ {
+ foreach (ManagementObject ld in logicaldisk.Cast())
+ {
+ var ldProperties = ld.GetPropertyHashes();
+
+ volume.Id = ld.GetValue(ldProperties, "deviceid")?.Trim();
+ volume.Name = ld.GetValue(ldProperties, "volumename")?.Trim();
+ volume.SerialNumber = ld.GetValue(ldProperties, "volumeserialnumber")?.Trim();
+ volume.DriveType = (DriveType)ld.GetValue(ldProperties, "drivetype");
+ volume.FileSystem = ld.GetValue(ldProperties, "filesystem")?.Trim();
+ volume.Compressed = ld.GetValue(ldProperties, "compressed");
+ volume.Size = ld.GetValue(ldProperties, "size");
+ volume.FreeSpace = ld.GetValue(ldProperties, "freespace");
+ volume.ProviderName = ld.GetValue(ldProperties, "providername")?.Trim();
+ }
+ }
+
+ drive.Volumes.Add(volume);
+ }
+ }
+
+ drives.Add(drive);
+ }
+ }
+
+ return drives;
+ }
+
+ private static List GetVolumes()
+ {
+ using var searcher = new ManagementObjectSearcher
+ {
+ Scope = new ManagementScope(@"root\cimv2"),
+ Query = new ObjectQuery("select deviceid, volumename, volumeserialnumber, drivetype, filesystem, compressed, size, freeSpace, providername from win32_logicaldisk")
+ };
+
+ // per device query
+ // "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" + driveDeviceId + "'} WHERE AssocClass=Win32_DiskDriveToDiskPartition"
+
+ if (searcher.TryGet(out var collection) is false)
+ {
+ searcher.Query = new ObjectQuery("select * from win32_logicaldisk");
+
+ if (searcher.TryGet(out collection) is false) throw new InvalidOperationException("WMI Collection NULL");
+ }
+
+ var volumes = new List();
+
+ using (collection)
+ {
+ foreach (ManagementObject @object in collection.Cast())
+ {
+ var volume = new Volume();
+
+ var properties = @object.GetPropertyHashes();
+
+ //volume.DeviceId = @object.GetValue(properties, "deviceid")?.Trim();
+ //volume.VolumeName = @object.GetValue(properties, "volumename")?.Trim();
+ //volume.VolumeSerialNumber = @object.GetValue(properties, "volumeserialnumber")?.Trim();
+ volume.DriveType = (DriveType)@object.GetValue(properties, "drivetype");
+ volume.FileSystem = @object.GetValue(properties, "filesystem")?.Trim();
+ volume.Compressed = @object.GetValue(properties, "compressed");
+ volume.Size = @object.GetValue(properties, "size");
+ volume.FreeSpace = @object.GetValue(properties, "freespace");
+ volume.ProviderName = @object.GetValue(properties, "providername")?.Trim();
+
+ if (volume.Id is not null)
+ {
+ searcher.Query = new ObjectQuery("associators of {win32_logicaldisk.deviceid='" + volume.Id + "'} where assocclass=win32_logicaldisktopartition");
+
+ if (searcher.TryGet(out var collection2))
+ {
+ using (collection2)
+ {
+ foreach (ManagementObject @object2 in collection2)
+ {
+ var properties2 = @object2.GetPropertyHashes();
+
+ volume.Index = @object2.GetValue(properties2, "index");
+ //volume.DiskIndex = @object2.GetValue(properties2, "diskindex");
+ volume.Type = @object2.GetValue(properties2, "type")?.Trim();
+ volume.Bootable = @object2.GetValue(properties2, "bootable");
+ volume.PrimaryPartition = @object2.GetValue(properties2, "primarypartition");
+ volume.BootPartition = @object2.GetValue(properties2, "bootpartition");
+ volume.BlockSize = @object2.GetValue(properties2, "blocksize");
+ volume.NumberOfBlocks = @object2.GetValue(properties2, "numberofblocks");
+ volume.StartingOffset = @object2.GetValue(properties2, "startingoffset");
+ }
+ }
+ }
+ }
+
+ volumes.Add(volume);
+ }
+ }
+
+ return volumes;
+ }
}
\ No newline at end of file
diff --git a/src/Agent/Insight.Agent/Network/Handlers/InterfaceHandler.cs b/src/Agent/Insight.Agent/Network/Handlers/InterfaceHandler.cs
index 2d6e294..b910c16 100644
--- a/src/Agent/Insight.Agent/Network/Handlers/InterfaceHandler.cs
+++ b/src/Agent/Insight.Agent/Network/Handlers/InterfaceHandler.cs
@@ -1,274 +1,274 @@
-using Insight.Agent.Interfaces;
-using Insight.Agent.Messages;
+using Insight.Domain.Interfaces;
+using Insight.Domain.Messages;
+using Insight.Domain.Messages.Agent;
using System.Management;
using System.Net;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
-using Route = Insight.Agent.Messages.Route;
+using Route = Insight.Domain.Messages.Agent.Route;
-namespace Insight.Agent.Network.Handlers
+namespace Insight.Agent.Network.Handlers;
+
+[SupportedOSPlatform("windows")]
+public class InterfaceHandler : IMessageHandler
{
- [SupportedOSPlatform("windows")]
- public class InterfaceHandler : IAgentMessageHandler
+ public async ValueTask HandleAsync(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IMessage
{
- public async ValueTask HandleAsync(AgentSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IAgentMessage
+ if (message is InventoryRequest)
{
- if (message is GetInventory)
- {
- var result = new InterfaceList();
- result.AddRange(GetInterfaces());
+ var result = new InterfaceList();
+ result.AddRange(GetInterfaces());
- await sender.SendAsync(result, cancellationToken);
- }
- }
-
- private static List GetInterfaces()
- {
- if (NetworkInterface.GetIsNetworkAvailable() is false) return null;
- if (NetworkInterface.GetAllNetworkInterfaces().Any() is false) return null;
-
- var interfaces = new List();
-
- foreach (var ni in NetworkInterface.GetAllNetworkInterfaces())
- {
- var ipProperties = ni.GetIPProperties();
- var ipStatistics = ni.GetIPStatistics();
-
- var @interface = new Interface
- {
- Mac = ni.GetPhysicalAddress().ToString(),
- Name = ni.Name,
- Description = ni.Description,
- Type = ni.NetworkInterfaceType,
- Speed = ni.Speed,
- Status = ni.OperationalStatus,
- Suffix = ipProperties.DnsSuffix,
- Sent = ipStatistics.BytesSent,
- Received = ipStatistics.BytesReceived,
- IncomingPacketsDiscarded = ipStatistics.IncomingPacketsDiscarded,
- IncomingPacketsWithErrors = ipStatistics.IncomingPacketsWithErrors,
- IncomingUnknownProtocolPackets = ipStatistics.IncomingUnknownProtocolPackets,
- OutgoingPacketsDiscarded = ipStatistics.OutgoingPacketsDiscarded,
- OutgoingPacketsWithErrors = ipStatistics.OutgoingPacketsWithErrors
- };
-
- try
- {
- var propertiesV4 = ipProperties.GetIPv4Properties();
- @interface.Index = uint.Parse(propertiesV4.Index.ToString());
- @interface.Ipv4Mtu = propertiesV4.Mtu;
- @interface.Ipv4Dhcp = propertiesV4.IsDhcpEnabled;
- @interface.Ipv4Forwarding = propertiesV4.IsForwardingEnabled;
- }
- catch (Exception) { }
-
- try
- {
- var propertiesV6 = ipProperties.GetIPv6Properties();
- @interface.Index = uint.Parse(propertiesV6.Index.ToString());
- @interface.Ipv6Mtu = propertiesV6.Mtu;
- }
- catch (Exception) { }
-
- @interface.Gateways = GetAddresses(ipProperties.GatewayAddresses);
- @interface.Addresses = GetAddresses(ipProperties.UnicastAddresses);
- @interface.Dns = GetAddresses(ipProperties.DnsAddresses);
- @interface.Dhcp = GetAddresses(ipProperties.DhcpServerAddresses);
-
- if (@interface.Index.HasValue)
- {
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- using var searcher = new ManagementObjectSearcher
- {
- Scope = new ManagementScope(@"root\cimv2"),
- Query = new ObjectQuery($"select interfaceindex, guid, physicaladapter, manufacturer from win32_networkadapter where interfaceindex = {@interface.Index}")
- };
-
- if (searcher.TryGet(out var collection) is false)
- {
- searcher.Query = new ObjectQuery($"select * from win32_networkadapter where interfaceindex = {@interface.Index}");
-
- if (searcher.TryGet(out collection) is false) throw new InvalidOperationException("WMI Collection NULL");
- }
-
- using (collection)
- {
- foreach (ManagementObject @object in collection)
- {
- var properties = @object.GetPropertyHashes();
-
- @interface.Manufacturer = @object.GetValue(properties, "manufacturer")?.Trim();
- @interface.Guid = @object.GetValue(properties, "guid");
- @interface.Physical = @object.GetValue(properties, "physicaladapter");
-
- break;
- }
- }
-
- @interface.Routes = QueryInterfaceRoutes(@interface.Index.Value);
- }
- }
-
- interfaces.Add(@interface);
- }
-
- return interfaces;
- }
-
- private static List QueryInterfaceRoutes(uint interfaceIndex)
- {
- using var searcher = new ManagementObjectSearcher
- {
- Scope = new ManagementScope(@"root\standardcimv2"),
- Query = new ObjectQuery($"select addressFamily, state, interfaceindex, routemetric, nexthop, destinationprefix from msft_netroute where interfaceindex = {interfaceIndex}")
- };
-
- if (searcher.TryGet(out var collection) is false)
- {
- searcher.Query = new ObjectQuery($"select * from msft_netroute where interfaceindex = {interfaceIndex}");
-
- if (searcher.TryGet(out collection) is false) throw new InvalidOperationException("WMI Collection NULL");
- }
-
- var routes = new List();
-
- using (collection)
- {
- foreach (var @object in collection)
- {
- var route = new Route
- {
- InterfaceIndex = interfaceIndex
- };
-
- var properties = @object.GetPropertyHashes();
-
- if (@object.TryGetValue