errclear – Run the AIX errclear command to delete entries from the error log.
Synopsis
Enables Ansible to invoke AIX’s errclear utility to delete error log entries based on various filtering criteria.
The errclear command deletes error-log entries older than the number of days specified.
To delete all error-log entries, specify a value of 0 for the days parameter.
Requirements
The below requirements are needed on the host that executes this module.
AIX >= 7.1
Root user privileges
Parameters
- days (True, int, None)
Number of days to keep in the error log. Entries older than this will be deleted.
Specify 0 to delete all entries.
- error_class (optional, str, None)
Deletes error-log entries in the error classes specified.
The error records can be separated by a , (comma), or enclosed in “ “ (double quotation marks)
And separated by a , (comma), or a space character.
Hhardware
Ssoftware
Oerrlogger command messages
Uundetermined- input_log (optional, str, None)
Use specified error log file. If this flag is not specified, the value from the error log configuration database is used.
- include_errids (optional, str, None)
Deletes only the error-log entries specified by the ErrorID.
The ErrorID variables can be separated by a , (comma), or enclosed in “ “ (double quotation marks) and separated by a , (comma), or a space character.
- exclude_errids (optional, str, None)
Deletes all error-log entries except those specified by the ErrorID.
The ErrorID variable values can be separated by commas or enclosed in double-quotation marks and separated by commas or blanks.
- include_labels (optional, str, None)
Deletes only the error log entries specified by the ErrorLabel.
The ErrorLabel variable values can be separated by commas or enclosed in double-quotation marks and separated by commas or blanks.
- exclude_labels (optional, str, None)
Deletes all error log entries except those specified by the ErrorLabel.
The ErrorLabel variable values can be separated by commas or enclosed in double-quotation marks and separated by commas or blanks.
- sequence_number (optional, str, None)
Deletes error-log entries with the specified sequence numbers.
The sequence_number variable can be separated by a , (comma), or enclosed in “ “ (double quotation marks)
And separated by a , (comma), or a space character.
- machine (optional, str, None)
Deletes error-log entries for the specified Machine variable.
The uname -m command returns the value of the Machine variable.
- node (optional, str, None)
Deletes error-log entries for the specified Node variable.
The uname -n command returns the value of the Node variable.
- resource_names (optional, str, None)
Deletes error-log entries for the resource names specified.
The resource_names is a list of names of resources that have detected errors.
The resource_names variable can be separated by a , (comma), or enclosed in “ “ (double quotation marks)
And separated by a , (comma), or a space character.
- resource_types (optional, str, None)
Deletes error-log entries for the resource types specified.
For hardware errors, this is a device type. For software errors, the value is LPP.
The resource_types variable can be separated by a , (comma), or enclosed in “ “ (double quotation marks)
And separated by a , (comma), or a space character.
- resource_classes (optional, str, None)
Deletes error-log entries for the resource classes specified.
For hardware errors, this is a device class.
The resource_classes variable can be separated by a , (comma), or enclosed in “ “ (double quotation marks)
And separated by a , (comma), or a space character.
- error_types (optional, str, None)
Deletes error-log entries for error types specified.
The error types can be each separated by a , (comma), or enclosed in “ “ (double quotation marks) and separated by a , or a space character.
INFOInformation
PENDPending
PERFPerformance related entries
PERMPermanent
TEMPTemporary
UNKNUnknown- template_file (optional, str, None)
Uses the error-record template file specified.
Notes
Note
Only the root user can run this command.
The errclear command clears the specified entries, but does not decrease the error log file size.
You can refer to the IBM documentation for additional information on the errclear command at https://www.ibm.com/docs/en/aix/7.3?topic=e-errclear-command.
Examples
- name: Delete all entries from the error log
errclear:
days: 0
- name: Delete all entries older than 30 days
errclear:
days: 30
- name: Delete all software error entries
errclear:
days: 0
error_class: "S"
- name: Delete specific error IDs
errclear:
days: 0
include_errids: "A924A5FC,DEADBEEF"
- name: Clear all entries from alternate error log file
errclear:
days: 0
input_log: "/var/adm/ras/errlog.alternate"
- name: Clear all hardware entries from alternate error log
errclear:
days: 0
input_log: "/var/adm/ras/errlog.alternate"
error_class: "H"
- name: Delete entries older than 7 days for specific resource
errclear:
days: 7
resource_names: "hdisk0"
Return Values
- msg (always, str, errclear executed successfully with command: errclear 0)
The execution message.
- cmd (always, str, errclear 0)
The command executed.
- rc (When the command is executed., int, 0)
The command return code.
- stdout (If the command failed., str, )
The standard output.
- stderr (If the command failed., str, )
The standard error.
Status
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by community.