Refactor Citrix virtual session data collection
This commit is contained in:
@@ -1338,6 +1338,79 @@
|
|||||||
</Table>
|
</Table>
|
||||||
</DataCluster>
|
</DataCluster>
|
||||||
<DataCluster Name="citrixMetrics" Origin="Citrix" InformationClass="VirtualSession">
|
<DataCluster Name="citrixMetrics" Origin="Citrix" InformationClass="VirtualSession">
|
||||||
|
<Table Name="citrix-session-details" Type="Static" Key="Id">
|
||||||
|
<Table-Columns>
|
||||||
|
<!-- basic session properties -->
|
||||||
|
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
||||||
|
<Table-Column Name="StartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="EndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="LogOnDuration" Type="int" />
|
||||||
|
<Table-Column Name="ConnectionState" Type="int" Cardinal="64" />
|
||||||
|
<Table-Column Name="EndpointName" Type="string" Cardinal="64" />
|
||||||
|
<Table-Column Name="IsAnonymous" Type="boolean" />
|
||||||
|
|
||||||
|
<!-- machine properties -->
|
||||||
|
<Table-Column Name="Mch_Id" SourceName="Machine.Id" Type="guid" />
|
||||||
|
<Table-Column Name="Mch_Name" SourceName="Machine.Name" Type="string"/>
|
||||||
|
<Table-Column Name="Mch_DnsName" SourceName="Machine.DnsName" Type="string" />
|
||||||
|
<Table-Column Name="Mch_IPAddress" SourceName="Machine.IPAddress" Type="string" />
|
||||||
|
<Table-Column Name="Mch_HostedMachine" SourceName="Machine.HostedMachineId" Type="string" />
|
||||||
|
<Table-Column Name="Mch_IsInMaintenanceMode" SourceName="Machine.IsInMaintenanceMode" Type="boolean" />
|
||||||
|
<Table-Column Name="Mch_AgentVersion" SourceName="Machine.AgentVersion" Type="string" />
|
||||||
|
<Table-Column Name="Mch_CurrentRegistrationState" SourceName="Machine.CurrentRegistrationState" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="Mch_CurrentSessionCount" SourceName="Machine.CurrentSessionCount" Type="int" />
|
||||||
|
<Table-Column Name="Mch_WindowsConnectionSetting" SourceName="Machine.WindowsConnectionSetting" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="Mch_OSType" SourceName="Machine.OSType" Type="string" />
|
||||||
|
<Table-Column Name="Ctl_Name" SourceName="Machine.Catalog.Name" Type="string" Default="0" />
|
||||||
|
<Table-Column Name="Ctl_AllocationType" SourceName="Machine.Catalog.AllocationType" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="DGrp_Name" SourceName="Machine.DesktopGroup.Name" Type="string" />
|
||||||
|
<Table-Column Name="CLI_Cpu" SourceName="Machine.CurrentLoadIndex.Cpu" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="CLI_Memory" SourceName="Machine.CurrentLoadIndex.Memory" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="CLI_Disk" SourceName="Machine.CurrentLoadIndex.Disk" Type="int" Default="0" />
|
||||||
|
|
||||||
|
<!-- user properties -->
|
||||||
|
<Table-Column Name="Usr_Id" SourceName="User.Id" Type="int" />
|
||||||
|
<Table-Column Name="Usr_Name" SourceName="User.UserName" Type="string"/>
|
||||||
|
<Table-Column Name="Usr_FullName" SourceName="User.FullName" Type="string"/>
|
||||||
|
<Table-Column Name="Usr_Domain" SourceName="User.Domain" Type="string"/>
|
||||||
|
|
||||||
|
<!-- connection properties -->
|
||||||
|
<Table-Column Name="Con_Id" SourceName="CurrentConnection.Id" Type="guid" />
|
||||||
|
<Table-Column Name="Con_ClientName" SourceName="CurrentConnection.ClientName" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientAddress" SourceName="CurrentConnection.ClientAddress" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientVersion" SourceName="CurrentConnection.ClientVersion" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientPlatform" SourceName="CurrentConnection.ClientPlatform" Type="string" />
|
||||||
|
<Table-Column Name="Con_ConnectedViaIPAddress" SourceName="CurrentConnection.ConnectedViaIPAddress" Type="string" />
|
||||||
|
<Table-Column Name="Con_LaunchedViaHostName" SourceName="CurrentConnection.LaunchedViaHostName" Type="string" />
|
||||||
|
<Table-Column Name="Con_LogOnStartDate" SourceName="CurrentConnection.LogOnStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnEndDate" SourceName="CurrentConnection.LogOnEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_BrokeringDuration" SourceName="CurrentConnection.BrokeringDuration" Type="int" />
|
||||||
|
<Table-Column Name="Con_VMStartStartDate" SourceName="CurrentConnection.VMStartStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_VMStartEndDate" SourceName="CurrentConnection.VMStartEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_HdxStartDate" SourceName="CurrentConnection.HdxStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_HdxEndDate" SourceName="CurrentConnection.HdxEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AuthenticationDuration" SourceName="CurrentConnection.AuthenticationDuration" Type="int" />
|
||||||
|
<Table-Column Name="Con_GpoStartDate" SourceName="CurrentConnection.GpoStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_GpoEndDate" SourceName="CurrentConnection.GpoEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnScriptsStartDate" SourceName="CurrentConnection.LogOnScriptsStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnScriptsEndDate" SourceName="CurrentConnection.LogOnScriptsEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_ProfileLoadStartDate" SourceName="CurrentConnection.ProfileLoadStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_ProfileLoadEndDate" SourceName="CurrentConnection.ProfileLoadEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_InteractiveStartDate" SourceName="CurrentConnection.InteractiveStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_InteractiveEndDate" SourceName="CurrentConnection.InteractiveEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_UserInitStartDate" SourceName="CurrentConnection.UserInitStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_UserInitEndDate" SourceName="CurrentConnection.UserInitEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxAssociationStartDate" SourceName="CurrentConnection.AppxAssociationStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxAssociationEndDate" SourceName="CurrentConnection.AppxAssociationEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxLoadPackageStartDate" SourceName="CurrentConnection.AppxLoadPackageStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxLoadPackageEndDate" SourceName="CurrentConnection.AppxLoadPackageEndDate" Type="datetime" />
|
||||||
|
|
||||||
|
<!-- additional site infos from configuration-->
|
||||||
|
<Table-Column Name="SiteId" Type="guid" />
|
||||||
|
<Table-Column Name="SiteName" Type="guid" />
|
||||||
|
</Table-Columns>
|
||||||
|
</Table>
|
||||||
|
|
||||||
<Table Name="citrix-session" Type="Static" Key="Id">
|
<Table Name="citrix-session" Type="Static" Key="Id">
|
||||||
<Table-Columns>
|
<Table-Columns>
|
||||||
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
||||||
|
|||||||
@@ -1530,7 +1530,7 @@
|
|||||||
<State-Info Name="User Info" ValueTable="Computation_EmptyConstant" ValueColumn="default">
|
<State-Info Name="User Info" ValueTable="Computation_EmptyConstant" ValueColumn="default">
|
||||||
<Name Lang="DE">Benutzer-Informationen</Name>
|
<Name Lang="DE">Benutzer-Informationen</Name>
|
||||||
</State-Info>
|
</State-Info>
|
||||||
<State-Info Name="User Name" ValueTable="citrix-session-user" ValueColumn="UserName">
|
<State-Info Name="User Name" ValueTable="citrix-session-details" ValueColumn="Usr_Name">
|
||||||
<Name Lang="DE">Benutzername</Name>
|
<Name Lang="DE">Benutzername</Name>
|
||||||
</State-Info>
|
</State-Info>
|
||||||
<State-Info Name="Fullname" ValueTable="citrix-session-user" ValueColumn="FullName">
|
<State-Info Name="Fullname" ValueTable="citrix-session-user" ValueColumn="FullName">
|
||||||
|
|||||||
@@ -44,24 +44,6 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
ctrlProtocolBox1.ProcessMessage($"Validating Citrix connections finished.");
|
ctrlProtocolBox1.ProcessMessage($"Validating Citrix connections finished.");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var _system in systems)
|
|
||||||
{
|
|
||||||
if (!(_system is cDataHistoryCitrixCloudTenant Tenant))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var result = await Program.Collector.CitrixCollector.GetCitrixCommunicationForSystemAsync(Tenant.TenantID, false);
|
|
||||||
if (result != null)
|
|
||||||
{
|
|
||||||
ctrlProtocolBox1.ProcessMessage($"Citrix connection for tenant {Tenant.TenantID} successful");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ctrlProtocolBox1.ProcessMessage($"Citrix connection for tenant {Tenant.TenantID} failed");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
@@ -91,26 +73,6 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
Program.Collector.ProcessUiMessage += ctrlProtocolBox1.ProcessMessage;
|
Program.Collector.ProcessUiMessage += ctrlProtocolBox1.ProcessMessage;
|
||||||
var _requestInfo = new cF4sdWebRequestInfo("btnConnectCitrix_Click", null);
|
var _requestInfo = new cF4sdWebRequestInfo("btnConnectCitrix_Click", null);
|
||||||
|
|
||||||
var systems = Program.Collector.InfrastructureConfig.Citrix.Systems;
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var _system in systems)
|
|
||||||
{
|
|
||||||
if (!(_system is cDataHistoryCitrixCloudTenant Tenant))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var result = await Program.Collector.CitrixCollector.GetCitrixUsersAsync();
|
|
||||||
if (result)
|
|
||||||
{
|
|
||||||
ctrlProtocolBox1.ProcessMessage($"Citrix connection for tenant {Tenant.TenantID} successful");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ctrlProtocolBox1.ProcessMessage($"Citrix connection for tenant {Tenant.TenantID} failed");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
@@ -139,26 +101,6 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
Program.Collector.CleanupUiMessageHandler();
|
Program.Collector.CleanupUiMessageHandler();
|
||||||
Program.Collector.ProcessUiMessage += ctrlProtocolBox1.ProcessMessage;
|
Program.Collector.ProcessUiMessage += ctrlProtocolBox1.ProcessMessage;
|
||||||
var _requestInfo = new cF4sdWebRequestInfo("btnGetSessions_Click", null);
|
var _requestInfo = new cF4sdWebRequestInfo("btnGetSessions_Click", null);
|
||||||
var systems = Program.Collector.InfrastructureConfig.Citrix.Systems;
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var _system in systems)
|
|
||||||
{
|
|
||||||
if (!(_system is cDataHistoryCitrixCloudTenant Tenant))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var result = await Program.Collector.CitrixCollector.GetCitrixSessionsAsync();
|
|
||||||
if (result)
|
|
||||||
{
|
|
||||||
ctrlProtocolBox1.ProcessMessage($"Citrix connection for tenant {Tenant.TenantID} successful");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ctrlProtocolBox1.ProcessMessage($"Citrix connection for tenant {Tenant.TenantID} failed");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,13 +42,15 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
this.label4 = new System.Windows.Forms.Label();
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
this.buttonClear = new System.Windows.Forms.Button();
|
this.buttonClear = new System.Windows.Forms.Button();
|
||||||
this.checkBoxFiltered = new System.Windows.Forms.CheckBox();
|
this.checkBoxFiltered = new System.Windows.Forms.CheckBox();
|
||||||
|
this.comboBoxSessions = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
this.ctrlProtocolBox1 = new C4IT_DataHistoryProvider_Test.ctrlProtocolBox();
|
this.ctrlProtocolBox1 = new C4IT_DataHistoryProvider_Test.ctrlProtocolBox();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// buttonGetUserComputerActivities
|
// buttonGetUserComputerActivities
|
||||||
//
|
//
|
||||||
this.buttonGetUserComputerActivities.Location = new System.Drawing.Point(554, 17);
|
this.buttonGetUserComputerActivities.Location = new System.Drawing.Point(554, 17);
|
||||||
this.buttonGetUserComputerActivities.Margin = new System.Windows.Forms.Padding(2);
|
this.buttonGetUserComputerActivities.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.buttonGetUserComputerActivities.Name = "buttonGetUserComputerActivities";
|
this.buttonGetUserComputerActivities.Name = "buttonGetUserComputerActivities";
|
||||||
this.buttonGetUserComputerActivities.Size = new System.Drawing.Size(164, 32);
|
this.buttonGetUserComputerActivities.Size = new System.Drawing.Size(164, 32);
|
||||||
this.buttonGetUserComputerActivities.TabIndex = 1;
|
this.buttonGetUserComputerActivities.TabIndex = 1;
|
||||||
@@ -97,7 +99,7 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
// buttonComputerUserActivities
|
// buttonComputerUserActivities
|
||||||
//
|
//
|
||||||
this.buttonComputerUserActivities.Location = new System.Drawing.Point(554, 65);
|
this.buttonComputerUserActivities.Location = new System.Drawing.Point(554, 65);
|
||||||
this.buttonComputerUserActivities.Margin = new System.Windows.Forms.Padding(2);
|
this.buttonComputerUserActivities.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.buttonComputerUserActivities.Name = "buttonComputerUserActivities";
|
this.buttonComputerUserActivities.Name = "buttonComputerUserActivities";
|
||||||
this.buttonComputerUserActivities.Size = new System.Drawing.Size(164, 32);
|
this.buttonComputerUserActivities.Size = new System.Drawing.Size(164, 32);
|
||||||
this.buttonComputerUserActivities.TabIndex = 5;
|
this.buttonComputerUserActivities.TabIndex = 5;
|
||||||
@@ -129,7 +131,7 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
//
|
//
|
||||||
this.buttonGetRawValues.Enabled = false;
|
this.buttonGetRawValues.Enabled = false;
|
||||||
this.buttonGetRawValues.Location = new System.Drawing.Point(554, 118);
|
this.buttonGetRawValues.Location = new System.Drawing.Point(554, 118);
|
||||||
this.buttonGetRawValues.Margin = new System.Windows.Forms.Padding(2);
|
this.buttonGetRawValues.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||||
this.buttonGetRawValues.Name = "buttonGetRawValues";
|
this.buttonGetRawValues.Name = "buttonGetRawValues";
|
||||||
this.buttonGetRawValues.Size = new System.Drawing.Size(164, 32);
|
this.buttonGetRawValues.Size = new System.Drawing.Size(164, 32);
|
||||||
this.buttonGetRawValues.TabIndex = 9;
|
this.buttonGetRawValues.TabIndex = 9;
|
||||||
@@ -150,7 +152,7 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
// label4
|
// label4
|
||||||
//
|
//
|
||||||
this.label4.AutoSize = true;
|
this.label4.AutoSize = true;
|
||||||
this.label4.Location = new System.Drawing.Point(760, 22);
|
this.label4.Location = new System.Drawing.Point(768, 22);
|
||||||
this.label4.Name = "label4";
|
this.label4.Name = "label4";
|
||||||
this.label4.Size = new System.Drawing.Size(63, 20);
|
this.label4.Size = new System.Drawing.Size(63, 20);
|
||||||
this.label4.TabIndex = 12;
|
this.label4.TabIndex = 12;
|
||||||
@@ -172,28 +174,50 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
this.checkBoxFiltered.AutoSize = true;
|
this.checkBoxFiltered.AutoSize = true;
|
||||||
this.checkBoxFiltered.Checked = true;
|
this.checkBoxFiltered.Checked = true;
|
||||||
this.checkBoxFiltered.CheckState = System.Windows.Forms.CheckState.Checked;
|
this.checkBoxFiltered.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
this.checkBoxFiltered.Location = new System.Drawing.Point(840, 67);
|
this.checkBoxFiltered.Location = new System.Drawing.Point(840, 68);
|
||||||
this.checkBoxFiltered.Name = "checkBoxFiltered";
|
this.checkBoxFiltered.Name = "checkBoxFiltered";
|
||||||
this.checkBoxFiltered.Size = new System.Drawing.Size(175, 24);
|
this.checkBoxFiltered.Size = new System.Drawing.Size(182, 24);
|
||||||
this.checkBoxFiltered.TabIndex = 15;
|
this.checkBoxFiltered.TabIndex = 15;
|
||||||
this.checkBoxFiltered.Text = "Only with current use";
|
this.checkBoxFiltered.Text = "Only with current use";
|
||||||
this.checkBoxFiltered.UseVisualStyleBackColor = true;
|
this.checkBoxFiltered.UseVisualStyleBackColor = true;
|
||||||
this.checkBoxFiltered.CheckedChanged += new System.EventHandler(this.checkBoxFiltered_CheckedChanged);
|
this.checkBoxFiltered.CheckedChanged += new System.EventHandler(this.checkBoxFiltered_CheckedChanged);
|
||||||
//
|
//
|
||||||
|
// comboBoxSessions
|
||||||
|
//
|
||||||
|
this.comboBoxSessions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.comboBoxSessions.FormattingEnabled = true;
|
||||||
|
this.comboBoxSessions.Location = new System.Drawing.Point(1191, 18);
|
||||||
|
this.comboBoxSessions.Name = "comboBoxSessions";
|
||||||
|
this.comboBoxSessions.Size = new System.Drawing.Size(328, 28);
|
||||||
|
this.comboBoxSessions.TabIndex = 18;
|
||||||
|
this.comboBoxSessions.SelectedValueChanged += new System.EventHandler(this.comboBoxSessions_SelectedValueChanged);
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.Location = new System.Drawing.Point(1090, 23);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(97, 20);
|
||||||
|
this.label5.TabIndex = 17;
|
||||||
|
this.label5.Text = "V. Sessions:";
|
||||||
|
//
|
||||||
// ctrlProtocolBox1
|
// ctrlProtocolBox1
|
||||||
//
|
//
|
||||||
this.ctrlProtocolBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
this.ctrlProtocolBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
| System.Windows.Forms.AnchorStyles.Left)
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.ctrlProtocolBox1.Location = new System.Drawing.Point(9, 169);
|
this.ctrlProtocolBox1.Location = new System.Drawing.Point(9, 169);
|
||||||
|
this.ctrlProtocolBox1.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.ctrlProtocolBox1.Name = "ctrlProtocolBox1";
|
this.ctrlProtocolBox1.Name = "ctrlProtocolBox1";
|
||||||
this.ctrlProtocolBox1.Size = new System.Drawing.Size(1068, 79);
|
this.ctrlProtocolBox1.Size = new System.Drawing.Size(1510, 78);
|
||||||
this.ctrlProtocolBox1.TabIndex = 16;
|
this.ctrlProtocolBox1.TabIndex = 16;
|
||||||
//
|
//
|
||||||
// ctrlTestFunctions
|
// ctrlTestFunctions
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.comboBoxSessions);
|
||||||
|
this.Controls.Add(this.label5);
|
||||||
this.Controls.Add(this.checkBoxFiltered);
|
this.Controls.Add(this.checkBoxFiltered);
|
||||||
this.Controls.Add(this.buttonClear);
|
this.Controls.Add(this.buttonClear);
|
||||||
this.Controls.Add(this.comboBoxTickets);
|
this.Controls.Add(this.comboBoxTickets);
|
||||||
@@ -209,7 +233,7 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
this.Controls.Add(this.buttonGetUserComputerActivities);
|
this.Controls.Add(this.buttonGetUserComputerActivities);
|
||||||
this.Controls.Add(this.ctrlProtocolBox1);
|
this.Controls.Add(this.ctrlProtocolBox1);
|
||||||
this.Name = "ctrlTestFunctions";
|
this.Name = "ctrlTestFunctions";
|
||||||
this.Size = new System.Drawing.Size(1088, 268);
|
this.Size = new System.Drawing.Size(1530, 268);
|
||||||
this.Load += new System.EventHandler(this.ctrlTestFunctions_Load);
|
this.Load += new System.EventHandler(this.ctrlTestFunctions_Load);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
@@ -232,5 +256,7 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
private System.Windows.Forms.Button buttonClear;
|
private System.Windows.Forms.Button buttonClear;
|
||||||
private System.Windows.Forms.CheckBox checkBoxFiltered;
|
private System.Windows.Forms.CheckBox checkBoxFiltered;
|
||||||
private ctrlProtocolBox ctrlProtocolBox1;
|
private ctrlProtocolBox ctrlProtocolBox1;
|
||||||
|
private System.Windows.Forms.ComboBox comboBoxSessions;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
if (Program.Collector.M42WpmCollector != null)
|
if (Program.Collector.M42WpmCollector != null)
|
||||||
await Program.Collector.M42WpmCollector.ValidateConnectionAsync(true, CancellationToken.None);
|
await Program.Collector.M42WpmCollector.ValidateConnectionAsync(true, CancellationToken.None);
|
||||||
|
|
||||||
|
if (Program.Collector.CitrixCollector != null)
|
||||||
|
await Program.Collector.CitrixCollector.ValidateConnectionsAsync(CancellationToken.None);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
@@ -117,20 +120,37 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
ctrlProtocolBox1.ProcessMessage("no further information found.");
|
ctrlProtocolBox1.ProcessMessage("no further information found.");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
comboBoxTickets.Items.Clear();
|
|
||||||
ctrlProtocolBox1.ProcessMessage($"{RetVal.Count} related objects found:");
|
ctrlProtocolBox1.ProcessMessage($"{RetVal.Count} related objects found:");
|
||||||
|
|
||||||
|
// fill the drop down boxes for the realtions found
|
||||||
|
comboBoxTickets.Items.Clear();
|
||||||
|
comboBoxSessions.Items.Clear();
|
||||||
foreach (var Entry2 in RetVal)
|
foreach (var Entry2 in RetVal)
|
||||||
{
|
{
|
||||||
if (Entry2.Type == enumF4sdSearchResultClass.Ticket)
|
switch(Entry2.Type)
|
||||||
|
{
|
||||||
|
case enumF4sdSearchResultClass.Ticket:
|
||||||
comboBoxTickets.Items.Add(Entry2);
|
comboBoxTickets.Items.Add(Entry2);
|
||||||
|
break;
|
||||||
|
case enumF4sdSearchResultClass.VirtualSession:
|
||||||
|
if (!string.IsNullOrEmpty(Entry2.DisplayName))
|
||||||
|
comboBoxSessions.Items.Add(Entry2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ctrlProtocolBox1.ProcessMessage($" {Entry2.Type} {Entry2.Name} {{{Entry2.id}}}:");
|
ctrlProtocolBox1.ProcessMessage($" {Entry2.Type} {Entry2.Name} {{{Entry2.id}}}:");
|
||||||
ctrlProtocolBox1.ProcessMessage($" LastUsed: {Entry2.LastUsed}");
|
ctrlProtocolBox1.ProcessMessage($" LastUsed: {Entry2.LastUsed}");
|
||||||
ctrlProtocolBox1.ProcessMessage($" Usage weight: {Entry2.UsingLevel}");
|
ctrlProtocolBox1.ProcessMessage($" Usage weight: {Entry2.UsingLevel}");
|
||||||
foreach (var Entry3 in Entry2.Infos)
|
foreach (var Entry3 in Entry2.Infos)
|
||||||
ctrlProtocolBox1.ProcessMessage($" {Entry3.Key}: {Entry3.Value}");
|
ctrlProtocolBox1.ProcessMessage($" {Entry3.Key}: {Entry3.Value}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comboBoxTickets.Items.Count > 0)
|
if (comboBoxTickets.Items.Count > 0)
|
||||||
comboBoxTickets.SelectedIndex = 0;
|
comboBoxTickets.SelectedIndex = 0;
|
||||||
|
if (comboBoxSessions.Items.Count > 0)
|
||||||
|
comboBoxSessions.SelectedIndex = 0;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
@@ -196,6 +216,11 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
GetTables();
|
GetTables();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void comboBoxSessions_SelectedValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GetTables();
|
||||||
|
}
|
||||||
|
|
||||||
private void GetTables()
|
private void GetTables()
|
||||||
{
|
{
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
||||||
@@ -204,13 +229,15 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
bool HasUser = comboBoxUserSelect.SelectedItem != null;
|
bool HasUser = comboBoxUserSelect.SelectedItem != null;
|
||||||
bool HasComputer = comboBoxComputerSelect.SelectedItem != null;
|
bool HasComputer = comboBoxComputerSelect.SelectedItem != null;
|
||||||
bool HasTicket = comboBoxTickets.SelectedItem != null;
|
bool HasTicket = comboBoxTickets.SelectedItem != null;
|
||||||
|
bool HasSession = comboBoxSessions.SelectedItem != null;
|
||||||
|
|
||||||
var Tables = new List<cDataHistoryConfigTable>();
|
var Tables = new List<cDataHistoryConfigTable>();
|
||||||
foreach (var table in Program.Collector.ClusterConfig.Tables.Values)
|
foreach (var table in Program.Collector.ClusterConfig.Tables.Values)
|
||||||
{
|
{
|
||||||
if ((HasUser && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.User) ||
|
if ((HasUser && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.User) ||
|
||||||
(HasComputer && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.Computer) ||
|
(HasComputer && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.Computer) ||
|
||||||
(HasTicket && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.Ticket))
|
(HasTicket && table.ParentCluster.InformationClass == C4IT.FASD.Base.enumFasdInformationClass.Ticket) ||
|
||||||
|
(HasSession && table.ParentCluster.InformationClass == enumFasdInformationClass.VirtualSession))
|
||||||
{
|
{
|
||||||
Tables.Add(table);
|
Tables.Add(table);
|
||||||
}
|
}
|
||||||
@@ -278,6 +305,8 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
Identities.Add(new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = UserEntry.id, AccountType = enumAccountType.AD });
|
Identities.Add(new cF4sdIdentityEntry() { Class = enumFasdInformationClass.User, Id = UserEntry.id, AccountType = enumAccountType.AD });
|
||||||
if (comboBoxTickets.SelectedItem is cF4sdApiSearchResultRelation TicketEntry)
|
if (comboBoxTickets.SelectedItem is cF4sdApiSearchResultRelation TicketEntry)
|
||||||
Identities.Add(new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Ticket, Id = TicketEntry.id });
|
Identities.Add(new cF4sdIdentityEntry() { Class = enumFasdInformationClass.Ticket, Id = TicketEntry.id });
|
||||||
|
if (comboBoxSessions.SelectedItem is cF4sdApiSearchResultRelation SessionEntry)
|
||||||
|
Identities.Add(new cF4sdIdentityEntry() { Class = enumFasdInformationClass.VirtualSession, Id = SessionEntry.id, Instance = SessionEntry.Instance });
|
||||||
if (!(comboBoxTable.SelectedItem is cDataHistoryConfigTable Table))
|
if (!(comboBoxTable.SelectedItem is cDataHistoryConfigTable Table))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -467,5 +496,6 @@ namespace C4IT_DataHistoryProvider_Test
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3825,77 +3825,42 @@ namespace C4IT.DataHistoryProvider
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var Age2 = Age;
|
var _relationService = GetStagedRelationService();
|
||||||
if (Ids.Count == 1)
|
if (_relationService == null)
|
||||||
Age2 = 365;
|
|
||||||
var AgentLimit = DateTime.UtcNow + TimeSpan.FromDays(-Age2);
|
|
||||||
|
|
||||||
var idInput = Ids.Select(v => new cF4sdIdentityEntry() { Id = v, Class = infoClass }).ToList();
|
|
||||||
var listIds = await getConnectorIdList(idInput, Token, requestInfo, LogDeep + 1);
|
|
||||||
|
|
||||||
if (listIds == null || listIds.Count == 0)
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var lstAgentIds = new Dictionary<int, cDataHistoryUsageIdInfo>(Ids.Count);
|
var _relatedTo = new List<cFasdApiSearchResultEntry>();
|
||||||
var lstTicketIds = new List<cF4sdConnectorIds>(Ids.Count);
|
foreach (var _idEntry in Ids)
|
||||||
|
|
||||||
foreach (var Entry in listIds)
|
|
||||||
{
|
{
|
||||||
if (M42WpmCollector != null && infoClass == enumFasdInformationClass.User)
|
var _rel = new cFasdApiSearchResultEntry()
|
||||||
{
|
{
|
||||||
if (Entry.sid != null)
|
Type = cFasdApiSearchResultEntry.getSearchClass(infoClass),
|
||||||
lstTicketIds.Add(Entry);
|
id = _idEntry
|
||||||
}
|
|
||||||
if (Entry.lastSeenByAgent != null && Entry.lastSeenByAgent >= AgentLimit)
|
|
||||||
{
|
|
||||||
if (Entry.agentId2 != null)
|
|
||||||
lstAgentIds[(int)Entry.agentId2] = new cDataHistoryUsageIdInfo() { Id = Entry.Id, AccountType = enumAccountType.Azure };
|
|
||||||
if (Entry.agentId != null)
|
|
||||||
lstAgentIds[(int)Entry.agentId] = new cDataHistoryUsageIdInfo() { Id = Entry.Id, AccountType = enumAccountType.AD };
|
|
||||||
}
|
|
||||||
if (Entry.localAgentIds != null)
|
|
||||||
{
|
|
||||||
foreach (var entryLocal in Entry.localAgentIds)
|
|
||||||
{
|
|
||||||
if (entryLocal.lastSeenByAgent >= AgentLimit)
|
|
||||||
lstAgentIds[entryLocal.agentId] = new cDataHistoryUsageIdInfo() { Id = Entry.Id, AccountType = enumAccountType.Local, account = entryLocal.account, domain = "" };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (DefaultLogger.IsDebug)
|
|
||||||
{
|
|
||||||
var _msgDebug = new List<string>()
|
|
||||||
{
|
|
||||||
$"{lstAgentIds?.Count} agent ids found by usage determination:"
|
|
||||||
};
|
};
|
||||||
foreach (var dbgEntry in lstAgentIds)
|
_relatedTo.Add(_rel);
|
||||||
_msgDebug.Add($"{dbgEntry.Key}: accountType={dbgEntry.Value.AccountType}, account={dbgEntry.Value.account}, domain={dbgEntry.Value.domain}, id={dbgEntry.Value.Id}");
|
|
||||||
DefaultLogger.LogList(LogLevels.Debug, _msgDebug);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var taskList = new List<Task<List<cF4sdApiSearchResultRelation>>>(2);
|
var taskId = await _relationService.StartGatheringRelatedObjects(_relatedTo, Age);
|
||||||
if (lstAgentIds.Count > 0)
|
if (Token.IsCancellationRequested)
|
||||||
taskList.Add(Task.Run<List<cF4sdApiSearchResultRelation>>(async () => { return await GetUsedInfoFromAgentData(infoClass, lstAgentIds, Age, Token, requestInfo, LogDeep + 1); }));
|
|
||||||
if (lstTicketIds.Count > 0)
|
|
||||||
taskList.Add(Task.Run<List<cF4sdApiSearchResultRelation>>(async () => { return await getTicketUsage(infoClass, lstTicketIds, Age, Token, requestInfo, LogDeep + 1); }));
|
|
||||||
|
|
||||||
if (taskList.Count == 0)
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var arrTask = taskList.ToArray();
|
var _retVal = new List<cF4sdApiSearchResultRelation>();
|
||||||
var RetVal = await Task.WhenAll<List<cF4sdApiSearchResultRelation>>(arrTask);
|
do
|
||||||
|
|
||||||
var RetVal2 = new List<cF4sdApiSearchResultRelation>();
|
|
||||||
foreach (var Entry in RetVal)
|
|
||||||
{
|
{
|
||||||
if (Entry != null)
|
var _rels = await _relationService.GetRelatedObjectsAsync(taskId.Id, Token);
|
||||||
RetVal2.AddRange(Entry);
|
if (Token.IsCancellationRequested)
|
||||||
}
|
return null;
|
||||||
|
if (_rels == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
_retVal.AddRange(_rels.Relations);
|
||||||
|
|
||||||
|
if (_rels.IsComplete)
|
||||||
|
break;
|
||||||
|
} while (true);
|
||||||
|
|
||||||
|
return _retVal ;
|
||||||
|
|
||||||
if (RetVal2.Count > 0)
|
|
||||||
return RetVal2;
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
@@ -5589,7 +5554,7 @@ namespace C4IT.DataHistoryProvider
|
|||||||
if (infoClass == enumFasdInformationClass.Ticket)
|
if (infoClass == enumFasdInformationClass.Ticket)
|
||||||
return new cF4sdConnectorIds() { Id = Identity.Id, infoClass = enumFasdInformationClass.Ticket };
|
return new cF4sdConnectorIds() { Id = Identity.Id, infoClass = enumFasdInformationClass.Ticket };
|
||||||
if (infoClass == enumFasdInformationClass.VirtualSession)
|
if (infoClass == enumFasdInformationClass.VirtualSession)
|
||||||
return new cF4sdConnectorIds() { Id = Identity.Id, infoClass = enumFasdInformationClass.VirtualSession };
|
return new cF4sdConnectorIds() { Id = Identity.Id, Instance = Identity.Instance, infoClass = enumFasdInformationClass.VirtualSession };
|
||||||
if (infoClass == enumFasdInformationClass.MobileDevice)
|
if (infoClass == enumFasdInformationClass.MobileDevice)
|
||||||
return new cF4sdConnectorIds() { Id = Identity.Id, infoClass = enumFasdInformationClass.MobileDevice };
|
return new cF4sdConnectorIds() { Id = Identity.Id, infoClass = enumFasdInformationClass.MobileDevice };
|
||||||
|
|
||||||
@@ -6911,6 +6876,8 @@ namespace C4IT.DataHistoryProvider
|
|||||||
|
|
||||||
public enumFasdInformationClass infoClass { get; set; } = enumFasdInformationClass.Unknown;
|
public enumFasdInformationClass infoClass { get; set; } = enumFasdInformationClass.Unknown;
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
public Guid Instance { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
public int? agentId { get; set; } = null;
|
public int? agentId { get; set; } = null;
|
||||||
public int? agentId2 { get; set; } = null;
|
public int? agentId2 { get; set; } = null;
|
||||||
public List<localIdEntry> localAgentIds { get; set; } = null;
|
public List<localIdEntry> localAgentIds { get; set; } = null;
|
||||||
|
|||||||
@@ -42,11 +42,18 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
public const string constConnectorName = "Citrix Virtual Apps and Desktops connector";
|
public const string constConnectorName = "Citrix Virtual Apps and Desktops connector";
|
||||||
public const string constLicenseId = "F2DA5E05-FD3C-4182-9164-9C722140BF85";
|
public const string constLicenseId = "F2DA5E05-FD3C-4182-9164-9C722140BF85";
|
||||||
|
|
||||||
public const string constCitrixUserList = "Users?$top={0}&$select=Id,Sid,Upn,Domain&$filter=Domain ne ''";
|
// urls for static tables
|
||||||
public const string constCitrixSessionList = "Sessions?$expand=Machine($select=Id,DnsName,Name)&$select=SessionKey,StartDate,EndDate,ConnectionState";
|
|
||||||
public const string constCitrixSessions = "Sessions?$filter=(EndDate eq null or EndDate gt {1}) and UserId in ({0})&$expand=Machine($select=Id,DnsName,Name)&$select=SessionKey,StartDate,EndDate,ConnectionState";
|
|
||||||
public const string constCitrixSession = "Sessions?$filter=SessionKey eq {0}";
|
public const string constCitrixSession = "Sessions?$filter=SessionKey eq {0}";
|
||||||
|
public const string constCitrixSessionMachine = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=Machine($expand=CurrentLoadIndex,Catalog,DesktopGroup($select=Name)),Machine";
|
||||||
|
public const string constCitrixSessionUser = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=User";
|
||||||
|
public const string constCitrixSessionConnections = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=Connection";
|
||||||
|
public const string constCitrixSessionCurrentConnection = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=CurrentConnection,LogOnMetrics";
|
||||||
|
|
||||||
|
// urls for historic tables
|
||||||
public const string constCitrixSessionMetrics = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics";
|
public const string constCitrixSessionMetrics = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics";
|
||||||
|
|
||||||
|
|
||||||
|
// urls for detail tables
|
||||||
public const string constCitrixSessionMetricsIcaRTT = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,IcaRttMs)";
|
public const string constCitrixSessionMetricsIcaRTT = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,IcaRttMs)";
|
||||||
public const string constCitrixSessionMetricsIcaLatency = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,IcaLatency)";
|
public const string constCitrixSessionMetricsIcaLatency = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,IcaLatency)";
|
||||||
public const string constCitrixSessionMetricsClientL7Latency = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,ClientL7Latency)";
|
public const string constCitrixSessionMetricsClientL7Latency = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,ClientL7Latency)";
|
||||||
@@ -59,23 +66,27 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
public const string constCitrixSessionMetricsOutputFps = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,OutputFps)";
|
public const string constCitrixSessionMetricsOutputFps = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,OutputFps)";
|
||||||
public const string constCitrixSessionMetricsWanLatency = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,WanLatency)";
|
public const string constCitrixSessionMetricsWanLatency = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,WanLatency)";
|
||||||
public const string constCitrixSessionMetricsDcLatency = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,DcLatency)";
|
public const string constCitrixSessionMetricsDcLatency = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=SessionMetrics($select=Id,CollectedDate,DcLatency)";
|
||||||
public const string constCitrixSessionMachine = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=Machine($expand=CurrentLoadIndex,Catalog,DesktopGroup($select=Name)),Machine";
|
|
||||||
public const string constCitrixSessionCurrentConnection = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=CurrentConnection,LogOnMetrics";
|
|
||||||
public const string constCitrixSessionConnections = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=Connection";
|
|
||||||
public const string constCitrixSessionLogInSummaries = "Sessions?$filter=UserId in ({0})$select=Id,StartDate&$expand=User($select=UserName),LogOnSummaries($select=LogOnDuration,AuthenticationDuration,BrokingDuration,ProfileLoadDuration,GpoProcessingDuration,InteractiveSessionDuration)";
|
public const string constCitrixSessionLogInSummaries = "Sessions?$filter=UserId in ({0})$select=Id,StartDate&$expand=User($select=UserName),LogOnSummaries($select=LogOnDuration,AuthenticationDuration,BrokingDuration,ProfileLoadDuration,GpoProcessingDuration,InteractiveSessionDuration)";
|
||||||
public const string constCitrixSessionLogInSummaries2 = "LogOnSummaries?$expand=Session($expand=User)&$filter=UserId eq {0}";
|
|
||||||
public const string constCitrixUserConnections = "Sessions?$filter=UserId in ({0})&$expand=Connection";
|
public const string constCitrixUserConnections = "Sessions?$filter=UserId in ({0})&$expand=Connection";
|
||||||
public const string constCitrixSessionUser = "Sessions?$select=SessionKey&$filter=SessionKey eq {0}&$expand=User";
|
public const string constCitrixSessionLogInSummaries2 = "LogOnSummaries?$expand=Session($expand=User)&$filter=UserId eq {0}";
|
||||||
|
|
||||||
public const string constCitrixSessionLogoff = "manage/Sessions/{0}/$logoff";
|
public const string constCitrixSessionLogoff = "manage/Sessions/{0}/$logoff";
|
||||||
public const string constCitrixSessionHide = "manage/Sessions/{0}/$hide";
|
public const string constCitrixSessionHide = "manage/Sessions/{0}/$hide";
|
||||||
public const string constCitrixSessionSendMessage = "manage/Sessions/{0}/$sendMessage";
|
public const string constCitrixSessionSendMessage = "manage/Sessions/{0}/$sendMessage";
|
||||||
|
|
||||||
|
// static tables
|
||||||
|
public const string constTableNameSessionDetails = "citrix-session-details";
|
||||||
|
|
||||||
public const string constTableNameSession = "citrix-session";
|
public const string constTableNameSession = "citrix-session";
|
||||||
public const string constTableNameSessionMachine = "citrix-session-machine";
|
public const string constTableNameSessionMachine = "citrix-session-machine";
|
||||||
|
public const string constTableNameSessionUser = "citrix-session-user";
|
||||||
public const string constTableNameSessionConnection = "citrix-session-connection";
|
public const string constTableNameSessionConnection = "citrix-session-connection";
|
||||||
public const string constTableNameSessionCurrentConnection = "citrix-session-currentConnection";
|
public const string constTableNameSessionCurrentConnection = "citrix-session-currentConnection";
|
||||||
|
|
||||||
|
// history tables
|
||||||
public const string constTableNameSessionMetrics = "citrix-session-metrics";
|
public const string constTableNameSessionMetrics = "citrix-session-metrics";
|
||||||
public const string constTableNameSessionStateMetrics = "citrix-connectionState-metrics";
|
|
||||||
public const string constTableNameSessionUser = "citrix-session-user";
|
// detail tables
|
||||||
public const string constTableNameSessionDetailsIcaRttMS = "citrix-session-details-icaRttMS";
|
public const string constTableNameSessionDetailsIcaRttMS = "citrix-session-details-icaRttMS";
|
||||||
public const string constTableNameSessionDetailsIcaLatency = "citrix-session-details-icaLatency";
|
public const string constTableNameSessionDetailsIcaLatency = "citrix-session-details-icaLatency";
|
||||||
public const string constTableNameSessionDetailsClientL7Latency = "citrix-session-details-clientL7Latency";
|
public const string constTableNameSessionDetailsClientL7Latency = "citrix-session-details-clientL7Latency";
|
||||||
@@ -378,10 +389,12 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Collector.DoProcessUiMessage(0, $"Validating Citrix connections...");
|
||||||
|
|
||||||
List<cDataHistoryCitrixSystem> _toRemove = new List<cDataHistoryCitrixSystem>();
|
List<cDataHistoryCitrixSystem> _toRemove = new List<cDataHistoryCitrixSystem>();
|
||||||
foreach (var _system in unauthorizedSystems)
|
foreach (var _system in unauthorizedSystems)
|
||||||
{
|
{
|
||||||
Collector.DoProcessUiMessage(2, $"Try logon to {_system.Name}...");
|
Collector.DoProcessUiMessage(1, $"Try logon to {_system.Name}...");
|
||||||
var _ok = false;
|
var _ok = false;
|
||||||
var CitrixConn = await LogonToSystemAsync(_system, token);
|
var CitrixConn = await LogonToSystemAsync(_system, token);
|
||||||
if (token.IsCancellationRequested)
|
if (token.IsCancellationRequested)
|
||||||
@@ -396,9 +409,9 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
_ok = true;
|
_ok = true;
|
||||||
}
|
}
|
||||||
if (_ok)
|
if (_ok)
|
||||||
Collector.DoProcessUiMessage(2, $"Successfull logon to {_system.Name}.");
|
Collector.DoProcessUiMessage(1, $"Successfull logon to {_system.Name}.");
|
||||||
else
|
else
|
||||||
Collector.DoProcessUiMessage(2, $"Could not logon to {_system.Name}.", LogLevels.Error);
|
Collector.DoProcessUiMessage(1, $"Could not logon to {_system.Name}.", LogLevels.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var _system in _toRemove)
|
foreach (var _system in _toRemove)
|
||||||
@@ -413,34 +426,13 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
Collector.DoProcessUiMessage(0, $"Validating Citrix connections finished.");
|
||||||
if (CM != null) LogMethodEnd(CM);
|
if (CM != null) LogMethodEnd(CM);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<cCitrixCommunicationSystem> GetConnection(Guid SiteId)
|
|
||||||
{
|
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (cachedConnections.TryGetValue(SiteId, out var cachedConnection))
|
|
||||||
return cachedConnection;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception E)
|
|
||||||
{
|
|
||||||
LogException(E);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (CM != null) LogMethodEnd(CM);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<cCitrixCommunicationSystem> LogonCitrixTenantAsync(cDataHistoryCitrixCloudTenant Tenant, bool force = false)
|
public async Task<cCitrixCommunicationSystem> LogonCitrixTenantAsync(cDataHistoryCitrixCloudTenant Tenant, bool force = false)
|
||||||
{
|
{
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
||||||
@@ -481,65 +473,6 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete]
|
|
||||||
public async Task<bool> GetCitrixUsersAsync()
|
|
||||||
{
|
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var strUrl = string.Format(constCitrixUserList, constCitrixUserPaging);
|
|
||||||
|
|
||||||
var systems = Collector.InfrastructureConfig.Citrix.Systems;
|
|
||||||
if (systems is null)
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(2, $" Could not logon to tenant - Tenant is null", LogLevels.Warning);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var _retVal = true;
|
|
||||||
foreach (var _system in systems)
|
|
||||||
{
|
|
||||||
if (!(_system is cDataHistoryCitrixCloudTenant Tenant))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var CitrixConn = await GetCitrixCommunicationForSystemAsync(Tenant.TenantID, true);
|
|
||||||
if (CitrixConn == null)
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(2, $"error: could not logon to tenat {Tenant.Domain}", LogLevels.Error);
|
|
||||||
_retVal = false;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var Result = await CitrixConn.Monitor.Request.RequestAsync(strUrl, eHttpMethod.get, null);
|
|
||||||
if (Result != null)
|
|
||||||
{
|
|
||||||
var _props = Result.Result as JObject;
|
|
||||||
if (_props != null)
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(3, $" properties of selected '{_props}' with {_props.Count} properties could be read.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(2, $" Could not get user list from tenant {Tenant.Domain}", LogLevels.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return _retVal;
|
|
||||||
}
|
|
||||||
catch (Exception E)
|
|
||||||
{
|
|
||||||
LogException(E);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (CM != null) LogMethodEnd(CM);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ScanSessionEntryProcessor : ScanEntryProcessor
|
private class ScanSessionEntryProcessor : ScanEntryProcessor
|
||||||
{
|
{
|
||||||
private cCitrixCommunicationMonitor _comm;
|
private cCitrixCommunicationMonitor _comm;
|
||||||
@@ -599,6 +532,7 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
LastUsed = endDate,
|
LastUsed = endDate,
|
||||||
UsingLevel = _duration == 0 ? 1 : _duration,
|
UsingLevel = _duration == 0 ? 1 : _duration,
|
||||||
id = SessionId,
|
id = SessionId,
|
||||||
|
Instance = instanceId,
|
||||||
Status = enumF4sdSearchResultStatus.Active,
|
Status = enumF4sdSearchResultStatus.Active,
|
||||||
Infos = Infos,
|
Infos = Infos,
|
||||||
Identities = new cF4sdIdentityList()
|
Identities = new cF4sdIdentityList()
|
||||||
@@ -679,90 +613,6 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
}
|
}
|
||||||
|
|
||||||
return _retVal;
|
return _retVal;
|
||||||
|
|
||||||
string userIds = string.Join(",", UserIds.Where(u => !string.IsNullOrWhiteSpace(u?.citrixUserId.ToString())).Select(u => u.citrixUserId));
|
|
||||||
|
|
||||||
//DateTime latestEndDate = DateTime.UtcNow.AddDays(-age);
|
|
||||||
//ToDo: originale Altersberechnung wiederherstellen
|
|
||||||
DateTime latestEndDate = DateTime.UtcNow.AddDays(-90);
|
|
||||||
var strUrl = string.Format(constCitrixSessions, userIds, latestEndDate.ToString("yyyy-MM-ddThh:mm:ssK"));
|
|
||||||
|
|
||||||
var tenantId = UserIds?.FirstOrDefault(u => !string.IsNullOrWhiteSpace(u?.citrixTenantId))?.citrixTenantId;
|
|
||||||
if (tenantId is null)
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(2, $" Could not logon to tenant - Tenant is null", LogLevels.Warning);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var CitrixConn = await GetCitrixCommunicationForSystemAsync(tenantId, true);
|
|
||||||
|
|
||||||
if (CitrixConn == null)
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(2, $"error: could not logon to tenat {tenantId}", LogLevels.Error);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ToDo: Implement a paged walkthrough of results in case there are more results than the API can return in one call
|
|
||||||
// maybe we should think about a concrete implementation of the results instead of a dynamic, what do you think?
|
|
||||||
var Result = await CitrixConn.Monitor.Request.RequestListAsync(strUrl, false, retryForbidden: false);
|
|
||||||
|
|
||||||
if (Result != null && Result.Count > 0)
|
|
||||||
{
|
|
||||||
var sessionResult = new List<cF4sdApiSearchResultRelation>(Result.Count);
|
|
||||||
double _sumDuration = 0;
|
|
||||||
foreach (var Entry in Result)
|
|
||||||
{
|
|
||||||
var endDate = DateTime.MinValue;
|
|
||||||
if (!DateTime.TryParse(Entry.Result.EndDate?.ToString(), out endDate))
|
|
||||||
endDate = DateTime.UtcNow;
|
|
||||||
|
|
||||||
var startDate = DateTime.MinValue;
|
|
||||||
if (!DateTime.TryParse(Entry.Result.StartDate?.ToString(), out startDate))
|
|
||||||
startDate = DateTime.UtcNow;
|
|
||||||
|
|
||||||
TimeSpan _duration = endDate - startDate;
|
|
||||||
_sumDuration += _duration.TotalSeconds;
|
|
||||||
|
|
||||||
Enum.TryParse(Entry.Result.ConnectionState.ToString(), out enumCitrixSessionStatus connectionState);
|
|
||||||
|
|
||||||
var Infos = new Dictionary<string, string>()
|
|
||||||
{
|
|
||||||
|
|
||||||
{ "Status",connectionState.ToString() },
|
|
||||||
{ "StatusId", Entry.Result.ConnectionState.ToString() },
|
|
||||||
{ "Domain", Regex.Replace(Entry.Result.Machine.Name?.ToString(), @"\\.*$", "") }
|
|
||||||
};
|
|
||||||
var sessionInfo = new cF4sdApiSearchResultRelation()
|
|
||||||
{
|
|
||||||
Type = enumF4sdSearchResultClass.VirtualSession,
|
|
||||||
Name = Regex.Replace(Entry.Result.Machine.Name.ToString(), @"^.*\\", ""),
|
|
||||||
DisplayName = Regex.Replace(Entry.Result.Machine.Name.ToString(), @"^.*\\", ""),
|
|
||||||
LastUsed = endDate,
|
|
||||||
// minor thing due to the fact we did it like that in the Agent before, but:
|
|
||||||
// Instead of setting the UsingLevel to a temporary value and calculate the actual value later,
|
|
||||||
// we should maybe calculate the sumvalue beforehand and apply only the calculation here, what do you think?
|
|
||||||
UsingLevel = _duration.TotalSeconds == 0 ? 1 : _duration.TotalSeconds,
|
|
||||||
id = Entry.Result.SessionKey,
|
|
||||||
Status = enumF4sdSearchResultStatus.Active,
|
|
||||||
Infos = Infos,
|
|
||||||
Identities = new cF4sdIdentityList()
|
|
||||||
{
|
|
||||||
new cF4sdIdentityEntry(){ Class = enumFasdInformationClass.User, Id = UserIds.First().Id},
|
|
||||||
new cF4sdIdentityEntry(){ Class = enumFasdInformationClass.VirtualSession, Id = Entry.Result.SessionKey}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
sessionResult.Add(sessionInfo);
|
|
||||||
}
|
|
||||||
if (sessionResult != null && sessionResult.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var Entry in sessionResult)
|
|
||||||
{
|
|
||||||
Entry.UsingLevel /= _sumDuration;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sessionResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
{
|
{
|
||||||
@@ -919,179 +769,6 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<cF4SDHealthCardRawData.cHealthCardTable>> GetSessionStateMetricsAsync(cF4sdConnectorIds UserIds, string TenantId, cF4sdWebRequestInfo RequestInfo, int MaxAge, int LogDeep, CancellationToken Token)
|
|
||||||
{
|
|
||||||
|
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
|
||||||
if (cPerformanceLogger.IsActive && RequestInfo != null) { if (CM == null) CM = MethodBase.GetCurrentMethod(); cPerformanceLogger.LogPerformanceStart(LogDeep, CM, RequestInfo.id, RequestInfo.created); }
|
|
||||||
var _startTime = DateTime.UtcNow;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
var strUrl = string.Format(constCitrixSessions, UserIds.citrixUserId.ToString());
|
|
||||||
|
|
||||||
if (!Collector.ClusterConfig.Tables.TryGetValue(constTableNameSessionStateMetrics, out var SessionTableDetails))
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var citrixCommunication = await GetCitrixCommunicationForSystemAsync(TenantId, true);
|
|
||||||
if (citrixCommunication == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var res = await citrixCommunication.Monitor.Request.RequestAsync(strUrl, eHttpMethod.get, null);
|
|
||||||
if (res != null)
|
|
||||||
{
|
|
||||||
JObject sessionInfos = res.Result;
|
|
||||||
var retVal = new cF4SDHealthCardRawData.cHealthCardTable()
|
|
||||||
{
|
|
||||||
Name = constTableNameSessionStateMetrics,
|
|
||||||
InformationClass = enumFasdInformationClass.VirtualSession,
|
|
||||||
IsStatic = true,
|
|
||||||
TableType = eDataHistoryTableType.Static
|
|
||||||
};
|
|
||||||
|
|
||||||
var dicVals = new List<Dictionary<string, object>>();
|
|
||||||
var vals = sessionInfos.Children();
|
|
||||||
var metricsObj = sessionInfos["value"] as JArray;
|
|
||||||
|
|
||||||
if (metricsObj != null)
|
|
||||||
{
|
|
||||||
dicVals = metricsObj
|
|
||||||
.OfType<JObject>()
|
|
||||||
.Where(o =>
|
|
||||||
o["StartDate"] != null &&
|
|
||||||
o["ConnectionState"] != null &&
|
|
||||||
DateTime.TryParse(o["StartDate"].ToString(), out _)
|
|
||||||
)
|
|
||||||
.GroupBy(o => new
|
|
||||||
{
|
|
||||||
Date = DateTime.Parse(o["StartDate"].ToString()).Date,
|
|
||||||
ConnectionState = (int)o["ConnectionState"]
|
|
||||||
})
|
|
||||||
.OrderBy(g => g.Key.Date)
|
|
||||||
.Select(g => new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{ "StartDate", g.Key.Date }, // ✅ DateTime
|
|
||||||
{ "ConnectionState", g.Key.ConnectionState },
|
|
||||||
{ "ConnectionCount", g.Count() }
|
|
||||||
})
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const string startDateColumnName = "StartDate";
|
|
||||||
const string connectionStatusColumnName = "ConnectionState";
|
|
||||||
|
|
||||||
var groupedValues = dicVals
|
|
||||||
.Where(v =>
|
|
||||||
v.TryGetValue(startDateColumnName, out var collectDate) &&
|
|
||||||
collectDate is DateTime &&
|
|
||||||
v.TryGetValue(connectionStatusColumnName, out _))
|
|
||||||
.GroupBy(v => new
|
|
||||||
{
|
|
||||||
StartDate = ((DateTime)v[startDateColumnName]).Date,
|
|
||||||
ConnectionStatus = v[connectionStatusColumnName]
|
|
||||||
})
|
|
||||||
.Select(g => new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{ startDateColumnName, g.Key.StartDate },
|
|
||||||
{ connectionStatusColumnName, g.Key.ConnectionStatus },
|
|
||||||
{ "ConnectionCount", g.Count() }
|
|
||||||
})
|
|
||||||
.ToLookup(d => new
|
|
||||||
{
|
|
||||||
StartDate = (DateTime)d[startDateColumnName],
|
|
||||||
ConnectionStatus = d[connectionStatusColumnName],
|
|
||||||
ConnectionCount = d["ConnectionCount"]
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < MaxAge; i++)
|
|
||||||
{
|
|
||||||
DateTime referenceDate = DateTime.Now.AddDays(-i).Date;
|
|
||||||
|
|
||||||
//var valuesOfDay = groupedValues.FirstOrDefault(v => v.Key.Date == referenceDate);
|
|
||||||
var valuesOfDay = groupedValues.Where(g => g.Key.StartDate == referenceDate).SelectMany(g => g).ToList();
|
|
||||||
|
|
||||||
foreach (var colInfo in SessionTableDetails.Columns.Values)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (valuesOfDay is null)
|
|
||||||
{
|
|
||||||
AddColumnData(retVal, colInfo.SourceName, ConvertToF4sdType(null, colInfo.ValueType));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var valuesOfColumn = valuesOfDay
|
|
||||||
.Select(v =>
|
|
||||||
{
|
|
||||||
if (v.TryGetValue(colInfo.SourceName, out var colValue))
|
|
||||||
return colValue;
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
})
|
|
||||||
.Where(v => v != null);
|
|
||||||
|
|
||||||
if (!valuesOfColumn.Any())
|
|
||||||
{
|
|
||||||
AddColumnData(retVal, colInfo.SourceName, ConvertToF4sdType(null, colInfo.ValueType));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (colInfo is cDataHistoryConfigColumn configColumn && configColumn.AggregationType != eDataHistoryAggregationType.Unknown)
|
|
||||||
{
|
|
||||||
var aggregatedValue = GetAggregationValue(valuesOfColumn, configColumn.AggregationType, colInfo.ValueType);
|
|
||||||
AddColumnData(retVal, colInfo.SourceName, ConvertToF4sdType(aggregatedValue, colInfo.ValueType));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var value = valuesOfColumn.FirstOrDefault();
|
|
||||||
AddColumnData(retVal, colInfo.SourceName, ConvertToF4sdType(value, colInfo.ValueType));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception E)
|
|
||||||
{
|
|
||||||
LogException(E);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new List<cF4SDHealthCardRawData.cHealthCardTable>(1) { retVal };
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogEntry($"Could not get detailed sessionmetrics information from citrix with id {UserIds}. Sessionmetrics content is empty.", LogLevels.Warning);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception E)
|
|
||||||
{
|
|
||||||
LogException(E);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (cPerformanceLogger.IsActive && RequestInfo != null) { cPerformanceLogger.LogPerformanceEnd(LogDeep, CM, RequestInfo.id, RequestInfo.created, _startTime); }
|
|
||||||
if (CM != null) LogMethodEnd(CM);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
|
|
||||||
void AddColumnData(cF4SDHealthCardRawData.cHealthCardTable table, string columnName, object value)
|
|
||||||
{
|
|
||||||
if (table.Columns.TryGetValue(columnName, out var columnValues))
|
|
||||||
columnValues.Values.Add(value);
|
|
||||||
else
|
|
||||||
table.Columns.Add(columnName, new cF4SDHealthCardRawData.cHealthCardTableColumn(table) { ColumnName = columnName, Values = new List<object>() { value } });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<List<cF4SDHealthCardRawData.cHealthCardDetailsTable>> GetSessionMetricsDetailsIcaRttMSAsync(Guid Sessionid, string TenantId, cF4sdWebRequestInfo RequestInfo, int MaxAge, DateTime RefTime, int LogDeep, CancellationToken Token)
|
private async Task<List<cF4SDHealthCardRawData.cHealthCardDetailsTable>> GetSessionMetricsDetailsIcaRttMSAsync(Guid Sessionid, string TenantId, cF4sdWebRequestInfo RequestInfo, int MaxAge, DateTime RefTime, int LogDeep, CancellationToken Token)
|
||||||
{
|
{
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
||||||
@@ -3038,6 +2715,127 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class RequestFieldList
|
||||||
|
{
|
||||||
|
internal Dictionary<string, string> fields = new Dictionary<string, string>();
|
||||||
|
internal Dictionary<string, RequestFieldList> SubNodes = new Dictionary<string, RequestFieldList>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addRequestField(RequestFieldList list, string fieldPath, string fieldName)
|
||||||
|
{
|
||||||
|
var arrItems = fieldPath.Split('.');
|
||||||
|
if (arrItems.Length == 1)
|
||||||
|
list.fields[arrItems[0]] = fieldName;
|
||||||
|
else if (arrItems.Length > 1)
|
||||||
|
{
|
||||||
|
var _node = arrItems[0];
|
||||||
|
var _newPath = fieldPath.Remove(0, _node.Length + 1);
|
||||||
|
if (!list.SubNodes.TryGetValue(_node, out var _newList))
|
||||||
|
{
|
||||||
|
_newList = new RequestFieldList();
|
||||||
|
list.SubNodes.Add(_node, _newList);
|
||||||
|
}
|
||||||
|
|
||||||
|
addRequestField(_newList, _newPath, fieldName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private RequestFieldList getRequestFieldList(cDataHistoryConfigTable table)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var _result = new RequestFieldList();
|
||||||
|
|
||||||
|
foreach (var _colum in table.Columns.Values)
|
||||||
|
addRequestField(_result, _colum.SourceName, _colum.Name);
|
||||||
|
|
||||||
|
return _result;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string getUrlSelectionSubFields(string name, RequestFieldList list)
|
||||||
|
{
|
||||||
|
var _select = string.Empty;
|
||||||
|
foreach (var _entry in list.fields)
|
||||||
|
{
|
||||||
|
if (_select != string.Empty)
|
||||||
|
_select += ",";
|
||||||
|
_select += _entry.Key;
|
||||||
|
}
|
||||||
|
|
||||||
|
var _expand = string.Empty;
|
||||||
|
foreach (var _entry in list.SubNodes)
|
||||||
|
{
|
||||||
|
var _sub = getUrlSelectionSubFields(_entry.Key, _entry.Value);
|
||||||
|
if (!string.IsNullOrEmpty(_sub))
|
||||||
|
{
|
||||||
|
if (_expand != string.Empty)
|
||||||
|
_expand += ",";
|
||||||
|
_expand += _sub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var _retVal = string.Empty;
|
||||||
|
if (_select != string.Empty)
|
||||||
|
_retVal = name + "($select=" + _select + ")";
|
||||||
|
|
||||||
|
if (_expand != string.Empty)
|
||||||
|
{
|
||||||
|
if (_retVal != string.Empty)
|
||||||
|
_retVal += ",";
|
||||||
|
_retVal += name + "($expand=" + _expand + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
return _retVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string getUrlSelection(RequestFieldList list)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var _select = string.Empty;
|
||||||
|
foreach (var _entry in list.fields)
|
||||||
|
{
|
||||||
|
if (_entry.Key == "SiteId" || _entry.Key == "SiteName")
|
||||||
|
continue;
|
||||||
|
if (_select != string.Empty)
|
||||||
|
_select += ",";
|
||||||
|
_select += _entry.Key;
|
||||||
|
}
|
||||||
|
|
||||||
|
var _expand = string.Empty;
|
||||||
|
foreach (var _entry in list.SubNodes)
|
||||||
|
{
|
||||||
|
var _sub = getUrlSelectionSubFields(_entry.Key, _entry.Value);
|
||||||
|
if (!string.IsNullOrEmpty(_sub))
|
||||||
|
{
|
||||||
|
if (_expand != string.Empty)
|
||||||
|
_expand += ",";
|
||||||
|
_expand += _sub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var _result = string.Empty;
|
||||||
|
if (_select != string.Empty)
|
||||||
|
_result = "&$select=" + _select;
|
||||||
|
|
||||||
|
if (_expand != string.Empty)
|
||||||
|
_result += "&$expand=" + _expand;
|
||||||
|
|
||||||
|
return _result;
|
||||||
|
}
|
||||||
|
catch (Exception E)
|
||||||
|
{
|
||||||
|
LogException(E);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public override async Task<List<cF4SDHealthCardRawData.cHealthCardTable>> GetTableResultsVirtualAsync(List<cDataHistoryConfigTable> Tables, Dictionary<enumFasdInformationClass, cF4sdConnectorIds> Identities, DateTime RefTime, int MaxAge, bool instantly, Guid? CacheId, CancellationToken Token, cF4sdWebRequestInfo requestInfo, int LogDeep)
|
public override async Task<List<cF4SDHealthCardRawData.cHealthCardTable>> GetTableResultsVirtualAsync(List<cDataHistoryConfigTable> Tables, Dictionary<enumFasdInformationClass, cF4sdConnectorIds> Identities, DateTime RefTime, int MaxAge, bool instantly, Guid? CacheId, CancellationToken Token, cF4sdWebRequestInfo requestInfo, int LogDeep)
|
||||||
{
|
{
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
||||||
@@ -3049,118 +2847,78 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
if (!Identities.TryGetValue(enumFasdInformationClass.VirtualSession, out var session) || session?.Id is null)
|
if (!Identities.TryGetValue(enumFasdInformationClass.VirtualSession, out var session) || session?.Id is null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!Identities.TryGetValue(enumFasdInformationClass.User, out var userIds) || userIds?.citrixTenantId is null)
|
var _instance = session.Instance;
|
||||||
|
if (_instance == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var citrixTableNames = new HashSet<string>(Tables.Where(t => t?.ParentCluster?.Origin == enumDataHistoryOrigin.Citrix).Select(t => t.Name), StringComparer.Ordinal);
|
var _detailTable = Tables.Where(_t => _t.Name == constTableNameSessionDetails).First();
|
||||||
|
if (_detailTable == null)
|
||||||
bool Has(string tableName) => tableName != null && citrixTableNames.Contains(tableName);
|
|
||||||
|
|
||||||
var _userExists = Has(constTableNameSessionUser);
|
|
||||||
var _sessionExists = Has(constTableNameSession);
|
|
||||||
var _machineExists = Has(constTableNameSessionMachine);
|
|
||||||
var _connectionExists = Has(constTableNameSessionConnection);
|
|
||||||
var _currentConnectionExists = Has(constTableNameSessionCurrentConnection);
|
|
||||||
var _sessionMetricsExists = Has(constTableNameSessionMetrics);
|
|
||||||
|
|
||||||
var retVal = new List<cF4SDHealthCardRawData.cHealthCardTable>();
|
|
||||||
var listTasks = new List<Task<List<cF4SDHealthCardRawData.cHealthCardTable>>>(2);
|
|
||||||
|
|
||||||
if (_sessionExists)
|
|
||||||
//if (CacheId == null && !instantly)
|
|
||||||
//{
|
|
||||||
// retVal.Add(new cF4SDHealthCardRawData.cHealthCardTable()
|
|
||||||
// {
|
|
||||||
// Name = constTableNameSession,
|
|
||||||
// InformationClass = enumFasdInformationClass.VirtualSession,
|
|
||||||
// IsIncomplete = true
|
|
||||||
// });
|
|
||||||
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
|
||||||
|
|
||||||
if (_sessionMetricsExists)
|
|
||||||
{
|
{
|
||||||
//if (CacheId == null && !instantly)
|
// ToDo: create an empty table
|
||||||
//{
|
}
|
||||||
// retVal.Add(new cF4SDHealthCardRawData.cHealthCardTable()
|
else
|
||||||
// {
|
{
|
||||||
// Name = constTableNameSessionMetrics,
|
var _fieldList = getRequestFieldList(_detailTable);
|
||||||
// InformationClass = enumFasdInformationClass.VirtualSession,
|
var _select = getUrlSelection(_fieldList);
|
||||||
// IsIncomplete = true
|
|
||||||
// });
|
var _url = string.Format(constCitrixSession, session.Id.ToString("D")) + _select;
|
||||||
|
|
||||||
|
await ValidateConnectionsAsync(Token);
|
||||||
|
if (Token.IsCancellationRequested) return null;
|
||||||
|
|
||||||
|
if (!cachedConnections.TryGetValue(_instance, out var _conn))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var _sessionData = await _conn.Monitor.Request.RequestAsync(_url, eHttpMethod.get, null, token: Token);
|
||||||
|
if (Token.IsCancellationRequested) return null;
|
||||||
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionMetricsAsync(session.Id, userIds.citrixTenantId, requestInfo, MaxAge, LogDeep + 1, Token); }));
|
|
||||||
//listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionStateMetricsAsync(userIds, userIds.citrixTenantId, requestInfo, MaxAge, LogDeep + 1, Token); }));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (_machineExists)
|
|
||||||
//if (CacheId == null && !instantly)
|
|
||||||
//{
|
|
||||||
// retVal.Add(new cF4SDHealthCardRawData.cHealthCardTable()
|
|
||||||
// {
|
|
||||||
// Name = constTableNameSessionMachine,
|
|
||||||
// InformationClass = enumFasdInformationClass.VirtualSession,
|
|
||||||
// IsIncomplete = true
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionMachineAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
|
||||||
|
|
||||||
if (_connectionExists)
|
|
||||||
//if (CacheId == null && !instantly)
|
|
||||||
//{
|
|
||||||
// retVal.Add(new cF4SDHealthCardRawData.cHealthCardTable()
|
|
||||||
// {
|
|
||||||
// Name = constTableNameSessionConnection,
|
|
||||||
// InformationClass = enumFasdInformationClass.VirtualSession,
|
|
||||||
// IsIncomplete = true
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionConnectionsAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
|
||||||
|
|
||||||
if (_currentConnectionExists)
|
|
||||||
//if (CacheId == null && !instantly)
|
|
||||||
//{
|
|
||||||
// retVal.Add(new cF4SDHealthCardRawData.cHealthCardTable()
|
|
||||||
// {
|
|
||||||
// Name = constTableNameSessionCurrentConnection,
|
|
||||||
// InformationClass = enumFasdInformationClass.VirtualSession,
|
|
||||||
// IsIncomplete = true
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionCurrentConnectionAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
|
||||||
|
|
||||||
if (_userExists)
|
|
||||||
//if (CacheId == null && !instantly)
|
|
||||||
//{
|
|
||||||
// retVal.Add(new cF4SDHealthCardRawData.cHealthCardTable()
|
|
||||||
// {
|
|
||||||
// Name = constTableNameSessionUser,
|
|
||||||
// InformationClass = enumFasdInformationClass.VirtualSession,
|
|
||||||
// IsIncomplete = true
|
|
||||||
// });
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionUserAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
|
||||||
|
|
||||||
|
|
||||||
var arrRes = await Task.WhenAll(listTasks.ToArray());
|
|
||||||
foreach (var Entry in arrRes)
|
|
||||||
if (Entry != null)
|
|
||||||
retVal.AddRange(Entry);
|
|
||||||
|
|
||||||
|
|
||||||
if (retVal.Count == 0)
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return retVal;
|
//var citrixTableNames = new HashSet<string>(Tables.Where(t => t?.ParentCluster?.Origin == enumDataHistoryOrigin.Citrix).Select(t => t.Name), StringComparer.Ordinal);
|
||||||
|
//bool Has(string tableName) => tableName != null && citrixTableNames.Contains(tableName);
|
||||||
|
|
||||||
|
//var _userExists = Has(constTableNameSessionUser);
|
||||||
|
//var _sessionExists = Has(constTableNameSession);
|
||||||
|
//var _machineExists = Has(constTableNameSessionMachine);
|
||||||
|
//var _connectionExists = Has(constTableNameSessionConnection);
|
||||||
|
//var _currentConnectionExists = Has(constTableNameSessionCurrentConnection);
|
||||||
|
//var _sessionMetricsExists = Has(constTableNameSessionMetrics);
|
||||||
|
|
||||||
|
//var retVal = new List<cF4SDHealthCardRawData.cHealthCardTable>();
|
||||||
|
//var listTasks = new List<Task<List<cF4SDHealthCardRawData.cHealthCardTable>>>(2);
|
||||||
|
|
||||||
|
//if (_sessionExists)
|
||||||
|
// listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
||||||
|
|
||||||
|
//if (_sessionMetricsExists)
|
||||||
|
// listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionMetricsAsync(session.Id, userIds.citrixTenantId, requestInfo, MaxAge, LogDeep + 1, Token); }));
|
||||||
|
|
||||||
|
//if (_machineExists)
|
||||||
|
// listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionMachineAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
||||||
|
|
||||||
|
//if (_connectionExists)
|
||||||
|
// listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionConnectionsAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
||||||
|
|
||||||
|
//if (_currentConnectionExists)
|
||||||
|
// listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionCurrentConnectionAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
||||||
|
|
||||||
|
//if (_userExists)
|
||||||
|
// listTasks.Add(Task.Run<List<cF4SDHealthCardRawData.cHealthCardTable>>(async () => { return await GetSessionUserAsync(session.Id, userIds.citrixTenantId, requestInfo, LogDeep + 1, Token); }));
|
||||||
|
|
||||||
|
|
||||||
|
//var arrRes = await Task.WhenAll(listTasks.ToArray());
|
||||||
|
//foreach (var Entry in arrRes)
|
||||||
|
// if (Entry != null)
|
||||||
|
// retVal.AddRange(Entry);
|
||||||
|
|
||||||
|
|
||||||
|
//if (retVal.Count == 0)
|
||||||
|
// return null;
|
||||||
|
|
||||||
|
//return retVal;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
catch (Exception E)
|
||||||
@@ -3176,56 +2934,6 @@ namespace C4IT.DataHistoryProvider.Base.Modules.Citrix
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> GetCitrixSessionsAsync()
|
|
||||||
{
|
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var strUrl = string.Format(constCitrixSessionList, constCitrixUserPaging);
|
|
||||||
|
|
||||||
var systems = Collector.InfrastructureConfig.Citrix.Systems;
|
|
||||||
if (systems is null)
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(2, $" Could not logon to tenant - Tenant is null", LogLevels.Warning);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
foreach (var _system in systems)
|
|
||||||
{
|
|
||||||
if (!(_system is cDataHistoryCitrixCloudTenant Tenant))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var CitrixConn = await GetCitrixCommunicationForSystemAsync(Tenant.TenantID, true);
|
|
||||||
if (CitrixConn == null)
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(2, $"error: could not logon to tenat {Tenant.Domain}", LogLevels.Error);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var Result = await CitrixConn.Monitor.Request.RequestAsync(strUrl, eHttpMethod.get, null);
|
|
||||||
if (Result != null)
|
|
||||||
{
|
|
||||||
var _ty = Result.GetType();
|
|
||||||
var _props = Result.Result as JObject;
|
|
||||||
if (_props != null)
|
|
||||||
{
|
|
||||||
Collector.DoProcessUiMessage(3, $" properties of selected '{_props}' with {_props.Count} properties could be read.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception E)
|
|
||||||
{
|
|
||||||
LogException(E);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (CM != null) LogMethodEnd(CM);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async override Task<bool> DoScanAsync(bool Always, bool Rescan, cF4sdWebRequestInfo requestInfo, int LogDeep, CancellationToken Token, bool EnhancedDebug = false)
|
public async override Task<bool> DoScanAsync(bool Always, bool Rescan, cF4sdWebRequestInfo requestInfo, int LogDeep, CancellationToken Token, bool EnhancedDebug = false)
|
||||||
{
|
{
|
||||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
||||||
|
|||||||
@@ -1338,6 +1338,79 @@
|
|||||||
</Table>
|
</Table>
|
||||||
</DataCluster>
|
</DataCluster>
|
||||||
<DataCluster Name="citrixMetrics" Origin="Citrix" InformationClass="VirtualSession">
|
<DataCluster Name="citrixMetrics" Origin="Citrix" InformationClass="VirtualSession">
|
||||||
|
<Table Name="citrix-session-details" Type="Static" Key="Id">
|
||||||
|
<Table-Columns>
|
||||||
|
<!-- basic session properties -->
|
||||||
|
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
||||||
|
<Table-Column Name="StartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="EndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="LogOnDuration" Type="int" />
|
||||||
|
<Table-Column Name="ConnectionState" Type="int" Cardinal="64" />
|
||||||
|
<Table-Column Name="EndpointName" Type="string" Cardinal="64" />
|
||||||
|
<Table-Column Name="IsAnonymous" Type="boolean" />
|
||||||
|
|
||||||
|
<!-- machine properties -->
|
||||||
|
<Table-Column Name="Mch_Id" SourceName="Machine.Id" Type="guid" />
|
||||||
|
<Table-Column Name="Mch_Name" SourceName="Machine.Name" Type="string"/>
|
||||||
|
<Table-Column Name="Mch_DnsName" SourceName="Machine.DnsName" Type="string" />
|
||||||
|
<Table-Column Name="Mch_IPAddress" SourceName="Machine.IPAddress" Type="string" />
|
||||||
|
<Table-Column Name="Mch_HostedMachine" SourceName="Machine.HostedMachineId" Type="string" />
|
||||||
|
<Table-Column Name="Mch_IsInMaintenanceMode" SourceName="Machine.IsInMaintenanceMode" Type="boolean" />
|
||||||
|
<Table-Column Name="Mch_AgentVersion" SourceName="Machine.AgentVersion" Type="string" />
|
||||||
|
<Table-Column Name="Mch_CurrentRegistrationState" SourceName="Machine.CurrentRegistrationState" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="Mch_CurrentSessionCount" SourceName="Machine.CurrentSessionCount" Type="int" />
|
||||||
|
<Table-Column Name="Mch_WindowsConnectionSetting" SourceName="Machine.WindowsConnectionSetting" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="Mch_OSType" SourceName="Machine.OSType" Type="string" />
|
||||||
|
<Table-Column Name="Ctl_Name" SourceName="Machine.Catalog.Name" Type="string" Default="0" />
|
||||||
|
<Table-Column Name="Ctl_AllocationType" SourceName="Machine.Catalog.AllocationType" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="DGrp_Name" SourceName="Machine.DesktopGroup.Name" Type="string" />
|
||||||
|
<Table-Column Name="CLI_Cpu" SourceName="Machine.CurrentLoadIndex.Cpu" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="CLI_Memory" SourceName="Machine.CurrentLoadIndex.Memory" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="CLI_Disk" SourceName="Machine.CurrentLoadIndex.Disk" Type="int" Default="0" />
|
||||||
|
|
||||||
|
<!-- user properties -->
|
||||||
|
<Table-Column Name="Usr_Id" SourceName="User.Id" Type="int" />
|
||||||
|
<Table-Column Name="Usr_Name" SourceName="User.UserName" Type="string"/>
|
||||||
|
<Table-Column Name="Usr_FullName" SourceName="User.FullName" Type="string"/>
|
||||||
|
<Table-Column Name="Usr_Domain" SourceName="User.Domain" Type="string"/>
|
||||||
|
|
||||||
|
<!-- connection properties -->
|
||||||
|
<Table-Column Name="Con_Id" SourceName="CurrentConnection.Id" Type="guid" />
|
||||||
|
<Table-Column Name="Con_ClientName" SourceName="CurrentConnection.ClientName" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientAddress" SourceName="CurrentConnection.ClientAddress" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientVersion" SourceName="CurrentConnection.ClientVersion" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientPlatform" SourceName="CurrentConnection.ClientPlatform" Type="string" />
|
||||||
|
<Table-Column Name="Con_ConnectedViaIPAddress" SourceName="CurrentConnection.ConnectedViaIPAddress" Type="string" />
|
||||||
|
<Table-Column Name="Con_LaunchedViaHostName" SourceName="CurrentConnection.LaunchedViaHostName" Type="string" />
|
||||||
|
<Table-Column Name="Con_LogOnStartDate" SourceName="CurrentConnection.LogOnStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnEndDate" SourceName="CurrentConnection.LogOnEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_BrokeringDuration" SourceName="CurrentConnection.BrokeringDuration" Type="int" />
|
||||||
|
<Table-Column Name="Con_VMStartStartDate" SourceName="CurrentConnection.VMStartStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_VMStartEndDate" SourceName="CurrentConnection.VMStartEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_HdxStartDate" SourceName="CurrentConnection.HdxStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_HdxEndDate" SourceName="CurrentConnection.HdxEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AuthenticationDuration" SourceName="CurrentConnection.AuthenticationDuration" Type="int" />
|
||||||
|
<Table-Column Name="Con_GpoStartDate" SourceName="CurrentConnection.GpoStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_GpoEndDate" SourceName="CurrentConnection.GpoEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnScriptsStartDate" SourceName="CurrentConnection.LogOnScriptsStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnScriptsEndDate" SourceName="CurrentConnection.LogOnScriptsEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_ProfileLoadStartDate" SourceName="CurrentConnection.ProfileLoadStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_ProfileLoadEndDate" SourceName="CurrentConnection.ProfileLoadEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_InteractiveStartDate" SourceName="CurrentConnection.InteractiveStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_InteractiveEndDate" SourceName="CurrentConnection.InteractiveEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_UserInitStartDate" SourceName="CurrentConnection.UserInitStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_UserInitEndDate" SourceName="CurrentConnection.UserInitEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxAssociationStartDate" SourceName="CurrentConnection.AppxAssociationStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxAssociationEndDate" SourceName="CurrentConnection.AppxAssociationEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxLoadPackageStartDate" SourceName="CurrentConnection.AppxLoadPackageStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxLoadPackageEndDate" SourceName="CurrentConnection.AppxLoadPackageEndDate" Type="datetime" />
|
||||||
|
|
||||||
|
<!-- additional site infos from configuration-->
|
||||||
|
<Table-Column Name="SiteId" Type="guid" />
|
||||||
|
<Table-Column Name="SiteName" Type="guid" />
|
||||||
|
</Table-Columns>
|
||||||
|
</Table>
|
||||||
|
|
||||||
<Table Name="citrix-session" Type="Static" Key="Id">
|
<Table Name="citrix-session" Type="Static" Key="Id">
|
||||||
<Table-Columns>
|
<Table-Columns>
|
||||||
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
||||||
|
|||||||
@@ -1530,7 +1530,7 @@
|
|||||||
<State-Info Name="User Info" ValueTable="Computation_EmptyConstant" ValueColumn="default">
|
<State-Info Name="User Info" ValueTable="Computation_EmptyConstant" ValueColumn="default">
|
||||||
<Name Lang="DE">Benutzer-Informationen</Name>
|
<Name Lang="DE">Benutzer-Informationen</Name>
|
||||||
</State-Info>
|
</State-Info>
|
||||||
<State-Info Name="User Name" ValueTable="citrix-session-user" ValueColumn="UserName">
|
<State-Info Name="User Name" ValueTable="citrix-session-details" ValueColumn="Usr_Name">
|
||||||
<Name Lang="DE">Benutzername</Name>
|
<Name Lang="DE">Benutzername</Name>
|
||||||
</State-Info>
|
</State-Info>
|
||||||
<State-Info Name="Fullname" ValueTable="citrix-session-user" ValueColumn="FullName">
|
<State-Info Name="Fullname" ValueTable="citrix-session-user" ValueColumn="FullName">
|
||||||
|
|||||||
@@ -1338,6 +1338,79 @@
|
|||||||
</Table>
|
</Table>
|
||||||
</DataCluster>
|
</DataCluster>
|
||||||
<DataCluster Name="citrixMetrics" Origin="Citrix" InformationClass="VirtualSession">
|
<DataCluster Name="citrixMetrics" Origin="Citrix" InformationClass="VirtualSession">
|
||||||
|
<Table Name="citrix-session-details" Type="Static" Key="Id">
|
||||||
|
<Table-Columns>
|
||||||
|
<!-- basic session properties -->
|
||||||
|
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
||||||
|
<Table-Column Name="StartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="EndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="LogOnDuration" Type="int" />
|
||||||
|
<Table-Column Name="ConnectionState" Type="int" Cardinal="64" />
|
||||||
|
<Table-Column Name="EndpointName" Type="string" Cardinal="64" />
|
||||||
|
<Table-Column Name="IsAnonymous" Type="boolean" />
|
||||||
|
|
||||||
|
<!-- machine properties -->
|
||||||
|
<Table-Column Name="Mch_Id" SourceName="Machine.Id" Type="guid" />
|
||||||
|
<Table-Column Name="Mch_Name" SourceName="Machine.Name" Type="string"/>
|
||||||
|
<Table-Column Name="Mch_DnsName" SourceName="Machine.DnsName" Type="string" />
|
||||||
|
<Table-Column Name="Mch_IPAddress" SourceName="Machine.IPAddress" Type="string" />
|
||||||
|
<Table-Column Name="Mch_HostedMachine" SourceName="Machine.HostedMachineId" Type="string" />
|
||||||
|
<Table-Column Name="Mch_IsInMaintenanceMode" SourceName="Machine.IsInMaintenanceMode" Type="boolean" />
|
||||||
|
<Table-Column Name="Mch_AgentVersion" SourceName="Machine.AgentVersion" Type="string" />
|
||||||
|
<Table-Column Name="Mch_CurrentRegistrationState" SourceName="Machine.CurrentRegistrationState" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="Mch_CurrentSessionCount" SourceName="Machine.CurrentSessionCount" Type="int" />
|
||||||
|
<Table-Column Name="Mch_WindowsConnectionSetting" SourceName="Machine.WindowsConnectionSetting" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="Mch_OSType" SourceName="Machine.OSType" Type="string" />
|
||||||
|
<Table-Column Name="Ctl_Name" SourceName="Machine.Catalog.Name" Type="string" Default="0" />
|
||||||
|
<Table-Column Name="Ctl_AllocationType" SourceName="Machine.Catalog.AllocationType" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="DGrp_Name" SourceName="Machine.DesktopGroup.Name" Type="string" />
|
||||||
|
<Table-Column Name="CLI_Cpu" SourceName="Machine.CurrentLoadIndex.Cpu" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="CLI_Memory" SourceName="Machine.CurrentLoadIndex.Memory" Type="int" Default="0" />
|
||||||
|
<Table-Column Name="CLI_Disk" SourceName="Machine.CurrentLoadIndex.Disk" Type="int" Default="0" />
|
||||||
|
|
||||||
|
<!-- user properties -->
|
||||||
|
<Table-Column Name="Usr_Id" SourceName="User.Id" Type="int" />
|
||||||
|
<Table-Column Name="Usr_Name" SourceName="User.UserName" Type="string"/>
|
||||||
|
<Table-Column Name="Usr_FullName" SourceName="User.FullName" Type="string"/>
|
||||||
|
<Table-Column Name="Usr_Domain" SourceName="User.Domain" Type="string"/>
|
||||||
|
|
||||||
|
<!-- connection properties -->
|
||||||
|
<Table-Column Name="Con_Id" SourceName="CurrentConnection.Id" Type="guid" />
|
||||||
|
<Table-Column Name="Con_ClientName" SourceName="CurrentConnection.ClientName" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientAddress" SourceName="CurrentConnection.ClientAddress" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientVersion" SourceName="CurrentConnection.ClientVersion" Type="string" />
|
||||||
|
<Table-Column Name="Con_ClientPlatform" SourceName="CurrentConnection.ClientPlatform" Type="string" />
|
||||||
|
<Table-Column Name="Con_ConnectedViaIPAddress" SourceName="CurrentConnection.ConnectedViaIPAddress" Type="string" />
|
||||||
|
<Table-Column Name="Con_LaunchedViaHostName" SourceName="CurrentConnection.LaunchedViaHostName" Type="string" />
|
||||||
|
<Table-Column Name="Con_LogOnStartDate" SourceName="CurrentConnection.LogOnStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnEndDate" SourceName="CurrentConnection.LogOnEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_BrokeringDuration" SourceName="CurrentConnection.BrokeringDuration" Type="int" />
|
||||||
|
<Table-Column Name="Con_VMStartStartDate" SourceName="CurrentConnection.VMStartStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_VMStartEndDate" SourceName="CurrentConnection.VMStartEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_HdxStartDate" SourceName="CurrentConnection.HdxStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_HdxEndDate" SourceName="CurrentConnection.HdxEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AuthenticationDuration" SourceName="CurrentConnection.AuthenticationDuration" Type="int" />
|
||||||
|
<Table-Column Name="Con_GpoStartDate" SourceName="CurrentConnection.GpoStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_GpoEndDate" SourceName="CurrentConnection.GpoEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnScriptsStartDate" SourceName="CurrentConnection.LogOnScriptsStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_LogOnScriptsEndDate" SourceName="CurrentConnection.LogOnScriptsEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_ProfileLoadStartDate" SourceName="CurrentConnection.ProfileLoadStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_ProfileLoadEndDate" SourceName="CurrentConnection.ProfileLoadEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_InteractiveStartDate" SourceName="CurrentConnection.InteractiveStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_InteractiveEndDate" SourceName="CurrentConnection.InteractiveEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_UserInitStartDate" SourceName="CurrentConnection.UserInitStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_UserInitEndDate" SourceName="CurrentConnection.UserInitEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxAssociationStartDate" SourceName="CurrentConnection.AppxAssociationStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxAssociationEndDate" SourceName="CurrentConnection.AppxAssociationEndDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxLoadPackageStartDate" SourceName="CurrentConnection.AppxLoadPackageStartDate" Type="datetime" />
|
||||||
|
<Table-Column Name="Con_AppxLoadPackageEndDate" SourceName="CurrentConnection.AppxLoadPackageEndDate" Type="datetime" />
|
||||||
|
|
||||||
|
<!-- additional site infos from configuration-->
|
||||||
|
<Table-Column Name="SiteId" Type="guid" />
|
||||||
|
<Table-Column Name="SiteName" Type="guid" />
|
||||||
|
</Table-Columns>
|
||||||
|
</Table>
|
||||||
|
|
||||||
<Table Name="citrix-session" Type="Static" Key="Id">
|
<Table Name="citrix-session" Type="Static" Key="Id">
|
||||||
<Table-Columns>
|
<Table-Columns>
|
||||||
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
<Table-Column Name="Id" SourceName ="SessionKey" Type="guid" />
|
||||||
|
|||||||
@@ -1530,7 +1530,7 @@
|
|||||||
<State-Info Name="User Info" ValueTable="Computation_EmptyConstant" ValueColumn="default">
|
<State-Info Name="User Info" ValueTable="Computation_EmptyConstant" ValueColumn="default">
|
||||||
<Name Lang="DE">Benutzer-Informationen</Name>
|
<Name Lang="DE">Benutzer-Informationen</Name>
|
||||||
</State-Info>
|
</State-Info>
|
||||||
<State-Info Name="User Name" ValueTable="citrix-session-user" ValueColumn="UserName">
|
<State-Info Name="User Name" ValueTable="citrix-session-details" ValueColumn="Usr_Name">
|
||||||
<Name Lang="DE">Benutzername</Name>
|
<Name Lang="DE">Benutzername</Name>
|
||||||
</State-Info>
|
</State-Info>
|
||||||
<State-Info Name="Fullname" ValueTable="citrix-session-user" ValueColumn="FullName">
|
<State-Info Name="Fullname" ValueTable="citrix-session-user" ValueColumn="FullName">
|
||||||
|
|||||||
Reference in New Issue
Block a user