Citrix Virtual Apps and Desktops

从 CVAD 核心组件上传 AOT 日志

从 CVAD 2507 CU1 和 CVAD 2511 开始,AOT 日志将从所有适用的组件中收集。支持的组件包括 DDC、StoreFront、Citrix 导向器、Windows VDA、Linux VDA、Mac VDA、许可证服务器、FAS、云连接器、PVS、WEM、会话录制、Citrix 工作区用户界面和 Citrix 网关。

通过 Citrix Web Studio 为本地 CVAD 集中配置日志转发

Citrix Web Studio 提供了一个集中位置,用于配置整个站点的 Always-on Tracing (AOT) 日志转发。此设置定义了 AOT 日志的发送位置,并自动将配置传播到环境中的相关组件。

在 Web Studio 中配置日志服务器时:

  • 配置将写入站点数据库
  • Delivery Controller 检索更新的设置并将其分发给所选交付组中的 VDA。
  • VDA 使用收到的配置将其 AOT 日志转发到指定的日志服务器。
  • 参与 AOT 日志记录的 StoreFront 通过相同的集中机制接收必要的详细信息。
  • Director 使用提供的 AuthKey 和日志服务器详细信息来查询和显示 AOT 日志,以进行监视和故障排除。

这种集中式方法消除了单独配置每个组件的需要。您只需在 Web Studio 中设置一次日志服务器详细信息,Citrix 就会自动将配置传播到整个站点。

以下是配置在 Web Studio 中设置后将获取日志服务器详细信息的组件列表:

  • Citrix 导向器/监控
  • Citrix 交付控制器
  • Windows 虚拟投递代理
  • Linux 虚拟交付代理
  • Mac 虚拟交付代理
  • 思杰店面
  • 会话录制代理
  • 思杰工作区应用程序

配置本地部署环境的日志服务器设置

AOT 日志服务器设置

  1. 登录 Web Studio 并在左侧窗格中选择设置
  2. 日志服务器磁贴中,如果未配置日志服务器,请选择添加
  3. 日志服务器页面上,打开启用日志转发到日志服务器
  4. 输入日志服务器地址端口。VDA 和交付控制器使用此信息转发 AOT 日志。

    注意:

    1. 如果您使用 Citrix Connector Appliance 部署日志服务器,请确保仅配置端口 443。

    2. 在 Citrix Studio 中更新日志服务器地址和端口最初有效,但如果您重新访问设置并在未重新输入身份验证密钥的情况下修改日志服务器详细信息,则身份验证密钥占位符在保存后会变为空,即使操作看起来成功。这会导致 Director 和 Monitor 中出现缺失或无效的配置。作为一种解决方法,在修改日志服务器设置时,请务必重新输入并验证身份验证密钥,直到此问题解决。

  5. 选择哪些组件转发日志:

    1. 包括交付控制器:从所有交付控制器发送 AOT 日志。

    2. 选择交付组:从所选交付组中的 VDA 发送日志。

      • 所有交付组:从所有 VDA 发送日志。
      • 选择特定交付组:选择要包括的单个交付组。
  6. 输入在日志服务器上生成的 AuthKey。dDirector 使用此密钥进行身份验证和检索日志。
  7. 选择 保存 以应用配置。

对现有配置进行修改

要更新日志服务器或修改日志记录范围,请转至 设置 > 日志服务器,然后选择 编辑

通过 DaaS 设置配置 Citrix DaaS/云环境的日志服务器设置

始终在线跟踪 (AOT) 支持本地 (CVAD) 和 Citrix DaaS(云)部署。但是,日志收集行为因组件托管位置而异。

在安装和配置 AOT 日志服务器(在 Linux、Windows 或 Connector Appliance 上)后,完成以下步骤以在 Citrix DaaS 设置中为云部署启用日志转发到日志服务器:

AOT 日志服务器设置 1(/zh-cn/citrix-virtual-apps-desktops/2511/media/aot-log-server-settings1.png)

适用于 DaaS 的 Citrix Web Studio(DaaS 设置)提供了一个集中位置,用于配置云管理站点的始终在线跟踪 (AOT) 日志转发。此配置决定了 AOT 日志的发送位置,并控制哪些 VDA 参与日志转发。Monitor 使用这些设置来检索和显示日志以进行故障排除。

  1. 登录适用于 DaaS 的 Web Studio(DaaS 设置),然后在左侧窗格中选择 设置
  2. 日志服务器 磁贴中,如果当前未配置日志服务器,请选择 添加
  3. 在“日志服务器”页面上,输入“日志服务器地址”和“端口”。VDA 使用此信息将 AOT 日志转发到服务器。
  4. 定义哪些 VDA 转发日志:

    1. 选择“选择交付组”以控制范围。
    2. 所有交付组”(默认)转发站点中所有 VDA 的日志。
    3. 要定位特定的 VDA,请选择“选择特定交付组”,然后选择要包含的交付组。

    注意:

    如果您正在使用 Citrix Connector Appliance 部署日志服务器,请确保仅配置端口 443。

  5. 选择部署日志服务器的区域(资源位置)。
  6. 输入日志服务器生成的 Authkey。Monitor 使用此密钥进行身份验证并检索日志以供显示。
  7. 选择“保存”以应用配置。

针对其他组件的日志转发配置

配置会话录制服务器的 AOT 日志上传

您可以通过在会话录制服务器计算机上运行以下 PowerShell 命令,将会话录制服务器配置为将 AOT 日志上传到中央日志服务器:

#Enable - run following command in Session Recording Server PowerShell
Enable-CitrixAOTUpload -AotDataStoreEndpoint <server address>:<server port> -Role SessionRecording

#Disable - run following command in Session Recording Server PowerShell
Disable-CitrixAOTUpload
<!--NeedCopy-->

配置 FAS 的 AOT 日志上传

您可以通过在 FAS 服务器上运行以下 PowerShell 命令,将 FAS 配置为将 AOT 日志上传到中央日志服务器:

#Enable - run following command in FAS PowerShell
Enable-CitrixAOTUpload -AotDataStoreEndpoint <server address>:<server port> -Role FAS

#Disable - run following command in FAS PowerShell
Disable-CitrixAOTUpload
<!--NeedCopy-->

配置 PVS 的 AOT 日志上传

您可以通过在 PVS 服务器上运行以下 PowerShell 命令,将 PVS 配置为将 AOT 日志上传到中央日志服务器:

#Enable - run following command in PVS PowerShell
Enable-CitrixAOTUpload -AotDataStoreEndpoint <server address>:<server port> -Role PVS

#Disable - run following command in PVS PowerShell
Disable-CitrixAOTUpload
<!--NeedCopy-->

注意:

如果您有多个 PVS 服务器,请在每个服务器上运行该命令以启用或禁用 AOT 日志上传。

上传许可证服务器的 AOT 日志

  • The Logserver URL needs to be updated inside SLS config file, which can be find at the location “C:\Program Files (x86)\Citrix\Licensing\WebServicesForLicensing\SimpleLicenseServiceConfig.xml” with XML tag “AotServerURL”

示例:

<AotServerURL>https://10.110.249.168:8443/ctxlogserver/UploadCitrixLogStream</AotServerURL>
<!--NeedCopy-->
  • 许可证服务器会自动定期将日志上传到 AOT 服务器。

Configure AOT logs upload for Citrix Connector

要在 AOT 日志服务器中收集 Cloud Connector 日志,需要满足以下要求:

  • Cloud Connector 必须是 版本 6.157.0.19398 或更高版本

  • Cloud DDC 部署中,日志服务器配置详细信息会随 5 月版本 (DDC 128) 自动同步到注册表,无需手动配置。

  • 混合部署(本地 DDC)中,需要手动配置注册表才能启用日志收集。在 Cloud Connector 计算机上创建以下注册表项:

路径HKLM\Software\Citrix\ConfigSyncService

条目

  • LogServerEnabled (REG_DWORD) = 1

  • LogServerEndpoint (REG_SZ) = <https://<logserver-fqdn>:<port>>

配置适用于 Citrix Workspace 应用程序的 AOT 日志上传

Citrix 允许 Citrix Workspace 应用程序客户端自动将诊断日志上传到集中式日志服务器。此功能通过向管理员提供客户端诊断信息的即时访问权限,而无需手动收集日志,从而提高了故障排除效率。客户端 AOT 将自动上传,并在整个 CVAD 环境中启用 AOT 功能以及用户启动资源时触发。

系统必备条件

  • Citrix 虚拟应用和桌面 2511 或 CVAD 2507 CU1 及更高版本
  • Citrix Workspace 应用程序 2511 或 CWA 2507.1 累积更新 1 及更高版本
  • 确保已安装所选 Citrix Workspace 应用程序 (CWA) 的所需版本。有关详细信息,请参阅 支持的版本

配置适用于 NetScaler 的 AOT 日志上传

  • 通过 SSH 连接到 NetScaler 命令行界面,然后运行“shell”命令进入 NetScaler 命令行外壳。
  • Go into /var/analytics_conf directory

    cd /var/analytics_conf
    <!--NeedCopy-->
    
  • Generate the schema file by executing an interactive python script “python {auditlog_schema_generator_for_hec_export.py}”. The schema file defines the HTTP headers (Auth-token, User-Agent etc) and Payload attributes (Role, Machine IP etc).

此脚本生成的输出的示例片段

root@Raju-adc2# python auditlog_schema_generator_for_hec_export.py
Schema Builder: Follow the prompts to define your schema.
Include 'Auth-Token'? (Y/n):
Enter the display name (alias) for 'Auth-Token' (press Enter to keep as is): Authkey
'Auth-Token' can only go in 'header'. Automatically selected.
Include 'HostName'? (Y/n): n
Include 'Content-type'? (Y/n): y
Enter the display name (alias) for 'Content-type' (press Enter to keep as is):
'Content-type' can only go in 'header'. Automatically selected.
Default value for 'Content-type' is 'application/json'.
Do you want to change it? (y/N):
Include 'User-agent'? (Y/n):
Enter the display name (alias) for 'User-agent' (press Enter to keep as is):
'User-agent' can only go in 'header'. Automatically selected.
Default value for 'User-agent' is 'AUDITLOGS/1.0'.
Do you want to change it? (y/N):
Include 'Role'? (Y/n): y
Enter the display name (alias) for 'Role' (press Enter to keep as is):
Where should 'Role' be included? (HEADER/payload): HEADER
Default value for 'Role' is 'GW'.
Do you want to change it? (y/N): y
Enter new default value for 'Role': Gateway
<!--NeedCopy-->

生成的示例架构文件

{
     "Header": {
         "Auth-Token": {
             "name": "AuthKey"
         },
         "Content-type": {
             "name": "Content-type",
             "value": "application/json"
         },
         "User-agent": {
             "name": "User-agent",
             "value": "AUDITLOGS/1.0"
         },
         "Role": {
             "name": "Role",
             "value": "Gateway"
         },
         "MachineIP": {
             "name": "MachineIP"
         },
         "MachineName": {
             "name": "MachineName"
         }
     },
     "Payload": {
         "LogLevel": "Level",
         "MessageContent": "Message",
         "ModuleName": "Module",
         "Time": "TimeStamp"
     },
     "Format": {
         "delimiter": ""
     }
 }
<!--NeedCopy-->
  • 退出命令行并返回 NetScaler 命令行界面
  • 创建 syslog 操作,它定义了 Syslog 服务器、端口和架构文件(在上一步中创建)等
add audit syslogAction {Action Name} {AOT Server IP/FQDN} -serverPort {Destination Port} -logLevel {Log Level} -transport HTTP -httpAuthToken {Authentication Token generated on the AOT sever} -httpEndpointUrl {AOT Server URL where logs will be sent} -httpSchemaFile {Schema File created in Previous Step}
<!--NeedCopy-->

示例:

add audit syslogAction act1 10.102.154.196 -serverPort 8088 -logLevel ALL -transport HTTP -httpAuthToken fbb94d5b234d86a6cb155e3f808dd33c9698a0d1a866e814573b1909e4c9e56896f433da1071e3276bd133269fd69203d8f29166816f4d427e709773ceb9d41d531043331f7f76 -httpEndpointUrl "/services/collector/event" -httpSchemaFile sample.json
<!--NeedCopy-->
  • 将 syslogAction 绑定到审计系统日志策略
add audit syslogPolicy {PolicyName} True {Name of the Syslog Action}
<!--NeedCopy-->

示例:

add audit syslogPolicy pol1 true act1
<!--NeedCopy-->
从 CVAD 核心组件上传 AOT 日志