1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
|
.. _ome_diagnostics_module:
ome_diagnostics -- Export technical support logs(TSR) to network share location
===============================================================================
.. contents::
:local:
:depth: 1
Synopsis
--------
This module allows to export SupportAssist collection logs from OpenManage Enterprise and OpenManage Enterprise Modular and application logs from OpenManage Enterprise Modular to a CIFS or NFS share.
Requirements
------------
The below requirements are needed on the host that executes this module.
- python \>= 3.9.6
Parameters
----------
device_ids (optional, list, None)
List of target device IDs.
This is applicable for \ :literal:`support\_assist\_collection`\ and \ :literal:`supportassist\_collection`\ logs.
This option is mutually exclusive with \ :emphasis:`device\_service\_tags`\ and \ :emphasis:`device\_group\_name`\ .
device_service_tags (optional, list, None)
List of target identifier.
This is applicable for \ :literal:`support\_assist\_collection`\ and \ :literal:`supportassist\_collection`\ logs.
This option is mutually exclusive with \ :emphasis:`device\_ids`\ and \ :emphasis:`device\_group\_name`\ .
device_group_name (optional, str, None)
Name of the device group to export \ :literal:`support\_assist\_collection`\ or \ :literal:`supportassist\_collection`\ logs of all devices within the group.
This is applicable for \ :literal:`support\_assist\_collection`\ and \ :literal:`supportassist\_collection`\ logs.
This option is not applicable for OpenManage Enterprise Modular.
This option is mutually exclusive with \ :emphasis:`device\_ids`\ and \ :emphasis:`device\_service\_tags`\ .
log_type (optional, str, support_assist_collection)
\ :literal:`application`\ is applicable for OpenManage Enterprise Modular to export the application log bundle.
\ :literal:`support\_assist\_collection`\ and \ :literal:`supportassist\_collection`\ is applicable for one or more devices to export SupportAssist logs.
\ :literal:`support\_assist\_collection`\ and \ :literal:`supportassist\_collection`\ supports both OpenManage Enterprise and OpenManage Enterprise Modular.
\ :literal:`support\_assist\_collection`\ and \ :literal:`supportassist\_collection`\ does not support export of \ :literal:`OS\_LOGS`\ from OpenManage Enterprise. If tried to export, the tasks will complete with errors, and the module fails.
mask_sensitive_info (optional, bool, False)
Select this option to mask the personal identification information such as IPAddress, DNS, alert destination, email, gateway, inet6, MacAddress, netmask etc.
This option is applicable for \ :literal:`application`\ of \ :emphasis:`log\_type`\ .
log_selectors (optional, list, None)
By default, the SupportAssist logs contain only hardware logs. To collect additional logs such as OS logs, RAID logs or Debug logs, specify the log types to be collected in the choices list.
If the log types are not specified, only the hardware logs are exported.
\ :literal:`OS\_LOGS`\ to collect OS Logs.
\ :literal:`RAID\_LOGS`\ to collect RAID controller logs.
\ :literal:`DEBUG\_LOGS`\ to collect Debug logs.
This option is applicable only for \ :literal:`support\_assist\_collection`\ and \ :literal:`supportassist\_collection`\ of \ :emphasis:`log\_type`\ .
share_address (True, str, None)
Network share IP address.
share_name (True, str, None)
Network share path.
Filename is auto generated and should not be provided as part of \ :emphasis:`share\_name`\ .
share_type (True, str, None)
Network share type
share_user (optional, str, None)
Network share username.
This option is applicable for \ :literal:`CIFS`\ of \ :emphasis:`share\_type`\ .
share_password (optional, str, None)
Network share password
This option is applicable for \ :literal:`CIFS`\ of \ :emphasis:`share\_type`\ .
share_domain (optional, str, None)
Network share domain name.
This option is applicable for \ :literal:`CIFS`\ if \ :emphasis:`share\_type`\ .
job_wait (optional, bool, True)
Whether to wait for the Job completion or not.
The maximum wait time is \ :emphasis:`job\_wait\_timeout`\ .
job_wait_timeout (optional, int, 60)
The maximum wait time of \ :emphasis:`job\_wait`\ in minutes.
This option is applicable \ :emphasis:`job\_wait`\ is true.
test_connection (optional, bool, False)
Test the availability of the network share location.
\ :emphasis:`job\_wait`\ and \ :emphasis:`job\_wait\_timeout`\ options are not applicable for \ :emphasis:`test\_connection`\ .
lead_chassis_only (optional, bool, False)
Extract the logs from Lead chassis only.
\ :emphasis:`lead\_chassis\_only`\ is only applicable when \ :emphasis:`log\_type`\ is \ :literal:`application`\ on OpenManage Enterprise Modular.
hostname (True, str, None)
OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname.
username (False, str, None)
OpenManage Enterprise or OpenManage Enterprise Modular username.
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used.
Example: export OME\_USERNAME=username
password (False, str, None)
OpenManage Enterprise or OpenManage Enterprise Modular password.
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used.
Example: export OME\_PASSWORD=password
x_auth_token (False, str, None)
Authentication token.
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used.
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token
port (optional, int, 443)
OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port.
validate_certs (optional, bool, True)
If \ :literal:`false`\ , the SSL certificates will not be validated.
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used.
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default.
ca_path (optional, path, None)
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.
timeout (optional, int, 30)
The socket level timeout in seconds.
Notes
-----
.. note::
- Run this module from a system that has direct access to OpenManage Enterprise.
- This module performs the test connection and device validations. It does not create a job for copying the logs in check mode and always reports as changes found.
- This module supports \ :literal:`check\_mode`\ .
Examples
--------
.. code-block:: yaml+jinja
---
- 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
Return Values
-------------
msg (always, str, Export log job completed successfully.)
Overall status of the export log.
jog_status (success, dict, {'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', 'Schedule': 'startnow', 'StartTime': 'None', 'State': 'Enabled', 'UpdatedBy': 'None', 'UserGenerated': True, 'Visible': True, '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'}], 'Targets': [{'Data': '', 'Id': 10053, 'JobId': 12778, 'TargetType': {'Id': 1000, 'Name': 'DEVICE'}}]})
Details of the export log operation status.
error_info (on HTTP error, dict, {'error': {'code': 'Base.1.0.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information.', '@Message.ExtendedInfo': [{'MessageId': 'GEN1234', 'RelatedProperties': [], 'Message': 'Unable to process the request because an error occurred.', 'MessageArgs': [], 'Severity': 'Critical', 'Resolution': 'Retry the operation. If the issue persists, contact your system administrator.'}]}})
Details of the HTTP Error.
Status
------
Authors
~~~~~~~
- Felix Stephen (@felixs88)
- Sachin Apagundi(@sachin-apa)
|