dellemc.openmanage.idrac_session_info module – Query iDRAC session information
Note
This module is part of the dellemc.openmanage collection (version 11.0.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_session_info.
New in dellemc.openmanage 9.13.0
Synopsis
This module queries active iDRAC sessions, session service configuration, and session limits with utilization reporting.
Supports client-side filtering by session type, username, and stale threshold.
This module is read-only and does not modify any state on the iDRAC.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.9.6
Parameters
Parameter |
Comments |
|---|---|
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
|
SHA-256 fingerprint of the expected TLS certificate (hex digest, with or without colons). When supplied together with |
|
If Choices:
|
|
iDRAC IP Address. |
|
iDRAC user password. If the password is not provided, then the environment variable |
|
iDRAC port. Default: |
|
iDRAC username. If the username is not provided, then the environment variable |
|
Filter sessions by DMTF SessionType enum value. Case-insensitive matching. Valid values include Choices:
|
|
Flag sessions older than the specified number of minutes as stale. Must be a positive integer. Session age is computed from |
|
The socket level timeout in seconds. Default: |
|
Filter sessions by username substring match. Case-insensitive matching. |
|
If Configure Choices:
|
Notes
Note
Run this module from a system that has direct access to Dell iDRAC.
This module supports IPv4 and IPv6 addresses.
This module supports
check_mode.Minimum firmware requirements - iDRAC9 >= 7.10.90.00, iDRAC10 >= 1.20.50.50.
Session age is computed from
CreatedTimeand is a proxy for idle time.Output is structured JSON via
exit_json(). To export as CSV or text, use Ansible native filters (to_json,to_nice_yaml) or Jinja2 templates.
Examples
---
- name: Query all active iDRAC sessions
dellemc.openmanage.idrac_session_info:
idrac_ip: 198.162.0.1
idrac_user: admin
idrac_password: password
ca_path: "/path/to/ca_cert.pem"
- name: Filter sessions by type
dellemc.openmanage.idrac_session_info:
idrac_ip: 198.162.0.1
idrac_user: admin
idrac_password: password
session_type: Redfish
- name: Find stale sessions older than 24 hours
dellemc.openmanage.idrac_session_info:
idrac_ip: 198.162.0.1
idrac_user: admin
idrac_password: password
stale_threshold_minutes: 1440
- name: Filter sessions by username
dellemc.openmanage.idrac_session_info:
idrac_ip: 198.162.0.1
idrac_user: admin
idrac_password: password
username_filter: root
- name: Combined filtering
dellemc.openmanage.idrac_session_info:
idrac_ip: 198.162.0.1
idrac_user: admin
idrac_password: password
session_type: Redfish
username_filter: admin
stale_threshold_minutes: 60
- name: Export session data to CSV file using Jinja2 template
block:
- name: Query sessions
dellemc.openmanage.idrac_session_info:
idrac_ip: 198.162.0.1
idrac_user: admin
idrac_password: password
register: result
- name: Write CSV report
ansible.builtin.copy:
content: |
Id,UserName,SessionType,ClientOriginIPAddress,CreatedTime,AgeMinutes
{% for s in result.sessions %}
{{ s.Id }},{{ s.UserName }},{{ s.SessionType }},{{ s.ClientOriginIPAddress }},{{ s.CreatedTime }},{{ s.session_age_minutes }}
{% endfor %}
dest: /tmp/session_report.csv
delegate_to: localhost
- name: Display session data as YAML
block:
- name: Query sessions
dellemc.openmanage.idrac_session_info:
idrac_ip: 198.162.0.1
idrac_user: admin
idrac_password: password
register: result
- name: Show sessions in YAML format
ansible.builtin.debug:
msg: "{{ result.sessions | to_nice_yaml }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Status of the session query operation. Returned: always Sample: |
|
Number of sessions returned (after filtering). Returned: success Sample: |
|
Session limits and utilization. Returned: success Sample: |
|
Session service configuration. Returned: success Sample: |
|
List of active sessions with details. Returned: success Sample: |