从 CVAD 核心组件上传 AOT 日志

Beginning with CVAD 2507 CU1 and CVAD 2511, AOT logs are gathered from all applicable components. The supported components include DDC, StoreFront, Citrix Director, Windows VDA, Linux VDA, Mac VDA, License Server, FAS, Cloud Connector, PVS, WEM, Session Recording, Citrix Workspace UI, and Citrix Gateway.

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

Citrix Web Studio 提供了一个集中位置,用于配置跨站点的始终在线跟踪 (AOT) 日志转发。此设置定义 AOT 日志的发送位置,并自动将配置传播到环境中的相关组件。

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

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

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

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

  • Citrix Director/Monitor
  • 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 或连接器设备上)后,完成以下步骤以在 Citrix DaaS 设置中为云部署启用日志转发到日志服务器:

AOT 日志服务器设置 1

适用于 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 服务器。

为 Citrix 连接器 配置 AOT 日志上传

要在 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 工作区应用程序 配置 AOT 日志上传

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

System requirements

  • Citrix Virtual Apps and Desktops 2511 or CVAD 2507 CU1 and later versions
  • Citrix Workspace 应用程序 2511 版本或 CWA 2507.1 CU1 版本及更高版本
  • 确保已安装所选 Citrix Workspace 应用程序 (CWA) 的所需版本。有关详细信息,请参阅支持的版本

配置 NetScaler 的 AOT 日志上传功能

  • 通过 SSH 连接到 NetScaler 的命令行界面,然后通过运行“shell”命令进入 NetScaler 的 shell 环境。
  • 请进入 /var/analytics_conf 路径所指向的特定目录。

    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-->
  • 退出 shell 并返回 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-->
  • 将 syslog 操作绑定到审计 Syslog 策略
add audit syslogPolicy {PolicyName} True {Name of the Syslog Action}
<!--NeedCopy-->

示例:

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