clanalyze command

Purpose

Analyzes PowerHA® SystemMirror® log files for errors and provides the analysis report.

Syntax

clanalyze -a -s <start_time> -e <end_time> 
[-n <ALL|node1,node2,…>]
clanalyze -a -s <start_time> -e <end_time>
 -p <Error String> [-n <ALL|node1,node2,…>]
    
clanalyze -a -p <Error String> 
[-n <ALL|node1,node2,…>]
    
clanalyze -a -o <all|recent>
 [-n <ALL|node1,node2,…>]
    
clanalyze -a -o <all|recent>
 -d <PATH of snap file>
clanalyze -a -p <Error String>
 -d <PATH of snap file>
clanalyze -a -s <start_time> -e <end_time>
 -p <Error String> -d <PATH of snap>
clanalyze -a -s <start_time> -e <end_time>
 -d <PATH of snap file>
clanalyze -a -u [-n <ALL|node1,node2,…>]
clanalyze -s <start_time> -e <end_time>
 -f <Path of log file> [-n <ALL|node1,node2,…>]
clanalyze -s <start_time> -e <end_time>
 -x <Path of log file> -d <Path of snap file>
clanalyze -c <Path to copy snap>
clanalyze -v [-n <ALL|node1,node2,…>]

Description

The clanalyze command performs the following tasks:
  • Analyzes the log files and provides an error report based on error strings or time stamps.
  • Analyzes the core dump file from the AIX® error log.
  • Analyzes the log files that are collected through the snap and clsnap utility.
  • Analyzes user-specified snap file based on error strings that are provided and generates a report.

Flags

-a
All log analysis operations are performed by the -a flag. This flag does not require any argument.
-c <path to copy snap file>
Copies the log file to the directory specified by user.
-d
Specifies the snap file on which the analysis or extraction is performed.
Note: This flag must always be used with the –a flag.
-e
Displays the end time of log analysis or extraction operation. The format is YYYY-MM-DDTHH:MM:SS.
Note: The uppercase letter T in the following example separates the date part of the field from the time part. For example, 2017-04-28T11:45:00
-f
Represents a log file that is extracted from the live cluster.
-n
Specifies the node names of the cluster that must be part of analysis, extraction, or verification. It can be comma-separated list of names or all. If you specify all, all active nodes of cluster are considered for analysis.
-o
Applies analysis. You can specify the option as all or recent. If you specify the all option, error analysis is performed for all supported errors. If you specify the recent, the last supported error is displayed.
-p <error string>
Performs analysis based on specified error string. For example, if diskfailure is specified as a string, the analysis is performed for diskfailure errors.
-s
Specifies the start time for log analysis or extraction. The format is YYYY-MM-DDTHH:MM:SS. For example, 2017-04-28T11:45:00
-u
Analyze the errpt log and filters the log information that is related to core dumps.
-v
Checks the status and configuration of daemons such as syslogd and errdaemon. The v flag displays the current status and configuration.
-x
Specifies the file name that must be extracted from the snap file.

Output File

The output from the clanalyze command is stored in the /var/hacmp/log/loganalyzer/loganalyzer.log file.

Examples

  1. The clanalyze command analyzes all the key log files and displays a report of events or errors that occurred within the start and end time. The analysis is performed on log files of specified nodes. The default value for the attribute node is all. To analyze log files for all the errors or events that occurred between the specified start time and end time, enter the following command:
    clanalyze -a -s "2017-04-28T13:45:00" -e "2017-04-28T13:45:00"
     [-n ALL|node1|node2]
  2. The clanalyze command performs analysis on the specified error or event for all key log files. The clanalyze command performs an extensive search and analyzes the error or event because time limit is not applicable. To analyze log files for a specific error or events, enter the following command:
    clanalyze -a -p "Disk failure" [-n ALL|node1|node2]
  3. The clanalyze command performs search and analysis for a specific error that occurred within a period on all available log files. Search and analysis are performed on all log files of specific nodes or all nodes in the cluster. To analyze log files for all errors or events that occurred within a period, enter the following command:
    clanalyze -a -s "2017-04-28T13:45:00" -e "2017-04-28T13:45:00" 
    -p "Disk failure" [-n ALL|node1|node2]
  4. To analyze log files for all applicable errors or only recent errors, enter the following command:
    clanalyze -a -o "all/recent" [-n ALL|node1|node2]
  5. To extract core dump specific data from the errpt log file and to display it, enter the following command:
    clanalyze -a -u [-n ALL|node1|node2]
  6. To analyze log files for all the errors or events that occurred between the specified start time and end time for the snap or tar file, enter the following command:
    clanalyze -a -s "2017-04-28T13:45:00" -e "2017-04-28T13:45:00" -d <PATH of snap>
  7. The clanalyze command performs search and analysis on error or event in all the key log files. To analyze the log files for a special error or event, enter the following command:
    clanalyze -a -p "Error String" -d <PATH of snap>
  8. To analyze log files for all errors or events that occurred within given period for the snap or tar file, enter the following command:
    clanalyze -a -s "2017-04-28T13:45:00" -e "2017-04-28T13:45:00" 
    -p "Error String" -d <PATH of snap>
  9. To copy log files from all nodes of a cluster and to store them in a remote location, enter the following command:
    clanalyze -c /tmp/CLANALYZE
  10. To verify the status of several daemons such as syslogd or errdemon on specific nodes, enter the following command:
    clanalyze -v [-n ALL|node1|node2]
  11. To extract specific log files from the tar, .pax, .gz, or .Z file, enter the following command:
    clanalyze -s <start_time> -e <end_time> -x <file_name> -d <PATH of snap>
    The clanalyze command receives .tar file as input and extracts specific user-specified file for a specific time range.
  12. To extract a specific log file from the live node for a time stamp, enter the following command:
    clanalyze -s <start_time> -e <end_time> -f <file_name> [-n ALL|node1|node2]
Notes:
  • If data is not available in log files, the tool might not produce complete data.
  • The start time and end time are in the YYYY-MM-DDTHH:MM:SS format. For example, 2017-04-28T13:45:00
  • The log file name must be an absolute path.
  • All PowerHA SystemMirror log files must be located in a default directory and must not be directed to other directories.
  • The clanalyze command works only with PowerHA SystemMirror 7.2.2, or later, for both live environment analysis and snap utility.
  • The following error strings are supported for the log analysis:
    • diskfailure
    • applicationfailure
    • interfacefailure
    • networkfailure
    • globalnetworkfailure
    • nodefailure
    • sitefailure
  • Progress indicator: As the log analyzer runs, it displays the progress in terms of the percentage of analysis completed. The progress indicator message looks like:

    49% analysis is completed. 150sec elapsed.