dellemc.openmanage.ome_diagnostics 模块 – 将技术支持日志 (TSR) 导出到网络共享位置

注意

此模块是 dellemc.openmanage 集合 (版本 9.9.0) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install dellemc.openmanage。您需要其他要求才能使用此模块,有关详细信息,请参阅 要求

要在剧本中使用它,请指定:dellemc.openmanage.ome_diagnostics

dellemc.openmanage 3.6.0 中的新增功能

概要

  • 此模块允许将 SupportAssist 收集日志从 OpenManage Enterprise 和 OpenManage Enterprise Modular 以及应用程序日志从 OpenManage Enterprise Modular 导出到 CIFS 或 NFS 共享。

要求

执行此模块的主机需要以下要求。

  • python >= 3.9.6

参数

参数

注释

ca_path

路径

dellemc.openmanage 5.0.0 中添加

包含用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。

device_group_name

字符串

要导出 support_assist_collectionsupportassist_collection 日志的设备组的名称,这些日志包含组内所有设备的日志。

这适用于 support_assist_collectionsupportassist_collection 日志。

此选项不适用于 OpenManage Enterprise Modular。

此选项与 _device_ids_ 和 _device_service_tags_ 互斥。

device_ids

列表 / 元素=整数

目标设备 ID 列表。

这适用于 support_assist_collectionsupportassist_collection 日志。

此选项与 _device_service_tags_ 和 _device_group_name_ 互斥。

device_service_tags

列表 / 元素=字符串

目标标识符列表。

这适用于 support_assist_collectionsupportassist_collection 日志。

此选项与 _device_ids_ 和 _device_group_name_ 互斥。

hostname

字符串 / 必需

OpenManage Enterprise 或 OpenManage Enterprise Modular 的 IP 地址或主机名。

job_wait

布尔值

是否等待作业完成。

最大等待时间为 _job_wait_timeout_。

选项

  • false

  • true ← (默认)

job_wait_timeout

整数

_job_wait_ 的最大等待时间(分钟)。

此选项适用于 _job_wait_ 为 true 的情况。

默认值: 60

lead_chassis_only

布尔值

仅从主机箱提取日志。

_lead_chassis_only_ 仅适用于 OpenManage Enterprise Modular 上 _log_type_ 为 application 的情况。

选项

  • false ← (默认)

  • true

log_selectors

列表 / 元素=字符串

默认情况下,SupportAssist 日志仅包含硬件日志。要收集其他日志(例如操作系统日志、RAID 日志或调试日志),请在选项列表中指定要收集的日志类型。

如果未指定日志类型,则仅导出硬件日志。

OS_LOGS 用于收集操作系统日志。

RAID_LOGS 用于收集 RAID 控制器日志。

DEBUG_LOGS 用于收集调试日志。

此选项仅适用于 _log_type_ 的 support_assist_collectionsupportassist_collection

选项

  • "OS_LOGS"

  • "RAID_LOGS"

  • "DEBUG_LOGS"

log_type

字符串

application 适用于 OpenManage Enterprise Modular,用于导出应用程序日志包。

support_assist_collectionsupportassist_collection 适用于一个或多个设备,用于导出 SupportAssist 日志。

support_assist_collectionsupportassist_collection 支持 OpenManage Enterprise 和 OpenManage Enterprise Modular。

support_assist_collectionsupportassist_collection 不支持从 OpenManage Enterprise 导出 OS_LOGS。如果尝试导出,任务将完成并出现错误,模块将失败。

选项

  • "application"

  • "support_assist_collection" ← (默认)

  • "supportassist_collection"

mask_sensitive_info

布尔值

选择此选项可以屏蔽个人身份信息,例如 IP 地址、DNS、警报目标、电子邮件、网关、inet6、MAC 地址、网络掩码等。

此选项适用于 _log_type_ 的 application

选项

  • false ← (默认)

  • true

password

字符串

OpenManage Enterprise 或 OpenManage Enterprise Modular 密码。

如果未提供密码,则使用环境变量 OME_PASSWORD

示例:export OME_PASSWORD=password

port

整数

打开 OpenManage Enterprise 或 OpenManage Enterprise Modular 的 HTTPS 端口。

默认值: 443

share_address

字符串 / 必需

网络共享 IP 地址。

share_domain

字符串

网络共享域名。

此选项适用于 CIFS 类型的 share_type

share_name

字符串 / 必需

网络共享路径。

文件名会自动生成,无需作为 share_name 的一部分提供。

share_password

字符串

网络共享密码

此选项适用于 CIFS 类型的 share_type

share_type

字符串 / 必需

网络共享类型

选项

  • "NFS"

  • "CIFS"

share_user

字符串

网络共享用户名。

此选项适用于 CIFS 类型的 share_type

test_connection

布尔值

测试网络共享位置的可用性。

job_waitjob_wait_timeout 选项不适用于 test_connection

选项

  • false ← (默认)

  • true

timeout

整数

dellemc.openmanage 5.0.0 中添加

套接字级别超时(秒)。

默认值: 30

username

字符串

OpenManage Enterprise 或 OpenManage Enterprise Modular 用户名。

如果未提供用户名,则使用环境变量 OME_USERNAME

示例:export OME_USERNAME=username

validate_certs

布尔值

dellemc.openmanage 5.0.0 中添加

如果为 false,则不会验证 SSL 证书。

仅在使用自签名证书的个人控制站点上配置 false

在集合版本 5.0.0 之前,validate_certs 默认值为 false

选项

  • false

  • true ← (默认)

x_auth_token

字符串

在 dellemc.openmanage 9.3.0 中添加

身份验证令牌。

如果未提供 x_auth_token,则使用环境变量 OME_X_AUTH_TOKEN

示例:export OME_X_AUTH_TOKEN=x_auth_token

备注

注意

  • 从可以直接访问 OpenManage Enterprise 的系统运行此模块。

  • 此模块执行测试连接和设备验证。它不会在检查模式下创建用于复制日志的作业,并且始终报告为发现更改。

  • 此模块支持 check_mode

示例

---
- name: Export application log using CIFS share location
  dellemc.openmanage.ome_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    share_type: CIFS
    share_address: "192.168.0.2"
    share_user: share_username
    share_password: share_password
    share_name: cifs_share
    log_type: application
    mask_sensitive_info: false
    test_connection: true

- name: Export application log using NFS share location
  dellemc.openmanage.ome_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    share_address: "192.168.0.3"
    share_type: NFS
    share_name: nfs_share
    log_type: application
    mask_sensitive_info: true
    test_connection: true

- name: Export SupportAssist log using CIFS share location
  dellemc.openmanage.ome_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    share_address: "192.168.0.3"
    share_user: share_username
    share_password: share_password
    share_name: cifs_share
    share_type: CIFS
    log_type: support_assist_collection
    device_ids: [10011, 10022]
    log_selectors: [OS_LOGS]
    test_connection: true

- name: Export SupportAssist log using NFS share location
  dellemc.openmanage.ome_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "/path/to/ca_cert.pem"
    share_address: "192.168.0.3"
    share_type: NFS
    share_name: nfs_share
    log_type: support_assist_collection
    device_group_name: group_name
    test_connection: true

返回值

常见的返回值已在 此处 记录,以下是此模块特有的字段

描述

error_info

字典

HTTP 错误的详细信息。

返回:HTTP 错误时

示例: {"error": {"@Message.ExtendedInfo": [{"Message": "Unable to process the request because an error occurred.", "MessageArgs": [], "MessageId": "GEN1234", "RelatedProperties": [], "Resolution": "Retry the operation. If the issue persists, contact your system administrator.", "Severity": "Critical"}], "code": "Base.1.0.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information."}}

job_status

字典

导出日志操作状态的详细信息。

返回:成功

示例: {"Builtin": false, "CreatedBy": "root", "Editable": true, "EndTime": "None", "Id": 12778, "JobDescription": "Export device log", "JobName": "Export Log", "JobStatus": {"Id": 2080, "Name": "New"}, "JobType": {"Id": 18, "Internal": false, "Name": "DebugLogs_Task"}, "LastRun": "2021-07-06 10:52:50.519", "LastRunStatus": {"Id": 2060, "Name": "Completed"}, "NextRun": "None", "Params": [{"JobId": 12778, "Key": "maskSensitiveInfo", "Value": "FALSE"}, {"JobId": 12778, "Key": "password", "Value": "tY86w7q92u0QzvykuF0gQQ"}, {"JobId": 12778, "Key": "userName", "Value": "administrator"}, {"JobId": 12778, "Key": "shareName", "Value": "iso"}, {"JobId": 12778, "Key": "OPERATION_NAME", "Value": "EXTRACT_LOGS"}, {"JobId": 12778, "Key": "shareType", "Value": "CIFS"}, {"JobId": 12778, "Key": "shareAddress", "Value": "100.96.32.142"}], "Schedule": "startnow", "StartTime": "None", "State": "Enabled", "Targets": [{"Data": "", "Id": 10053, "JobId": 12778, "TargetType": {"Id": 1000, "Name": "DEVICE"}}], "UpdatedBy": "None", "UserGenerated": true, "Visible": true}

msg

字符串

导出日志的总体状态。

返回:始终

示例: "Export log job completed successfully."

作者

  • Felix Stephen (@felixs88)

  • Sachin Apagundi (@sachin-apa)