Lists records from the audit log.
lsaudrec [-l] [-a │ -n node_name1[,node_name2]...] [-S subsystem_name]
[-s selection_string] [-x] [-h] [ field_name1 [field_name2...] ]
The lsaudrec command is used to list records in the audit log. The audit log is a facility for recording information about the system's operation. It can include information about the normal operation of the system as well as failures and other errors. It augments the error log functionality by conveying the relationship of the error relative to other system activities. All detailed information about failures is still written to the AIX® error log.
Records are created in the audit log by subsystems that have been instrumented to do that. For example, the event response subsystem runs in the background to monitor administrator-defined conditions and then invokes one or more actions when a condition becomes true. Because this subsystem runs in the background, it is difficult for the operator or administrator to understand the total set of events that occurred and the results of any actions that were taken in response to an event. Because the event response subsystem records its activity in the audit log, the administrator can easily view its activity as well as that of other subsystems using this command.
Each record in the audit log contains named fields. Each field contains a value that provides information about the situation corresponding to the record. For example, the field named Time indicates the time at which the situation occurred. Each record has a set of common fields and a set of subsystem-specific fields. The common fields are present in every record in the audit log. The subsystem-specific fields vary from record to record. Their names are only significant when used with a subsystem name because they may not be unique across all subsystems. Each record is derived from a template that defines which subsystem-specific fields are present in the record and defines a format string that is used to generate a message describing the situation. The format string may use record fields as inserts. A subsystem typically has many templates.
The field names can be used as variables in a selection string to choose which records are displayed. A selection string is an expression that is made up of field names, constants, and operators. The syntax of a selection string is similar to an expression in the C programming language or the SQL "where" clause. The selection string is matched against each record using the referenced fields of each record to perform the match. Any records that match are displayed. The selection string is specified with the -s flag. For information on how to specify selection strings, see the Administering RSCT guide.
Field | Description |
---|---|
Time | The time when the situation occurred that the record corresponds to. The value is a 64-bit integer and represents the number of microseconds since UNIX Epoch (00:00:00 GMT January 1, 1970). See the constants below for specifying the time in more user-friendly formats. |
Subsystem | The subsystem that generated the record. This is a string. |
Category | Indicates the importance of the situation corresponding to the audit record, as determined by the subsystem that generated the record. The valid values are: 0 (informational) and 1 (error). |
SequenceNumber | The unique 64-bit integer that is assigned to the record. No other record in the audit log will have the same sequence number. |
TemplateId | The subsystem-dependent identifier that is assigned to records that have the same content and format string. This value is a 32-bit unsigned integer. |
NodeName | The name of the node from which the record was obtained. This field name cannot be used in a selection string. |
The audit records considered for display and matched against the selection string can be restricted to a specific subsystem by using the -S flag. If this flag is specified, the subsystem-specific field names can be used in the selection string in addition to the common field names.
The nodes from which audit log records are considered for display and matched against the selection string can be restricted to a set of specific nodes by using the -n flag. If this flag is specified, the search is limited to the set of nodes listed. Otherwise, the search is performed for all nodes defined within the current management scope, as determined by the CT_MANAGEMENT_SCOPE environment variable.
The audit records are displayed in a table. Field names specified as parameters control which fields are displayed and the order in which they appear on each line. By default, the columns displayed are: the date and time, the subsystem name that generated the record, the severity of the situation, and the subsystem-specific message that describes the situation. If the management scope is not local, the node name is displayed in the first column.
For backward compatibility, the subsystem name can be specified using the -n flag only if the -a and the -S flags are not specified.
The names of fields in the record can be used in the expression. If the -S flag is not specified, only the names of common fields can be used. See the Description for a list of the common field names and their data types. If the -S flag is specified, the name of any field for the specified subsystem as well as the common field names can be used.
If this flag is omitted, the records that are displayed will depend on the -S flag. If the -S flag is omitted, all records from the audit log are displayed. Otherwise, all records for the subsystem identified by the -S flag are displayed.
In order to list records from an audit log when the -S flag is omitted, you must have read access to the target resource class on each node from which records are to be listed. When the -S flag is specified, you must have read access to the audit log resource corresponding to the subsystem identified by the -S flag on each node from which records are to be listed.
Authorization is controlled by the RMC access control list (ACL) file that exists on each node.
If this environment variable is not set, local scope is used.
This command is part of the Reliable Scalable Cluster Technology (RSCT) fileset for AIX®.
When the -h flag is specified, this command's usage statement is written to standard output.
lsaudrec
lsaudrec -s "Time > #-000001"
lsaudrec -n mynode,yournode -S abc Time SequenceNumber
lsaudrec -SERRM
lsaudrec -SERRM -s"ConditionName=='Condition1'"
lsaudrec -SERRM -s"ConditionName=='Condition1' && Etype==91"
lsaudrec -SERRM -s"ConditionName=='Condition1' && Etype==92"
lsaudrec -SSSRM
Time Subsystem Category Description
11/10/05 21:52:32 SSRM Error The Command /SENSOR/sensor.ksh 1
in Sensor SENSOR_NOUSER_1 execution fails.
11/10/05 21:52:36 SSRM Error The Command /SENSOR/sensor.nocmd 1 in Sensor
SENSOR_NOCMD_1 exits with error 127.
lsaudrec -l -SSSRM
Time = 11/10/05 21:52:32 243097
Subsystem = SSRM
Category = Error
Description = The Command /SENSOR/sensor.ksh 1 in Sensor SENSOR_NOUSER_1 execution fails.
ErrorMsg = 2645-202 The user name "guest" that was specified for running the command does not exist.
Time = 11/10/05 21:52:36 361726
Subsystem = SSRM
Category = Error
Description = The Command /SENSOR/sensor.nocmd 1 in Sensor SENSOR_NOCMD_1 exits with error 127.
StandardOut =
StandardErr = ksh: /u/diane/drmc/scripts/SENSOR/sensor.nocmd: not found
lsaudrec -s"Category=1"