dellemc.openmanage.idrac_diagnostics module – Run and Export iDRAC diagnostics

Note

This module is part of the dellemc.openmanage collection (version 9.9.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.openmanage. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: dellemc.openmanage.idrac_diagnostics.

New in dellemc.openmanage 9.0.0

Synopsis

  • This module allows you to run and export diagnostics on iDRAC.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.9.6

Parameters

Parameter

Comments

ca_path

path

added in dellemc.openmanage 5.0.0

The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.

export

boolean

Exports the diagnostics information to the given share.

This operation requires share_parameters.

When run is true and job_wait is false, only then the run diagnostics job is triggered. export is ignored.

Choices:

  • false

  • true

idrac_ip

string / required

iDRAC IP Address.

idrac_password

aliases: idrac_pwd

string

iDRAC user password.

If the password is not provided, then the environment variable IDRAC_PASSWORD is used.

Example: export IDRAC_PASSWORD=password

idrac_port

integer

iDRAC port.

Default: 443

idrac_user

string

iDRAC username.

If the username is not provided, then the environment variable IDRAC_USERNAME is used.

Example: export IDRAC_USERNAME=username

job_wait

boolean

Provides the option to wait for job completion.

This is applicable when run is true and reboot_type is power_cycle.

This is applicable only to run the diagnostics job.

Choices:

  • false

  • true ← (default)

job_wait_timeout

integer

Time in seconds to wait for job completion.

This is applicable when job_wait is true.

Default: 1200

reboot_type

string

This option provides the choice to reboot the host immediately to run the diagnostics.

This is applicable when run is true.

force Forced graceful shutdown signals the operating system to turn off and wait for ten minutes. If the operating system does not turn off, the iDRAC power cycles the system.

graceful Graceful shutdown waits for the operating system to turn off and wait for the system to restart.

power_cycle performs a power cycle for a hard reset on the device.

Choices:

  • "force"

  • "graceful" ← (default)

  • "power_cycle"

resource_id

string

Id of the resource.

If the value for resource ID is not provided, the module picks the first resource ID available from the list of system resources returned by the iDRAC.

run

boolean

Run the diagnostics job on iDRAC.

Run the diagnostics job based on the run_mode and save the report in the internal storage. reboot_type is applicable.

Choices:

  • false

  • true

run_mode

string

This option provides the choices to run the diagnostics.

express The express diagnostics runs a test package for each server subsystem. However, it does not run the complete set of tests available in the package for each subsystem.

extended The extended diagnostics run all available tests in each test package for all subsystems.

long_run The long-run diagnostics runs express and extended tests.

Choices:

  • "express" ← (default)

  • "extended"

  • "long_run"

scheduled_end_time

string

Run the diagnostic until the specified end date and end time after the scheduled_start_time.

The accepted formats are yyyymmddhhmmss and YYYY-MM-DDThh:mm:ss+HH:MM.

If the run operation does not complete before the specified end time, then the operation fails.

This is applicable when run is True and reboot_type is power_cycle.

scheduled_start_time

string

Schedules the job at the specified time.

The accepted formats are yyyymmddhhmmss and YYYY-MM-DDThh:mm:ss+HH:MM.

This is applicable when run is true and reboot_type is power_cycle.

share_parameters

dictionary

Parameters that are required for the export operation of diagnostics.

share_parameters is required when export is true.

file_name

string

Diagnostics file name for export operation.

ignore_certificate_warning

string

Ignores the certificate warning while connecting to Share and is only applicable when share_type is https.

on ignores the certificate warning.

off does not ignore the certificate warning.

Choices:

  • "off" ← (default)

  • "on"

ip_address

string

IP address of the network share.

ip_address is required when share_type is nfs, cifs, http or https.

password

string

Password of the network share.

password is required when share_type is cifs.

proxy_password

string

The password of the proxy server.

proxy_password is only applicable when share_type is http or https and when proxy_support is parameters_proxy.

proxy_port

integer

The port of the proxy server.

proxy_port is only applicable when share_type is http or https and when proxy_support is parameters_proxy.

Default: 80

proxy_server

string

The IP address of the proxy server.

proxy_server is required when proxy_support is parameters_proxy.

proxy_server is only applicable when share_type is http or https and when proxy_support is parameters_proxy.

proxy_support

string

Specifies if proxy support must be used or not.

off does not use proxy settings.

default_proxy uses the default proxy settings.

parameters_proxy uses the specified proxy settings. proxy_server is required when proxy_support is parameters_proxy.

proxy_support is only applicable when share_type is http or https.

Choices:

  • "off" ← (default)

  • "default_proxy"

  • "parameters_proxy"

proxy_type

string

The proxy type of the proxy server.

http to select HTTP proxy.

socks to select SOCKS proxy.

proxy_type is only applicable when share_type is http or https and when proxy_support is parameters_proxy.

Choices:

  • "http" ← (default)

  • "socks"

proxy_username

string

The username of the proxy server.

proxy_username is only applicable when share_type is http or https and when proxy_support is parameters_proxy.

share_name

string

Network share or local path of the diagnostics file.

share_type

string

Share type of the network share.

local uses local path for export operation.

nfs uses NFS share for export operation.

cifs uses CIFS share for export operation.

http uses HTTP share for export operation.

https uses HTTPS share for export operation.

Choices:

  • "local" ← (default)

  • "nfs"

  • "cifs"

  • "http"

  • "https"

username

string

Username of the network share.

username is required when share_type is cifs.

workgroup

string

Workgroup of the network share.

workgroup is applicable only when share_type is cifs.

timeout

integer

added in dellemc.openmanage 5.0.0

The socket level timeout in seconds.

Default: 30

validate_certs

boolean

added in dellemc.openmanage 5.0.0

If false, the SSL certificates will not be validated.

Configure false only on personally controlled sites where self-signed certificates are used.

Prior to collection version 5.0.0, the validate_certs is false by default.

Choices:

  • false

  • true ← (default)

x_auth_token

string

added in dellemc.openmanage 9.3.0

Authentication token.

If the x_auth_token is not provided, then the environment variable IDRAC_X_AUTH_TOKEN is used.

Example: export IDRAC_X_AUTH_TOKEN=x_auth_token

Notes

Note

  • Run this module from a system that has direct access to Dell iDRAC.

  • This module supports only iDRAC9 and above.

  • This module supports IPv4 and IPv6 addresses.

  • This module supports check_mode.

  • This module requires ‘Dell Diagnostics’ firmware package to be present on the server.

  • When share_type is local for export operation, job_details are not displayed.

Examples

---
- name: Run and export the diagnostics to local path
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    run: true
    export: true
    share_parameters:
      share_type: "local"
      share_path: "/opt/local/diagnostics/"
      file_name: "diagnostics.txt"

- name: Run the diagnostics with power cycle reboot on schedule
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    run: true
    run_mode: "express"
    reboot_type: "power_cycle"
    scheduled_start_time: 20240101101015

- name: Run and export the diagnostics to HTTPS share
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    run: true
    export: true
    share_parameters:
      share_type: "HTTPS"
      ignore_certificate_warning: "on"
      share_name: "/share_path/diagnostics_collection_path"
      ip_address: "192.168.0.2"
      file_name: "diagnostics.txt"

- name: Run and export the diagnostics to NFS share
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    run: true
    export: true
    share_parameters:
      share_type: "NFS"
      share_name: "nfsshare/diagnostics_collection_path/"
      ip_address: "192.168.0.3"
      file_name: "diagnostics.txt"

- name: Export the diagnostics to CIFS share
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    export: true
    share_parameters:
      share_type: "CIFS"
      share_name: "/cifsshare/diagnostics_collection_path/"
      ip_address: "192.168.0.4"
      file_name: "diagnostics.txt"

- name: Export the diagnostics to HTTPS share via proxy
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    export: true
    share_parameters:
      share_type: "HTTPS"
      share_name: "/share_path/diagnostics_collection_path"
      ignore_certificate_warning: "on"
      ip_address: "192.168.0.2"
      file_name: "diagnostics.txt"
      proxy_support: parameters_proxy
      proxy_type: http
      proxy_server: "192.168.0.5"
      proxy_port: 1080
      proxy_username: "proxy_user"
      proxy_password: "proxy_password"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

diagnostics_file_path

string

Returns the full path of the diagnostics file.

Returned: For export operation

Sample: "/share_path/diagnostics_collection_path/diagnostics.txt"

error_info

dictionary

Details of the HTTP Error.

Returned: on HTTP error

Sample: {"error": {"@Message.ExtendedInfo": [{"Message": "A Remote Diagnostic (ePSA) job already exists.", "MessageArgs": [], "MessageArgs@odata.count": 0, "MessageId": "IDRAC.2.9.SYS098", "RelatedProperties": [], "RelatedProperties@odata.count": 0, "Resolution": "A response action is not required if the scheduled start time of the existing Remote Diagnostic (ePSA) job is ok. Else, delete the existing Diagnostics (ePSA) job and recreate another with an appropriate start time.", "Severity": "Informational"}], "code": "Base.1.12.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information."}}

job_details

dictionary

Returns the output for status of the job.

Returned: For run and export operations

Sample: {"ActualRunningStartTime": "2024-01-10T10:14:31", "ActualRunningStopTime": "2024-01-10T10:26:34", "CompletionTime": "2024-01-10T10:26:34", "Description": "Job Instance", "EndTime": "2024-01-10T10:30:15", "Id": "JID_XXXXXXXXXXXX", "JobState": "Completed", "JobType": "RemoteDiagnostics", "Message": "Job completed successfully.", "MessageArgs": [], "MessageArgs@odata.count": 0, "MessageId": "SYS018", "Name": "Remote Diagnostics", "PercentComplete": 100, "StartTime": "2024-01-10T10:12:15", "TargetSettingsURI": null}

msg

string

Status of the diagnostics operation.

Returned: always

Sample: "Successfully ran and exported the diagnostics."

Authors

  • Shivam Sharma(@ShivamSh3)