AIX system log study note 3

Source: Internet
Author: User
I. the system hardware diagnostic tool AIX also provides the diag command to identify and analyze the problem. # Diag such as: # diag-dsysplanar0-v & amp; ndash; ehttp: // www.kuqin.com/aixcmds/aixcmds2/diag.htm2? www.www.www.www.www.www.2cto.comin a... 1. system hardware diagnostic tools
AIX also provides the diag command to identify and analyze the problem.
# Diag
For example:
# Diag-d sysplanar0-v-e
Http://www.kuqin.com/aixcmds/aixcmds2/diag.htm
2. View system logs www.2cto.com
You can use the AIX command in AIX to view system logs.
# Man alog
Alog Command
Purpose
Creates and maintains fixed-size logfiles created from standard input.
Syntax
To Show theContents of a Log File
Alog-f LogFile [-o]
To Log Data to aSpecified Log File
Alog-f LogFile | [[-q] [-s Size]
To Display theVerbosity Value of a Specified Log Type
Alog-t LogType-V
... Skipping...
Alog Command
Purpose
Creates and maintains fixed-size logfiles created from standard input.
Syntax
To Show the Contents of a Log File
Alog-f LogFile [-o]
To Log Data to a Specified Log File
Alog-f LogFile | [[-q] [-s Size]
To Display the Verbosity Value of a Specified Log Type
Alog-t LogType-V
To Change the Attributes of a Specified Log Type
Alog-C-tLogType [-f LogFile] [-s Size] [-w Verbosity]
To Display the Current Attributes of a Specified Log Type
Alog-L [-tLogType]
To Display the Usage of the alog Command
Alog-H
Description
The alog command reads standard input, writes to standard output, and
Copies the output into a fixed-sizefile. This file is treated as
Circular log. If the file is full, newentries are written over
Oldest existing entries.
The alog command works with log filesthat are specified on the command
Line or with logs that are defined inthe alog configuration database.
Logs that are defined in the alogconfiguration database are identified
By LogType. The File, Size, andVerbosity attributes for each defined
LogType are stored in the alogconfiguration database with the LogType.
You can add a new LogType to the alogconfiguration database using
Odmadd command. You can change theattributes of LogType defined in
Alog configuration database using thealog command.
Flags
-C
Changes the attributes for aspecified LogType. Use the-C flag
With the-f,-s, and-w flags tochange the File, Size, and
Verbosity attributes for the specifiedLogType. The-t LogType
Flag is required.
Note: Using the-C flag with-sSizeonly changes the size value in
ODM and does not change the size ofthe actual log file.
If the-C flag is used, the alogcommand does not copy standard
Input to standard output or to alog file.
When the-C flag is used to modifythe attributes for the console
Log type, the console log file isalso modified and the console
Device driver is updated to use thenew values. This is
Deviation from the normal operationof alog-C and is done
Accommodate special formatting inthe console log file.
Note: You must have root userauthority to change alog Butes.
-F LogFile
Specifies the name of a log file. If the specified log file does
Not exist, one is created. If thealog command is unable to write
To a log file, it writes to/dev/null. Use the-f LogFile flag
With the-C and-t flags to changethe File attribute for
LogType defined in the alogconfiguration database.
-H
Displays the usage of the alogcommand.
-L
Lists the log types currentlydefined in the alog configuration
Database. If you use the-L flagwith the-t LogType flag,
Attributes for a specified LogTypeare listed. The current values
Of the File, Size, and Verbosityattributes are listed as colon
Separated values:
: :
If the-L flag is used, the alogcommand does not copy standard
Input to standard output or toFile.
-O
Lists the contents of the log file. Writes the contents of the log
File to standard output insequential order.
-Q
Copies standard input to a log filebut does not write to standard
Output.
-S Size
Specifies the size limit of the logfile in bytes. The space
The log file is reserved when it iscreated. If you create a new
Log file and do not specify theSize attribute, the minimum size,
4096 bytes, is used. If the logfile already exists, its size will
Be changed. The size you specify isrounded upward to the next
Integral multiple of 4096 bytes. The maximum size for a log file
Is 2 GB. If the specified size isgreater than 2 GB, only 2 GB is
Considered. If you decrease thesize of the log file, the oldest
Entries in the log are deleted ifthey do not fit within the new
Size limit. You must have writepermission for the log file
Change its size.
Use the-s Size flag with the-Cand the-t flags to change
Size attribute for LogType definedin the alog configuration
Database. Only the size value inODM is changed. The size of
Actual log file remains the same. The new Size attribute value is
Used the next time a log file iscreated.
-T LogType
Identifies a log defined in thealog configuration database.
Alog command gets the log's filename and size from the alog
Configuration database. If LogFiledoes not exist, one is created.
If the alog command cannot get theinformation for the specified
LogType from the alog configurationdatabase or if the alog
Command is unable to write toLogFile, it writes to/dev/null.
If you specify LogType and LogFileusing the-f flag, LogFile is
Used and LogType is ignored.
-V
Writes the current value of theVerbosity attribute for LogType
That is defined in the alogconfiguration database to standard
Output. If you do not specifyLogType, or the LogType you specify
Is not defined, nothing is written tostandard output.
The value output using the alogcommand with the-t LogType and
The-V flags can be used by acommand that is piping its output
The alog command to control theverbosity of the data it writes
The pipe.
-W Verbosity
Changes the Verbosity attribute forLogType defined in the alog
Configuration database when usedwith the-C and the-t flags.
The Verbosity attribute can have avalue from 0 to 9. If the value
Is 0, no information is copied toLogFile by the alog command. All
Of the information is still writtento standard output. If
Value is not 0, all of theinformation piped to the alog command's
Standard input is copied to LogFileand to standard output.
 
Examples
1 To record the current date and time in a log file named
Sample. log, enter:
Date | alog-f/tmp/sample. log
2 To list the contents of/tmp/sample. log file, enter:
Alog-f/tmp/sample. log-o
3 To change the size of the log file named/tmp/sample. log to 8192
Bytes, enter:
Echo "resizing log file" | alog-f/tmp/sample. log-s 8192
4 To add a new log type sample to the alog configuration database,
Create the alog. add file in thefollowing format:
SWservAt:
Attribute = "alog_type"
Deflt = "sample"
Value = "sample"
SWservAt:
Attribute = "sample_logname"
Deflt = "/tmp/sample. log"
Value = "/tmp/sample. log"
SWservAt:
Attribute = "sample_logsize"
Deflt = "4096"
Value = "4096"
SWservAt:
Attribute = "sample_logverb"
Deflt = "1"
Value = "1"
After creating the alog. add file, enter:
Odmadd alog. add
This adds the alog. add file to theSWservAt database.
5 To change the name of the log file for the log type sample
/Var/sample. log in the alogconfiguration database, enter:
Alog-C-t sample-f/var/sample. log
6 To change the size of the boot log to 8192 bytes and reflect
New size in ODM, enter:
Alog-C-t boot-s 8192
Echo "Changed log size" | alog-t boot-s 8192
Files
/Etc/objrepos/SWservAt
Software Service Aids AttributesObject Class
RelatedInformation
The odmadd command.
How to Add Objects to an Object Class inAIX Version 6.1 General
Programming Concepts: Writing andDebugging Programs.
 
Common Commands
View Log types
# Alog-L
Boot
Bosinst
Nim
Console
Cfg
Mdmplog
Lvmt
Lvmcfg
Dumpsymp
You can run the following command to modify the log file size:
# Alog-t boot-s 8192
Display system startup information
# Alog-o-t boot | more
Display console Information
# Alog-o-t console
Display lvm information
# Alog-t lvmcfg-o
 

From wolf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.