errpt 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-errpt
핵심 정리
- AIX 오류 로그(
/var/adm/ras/errlog)의 항목으로 보고서를 만듭니다. 하드웨어·소프트웨어 장애를 볼 때 가장 먼저 쓰는 명령입니다. errpt는 한 줄 요약(IDENTIFIER, TIMESTAMP, T(유형), C(분류), RESOURCE_NAME, DESCRIPTION)을 최신 것부터 보여 주고,errpt -a는 자세한 보고서를 보여 줍니다.- 고르기:
-d H|S|O|U(분류),-T PERM|TEMP|...(유형),-j 오류ID·-J 레이블(포함),-k·-K(제외),-N 자원이름,-s·-e 날짜(mmddhhmmyy). -c는 새로 기록되는 오류를 바로바로 보여 주고,-D는 중복 오류를 하나로 합칩니다.-t는 오류 로그 대신 오류 템플릿 저장소를 봅니다.errpt는 분석을 하지 않습니다. 하드웨어 오류 분석은diag로 합니다. 로그를 지우는 것은errclear입니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 -@ wpar_name(WPAR별 항목 선택)이 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 2, 6.1 Volume 2 |
| 파일 | /usr/bin/errpt, /var/adm/ras/errlog, /etc/objrepos/SWservAt |
| 관련 명령어 | errclear, errlogger, errdemon, diag, errinstall, errupdate |
목적
기록된 오류의 보고서를 만듭니다.
영어 원문
Generates a report of logged errors.
구문
오류 로그에서 보고서를 만들 때:
errpt [ -@ wpar_name ] [ -a ] [ -A ] [ -c ] [ -d ErrorClassList ] [ -D ] [ -e EndDate ] [ -g ]
[ -i File ] [ -I File ] [ -j ErrorID [,ErrorID] ] | [ -k ErrorID [,ErrorID] ]
[ -J ErrorLabel [,ErrorLabel] ] | [ -K ErrorLabel [,ErrorLabel] ] [ -l SequenceNumber ]
[ -m Machine ] [ -n Node ] [ -s StartDate ] [ -F FlagList ] [ -N ResourceNameList ] [ -P ]
[ -R ResourceTypeList ] [ -S ResourceClassList ] [ -T ErrorTypeList ] [ -y File ] [ -z File ]
오류 레코드 템플릿 저장소에서 보고서를 만들 때:
errpt [ -a ] [ -A ] [ -I File ] [ -t ] [ -d ErrorClassList ] [ -j ErrorID [,ErrorID] ] | [ -k ErrorID [,ErrorID] ]
[ -J ErrorLabel [,ErrorLabel] ] | [ -K ErrorLabel [,ErrorLabel] ] [ -F FlagList ] [ -P ]
[ -T ErrorTypeList ] [ -y File ] [ -z File ]
-@는 6.1 구문에만 있습니다.
설명
errpt 명령은 오류 로그의 항목으로 오류 보고서를 만듭니다. 특정 조건에 맞는 오류를 고르는 플래그가 있습니다. 기본으로는 오류가 일어나 기록된 순서의 반대로(최신 것부터) 보여 줍니다. -c(동시) 플래그를 쓰면 오류가 일어나는 대로 보여 줍니다. -i를 쓰지 않으면 오류 로그 구성 데이터베이스에 지정된 오류 로그 파일을 처리합니다. 구성 데이터베이스의 내용은 errdemon 명령으로 봅니다.
기본 요약 보고서는 오류마다 한 줄입니다. 플래그로 다른 형식의 보고서를 만들 수 있습니다.
참고: errpt는 오류 로그를 분석하지 않습니다. 분석은 diag 명령으로 합니다. 다만 분석을 하면 진단 프로그램이 진단 정보를 오류 로그에 다시 넣을 수 있으며, 이 정보는 해당 항목의 자세한 데이터 다음에 나옵니다.
Web-based System Manager(wsm)의 Devices 응용 프로그램이나 SMIT 빠른 경로 smit errpt로도 이 명령을 실행할 수 있습니다.
영어 원문
The errpt command generates an error report from entries in an error log. It includes flags for selecting errors that match specific criteria. By using the default condition, you can display error log entries in the reverse order they occurred and were recorded. By using the -c (concurrent) flag, you can display errors as they occur. If the -i flag is not used with the errpt command, the error log file processed by errpt is the one specified in the error log configuration database. (To view the information in the error log configuration database, use the errdemon command.)
The default summary report contains one line of data for each error. You can use flags to generate reports with different formats.
Note: The errpt command does not perform error log analysis; for analysis, use the diag command. When error log analysis is performed, however, diagnostics may add diagnostic information back into the error log. Such information is shown following the detailed data of the corresponding error log entry.
You can use the Devices application in Web-based System Manager (wsm) to change device characteristics. You could also use the System Management Interface Tool (SMIT) smit errpt fast path to run this command.
플래그
| 플래그 | 설명 |
|---|---|
-@ wpar_name |
지정한 WPAR의 오류 항목만 고릅니다. 6.1부터 |
-a |
오류 로그의 정보를 자세한 형식으로 보여 줍니다. -t와 함께 쓰면 템플릿 파일의 모든 정보를 보여 줍니다. |
-A |
-a 보고서를 줄인 형식입니다. 레이블, 날짜와 시간, 유형, 자원 이름, 설명, 자세한 데이터를 보여 줍니다. -a, -g, -t와 함께 쓸 수 없습니다. |
-c |
오류 항목을 기록되는 때에 맞춰 형식화해 보여 줍니다. 로그에 이미 있는 항목은 기록된 순서대로 보여 줍니다. |
-d ErrorClassList |
오류 분류로 제한합니다. H(하드웨어), S(소프트웨어), O(errlogger 메시지), U(알 수 없음). |
-D |
중복 오류를 합칩니다. -a와 함께 쓰면 중복 수와 처음·마지막 시각을 보여 줍니다. -c, -g, -l, -t, -P와 함께 쓸 수 없습니다. |
-e EndDate |
EndDate까지(포함) 기록된 항목. 형식은 mmddhhmmyy(월, 일, 시, 분, 년)입니다. |
-g |
형식화하지 않은 오류 로그 항목을 ASCII로 보여 줍니다(아래 필드 표). |
-F FlagList |
템플릿의 Alert·Log·Report 필드 값으로 오류 레코드 템플릿을 고릅니다. -t와 함께만 씁니다. 값은 alert=0·alert=1, log=0·log=1, report=0·report=1(0은 False, 1은 True)입니다. |
-i File |
File을 오류 로그 파일로 씁니다. 없으면 오류 로그 구성 데이터베이스의 값을 씁니다. |
-I File |
File을 진단 로그 파일로 씁니다. 없으면 /var/adm/ras/diag_log를 씁니다. |
-j ErrorID[,ErrorID] |
지정한 오류 ID의 항목만 넣습니다. -t와 함께 쓰면 템플릿 저장소에서, 아니면 오류 로그에서 처리합니다. |
-J ErrorLabel |
지정한 오류 레이블의 항목을 넣습니다. -t와의 관계는 -j와 같습니다. |
-k ErrorID[,ErrorID] |
지정한 오류 ID의 항목을 뺍니다. |
-K ErrorLabel |
지정한 오류 레이블의 항목을 뺍니다. |
-l SequenceNumber |
순서 번호로 오류 로그 항목 하나를 고릅니다. 오류 통지(error notification) 객체 클래스의 메서드가 씁니다. |
-m Machine |
지정한 머신의 항목을 넣습니다. 값은 uname -m이 돌려줍니다. |
-n Node |
지정한 노드의 항목을 넣습니다. 값은 uname -n이 돌려줍니다. |
-N ResourceNameList |
지정한 자원 이름의 보고서를 만듭니다. 소프트웨어 오류면 오류를 감지한 자원, 하드웨어 오류면 장치나 시스템 구성 요소 이름입니다. 이것은 그 구성 요소가 고장 났다는 뜻이 아니라, 오류를 분석할 진단 모듈을 정하는 데 씁니다. |
-P |
앞 오류의 중복인 오류만 보여 줍니다. 오류 로그 장치 드라이버가 만든 중복, 곧 errdemon -t로 정하는 errlg_duptime 간격 안에 일어난 중복에만 적용됩니다. -D와 함께 쓸 수 없습니다. |
-R ResourceTypeList |
지정한 자원 유형의 보고서를 만듭니다. 하드웨어 오류면 장치 유형, 소프트웨어 오류면 LPP 값입니다. |
-s StartDate |
StartDate부터 기록된 항목. 형식은 mmddhhmmyy입니다. |
-S ResourceClassList |
지정한 자원 분류의 보고서를 만듭니다. 하드웨어 오류면 장치 분류입니다. |
-t |
오류 로그 대신 오류 레코드 템플릿 저장소를 처리합니다. 템플릿을 보고서 형태로 볼 때 씁니다. |
-T ErrorTypeList |
오류 유형으로 제한합니다. INFO, PEND, PERF, PERM, TEMP, UNKN. |
-y File |
File을 오류 레코드 템플릿 파일로 씁니다. -t와 함께 쓰면 그 템플릿 저장소에서 처리하고, 아니면 그 템플릿으로 오류 로그를 처리합니다. |
-z File |
File을 오류 로그 메시지 카탈로그로 씁니다. |
목록을 받는 플래그(-d, -j, -k, -J, -K, -l, -N, -R, -S, -T, -F)는 값을 쉼표로 나누거나, 큰따옴표로 감싸고 쉼표나 공백으로 나눕니다.
-A 출력 예:
LABEL: STOK_RCVRY_EXIT
Date/Time: Tue Dec 14 15:25:33
Type: TEMP
Resource Name: tok0
Description
PROBLEM RESOLVED
Detail Data
FILE NAME
line: 273 file: stok_wdt.c
SENSE DATA
0000 0000 0000 0000 0000 0000 DEVICE ADDRESS 0004 AC62 25F1
-g 출력 필드:
| 필드 | 뜻 | 필드 | 뜻 |
|---|---|---|---|
el_sequence |
오류 로그 순서 번호 | el_label |
오류 레이블 |
el_timestamp |
항목 타임스탬프 | el_crcid |
CRC 오류 식별자 |
el_machineid |
머신 ID | el_nodeid |
노드 ID |
el_class |
오류 분류 | el_type |
오류 유형 |
el_resource |
자원 이름 | el_rclass |
자원 분류 |
el_rtype |
자원 유형 | el_vpd_ibm |
IBM VPD |
el_vpd_user |
사용자 VPD | el_in |
장치 위치 코드 |
el_connwhere |
하드웨어 연결 ID(슬롯 번호 등) | et_label |
오류 레이블 |
et_class |
오류 분류 | et_type |
오류 유형 |
et_desc |
오류 설명 | et_probcauses |
가능한 원인 |
et_usercauses |
사용자 원인 | et_useraction |
사용자 조치 |
et_instcauses |
설치 원인 | et_instaction |
설치 조치 |
et_failcauses |
고장 원인 | et_failaction |
고장 조치 |
et_detail_length |
자세한 데이터 필드 길이 | et_detail_descid |
자세한 데이터 식별자 |
et_detail_encode |
자세한 데이터 입력 형식 | et_logflg |
로그 플래그 |
et_alertflg |
경고 가능 플래그 | et_reportflg |
보고 플래그 |
el_detail_length |
자세한 데이터 입력 길이 | el_detail_data |
자세한 데이터 입력 |
영어 원문
-@wpar_name— Selects the error entries for the specified WPAR name.-a— Displays information about errors in the error log file in detailed format. If used in conjunction with the-tflag, all the information from the template file is displayed.-A— Displays a shortened version of the detailed report produced by the-aflag. The-Aflag is not valid with the-a,-g, or-tflags. The items reported are the label, date and time, type, resource name, description, and detail data. The example output of this flag is in the following format:LABEL: STOK_RCVRY_EXIT Date/Time: Tue Dec 14 15:25:33 Type: TEMP Resource Name: tok0 Description PROBLEM RESOLVED Detail Data FILE NAME line: 273 file: stok_wdt.c SENSE DATA 0000 0000 0000 0000 0000 0000 DEVICE ADDRESS 0004 AC62 25F1-c— Formats and displays each of the error entries concurrently, that is, at the time they are logged. The existing entries in the log file are displayed in the order in which they were logged.-dErrorClassList — Limits the error report to certain types of error records specified by the valid ErrorClassList variable: H (hardware), S (software), 0 (errlogger command messages), and U (undetermined). The error records in the ErrorClassList variable can be separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , (comma), or a space character.-D— Consolidates duplicate errors. The detailed error report, obtained with the-aflag, reports the number, and first and last times of the duplicates. See Error Logging Overview in General Programming Concepts: Writing and Debugging Programs. Note: The-Dflag is not valid with the-c,-g,-l,-t, and-Pflags.-eEndDate — Specifies all records posted prior to and including the EndDate variable, where the EndDate variable has the form mmddhhmmyy (month, day, hour, minute, and year).-g— Displays the ASCII representation of unformatted error-log entries. The output of this flag is in the following format:el_sequenceError-log stamp numberel_labelError labelel_timestampError-log entry time stampel_crcidUnique cyclic-redundancy-check (CRC) error identifierel_machineidMachine ID variableel_nodeidNode ID variableel_classError classel_typeError typeel_resourceResource nameel_rclassResource classel_rtypeResource typeel_vpd_ibmIBM vital product data (VPD)el_vpd_userUser VPDel_inLocation code of a deviceel_connwhereHardware-connection ID (location on a specific device, such as slot number)et_labelError labelet_classError classet_typeError typeet_descError descriptionet_probcausesProbable causeset_usercausesUser causeset_useractionUser actionset_instcausesInstallation causeset_instactionInstallation actionset_failcausesFailure causeset_failactionFailure actionset_detail_lengthDetail-data field lengthet_detail_descidDetail-data identifierset_detail_encodeDescription of detail-data input formatet_logflgLog flaget_alertflgAlertable error flaget_reportflgError report flagel_detail_lengthDetail-data input lengthel_detail_dataDetail-data input-FFlagList — Selects error-record templates according to the value of theAlert,Log, orReportfield of the template. The FlagList variable can be separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , (comma), or a space character. The-Fflag is used with the-tflag only. Valid values of the FlagList variable include: alert=0 Selects error-record templates with theAlertfield set to False. alert=1 Selects error-record templates with theAlertfield set to True. log=0 Selects error-record templates with theLogfield set to False. log=1 Selects error-record templates with theLogfield set to True. report=0 Selects error-record templates with theReportfield set to False. report=1 Selects error-record templates with theReportfield set to True.-iFile — Uses the error log file specified by the File variable. If this flag is not specified, the value from the error log configuration database is used.-IFile — Uses the diagnostic log file specified by File. If this flag is not specified, the default pathname,/var/adm/ras/diag_log, is used-jErrorID[,ErrorID] — Includes only the error-log entries specified by the ErrorID (error identifier) variable. The ErrorID variables can be separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , (comma), or a space character. When combined with the-tflag, entries are processed from the error-template repository. (Otherwise entries are processed from the error-log repository.)-JErrorLabel — Includes the error log entries specified by the ErrorLabel variable. The ErrorLabel variable values can be separated by commas or enclosed in double-quotation marks and separated by commas or blanks. When combined with the-tflag, entries are processed from the error template repository. (Otherwise, entries are processed from the error log repository.)-kErrorID[,ErrorID] — Excludes the error-log entries specified by the ErrorID variable. The ErrorID variables can be separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , (comma), or a space character. When combined with the-tflag, entries are processed from the error-template repository. (Otherwise entries are processed from the error-log repository.)-KErrorLabel — Excludes the error log entries specified by the ErrorLabel variable. The ErrorLabel variable values can be separated by commas or enclosed in double-quotation marks and separated by commas or blanks. When combined with the-tflag, entries are processed from the error template repository. (Otherwise, entries are processed from the error log repository).-lSequenceNumber — Selects a unique error-log entry specified by the SequenceNumber variable. This flag is used by methods in the error-notification object class. The SequenceNumber variable can be separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , (comma), or a space character.-mMachine — Includes error-log entries for the specified Machine variable. The uname -m command returns the Machine variable value.-nNode — Includes error-log entries for the specified Node variable. The uname -n command returns the Node variable value.-NResourceNameList — Generates a report of resource names specified by the ResourceNameList variable. The ResourceNameList variable is a list of names of resources that have detected errors. For software errors, the ResourceNameList variable lists the names of resources that have detected errors. For hardware errors, it lists names of devices or system components. It does not indicate that the component is faulty or needs replacement. Instead, it is used to determine the appropriate diagnostic modules to be used to analyze the error. The names of the ResourceNameList variable can be separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , (comma), or a space character.-P— Shows only errors which are duplicates of the previous error. The-Pflag applies only to duplicate errors generated by the error log device driver. These errors are duplicates that occurred within the approximate time interval specified by theerrlg_duptimeerror logging attribute controlled by the errdemon daemon-tflag. The-Pflag is invalid with the-Dflag.-RResourceTypeList — Generates a report of resource types specified by the ResourceTypeList variable. For hardware errors, the ResourceTypeList variable is a device type. For software errors, it is the LPP value. The items in the ResourceTypeList variable can be each separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , (comma), or a space character.-sStartDate — Specifies all records posted on and after the StartDate variable, where the StartDate variable has the format mmddhhmmyy (month, day, hour, minute, and year).-SResourceClassList — Generates a report of resource classes specified by the ResourceClassList variable. For hardware errors, the ResourceClassList variable is a device class. The resource classes must be each separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , (comma), or a space character.-t— Processes the error-record template repository instead of the error log. The-tflag can be used to view error-record templates in report form.-TErrorTypeList — Limits the error report to error types specified by the valid ErrorTypeList variables: INFO, PEND, PERF, PERM, TEMP, and UNKN. The error types can be each separated by a , (comma), or enclosed in " " (double quotation marks) and separated by a , or a space character.-yFile — Uses the error record template file specified by the File variable. When combined with the-tflag, entries are processed from the specified error template repository. (Otherwise, entries are processed from the error log repository, using the specified error template repository.)-zFile — Uses the error logging message catalog specified by the File variable. When combined with the-tflag, entries are processed from the error template repository. (Otherwise, entries are processed from the error log repository.)
예제
| 명령 | 하는 일 |
|---|---|
errpt |
전체 요약 보고서 |
errpt -a |
전체 자세한 보고서 |
errpt -a -j E19E094F |
오류 ID E19E094F로 기록된 모든 오류의 자세한 보고서 |
errpt -a -s mmddhhmmyy |
지난 24시간의 자세한 보고서. mmddhhmmyy에 지금보다 24시간 전 시각을 넣음 |
errpt -t -F log=0 |
로깅이 꺼진 오류 레코드 템플릿 목록 |
errpt -i /var/adm/ras/errlog.alternate |
다른 오류 로그 파일의 모든 항목 |
errpt -i /var/adm/ras/errlog.alternate -d H |
다른 오류 로그 파일의 하드웨어 항목 |
errpt -a -J ERRLOG_ON |
레이블 ERRLOG_ON의 자세한 보고서 |
errpt -aD |
중복 오류를 묶은 자세한 보고서 |
errpt -a -J DISK_ERR1,DISK_ERR2 -s 0801000004 -e 0831235904 |
8월 한 달 동안 DISK_ERR1, DISK_ERR2 레이블의 자세한 보고서 |
자주 쓰는 형태:
errpt | head -20 # 최근 오류 20건
errpt -d H -T PERM # 영구 하드웨어 오류만
errpt -a -N hdisk0 | more # hdisk0 관련 자세한 보고서
errpt -c # 새 오류를 실시간으로 보기(Ctrl+C로 끝)
요약 보고서의 열은 IDENTIFIER(오류 ID), TIMESTAMP(mmddhhmmyy), T(유형: P 영구, T 임시, I 정보, U 알 수 없음), C(분류: H, S, O, U), RESOURCE_NAME, DESCRIPTION입니다.
영어 원문
- To display a complete summary report, enter:
errpt
- To display a complete detailed report, enter:
errpt -a
- To display a detailed report of all errors logged for the error identifier
E19E094F, enter:
errpt -a -j E19E094F
- To display a detailed report of all errors logged in the past 24 hours, enter:
errpt -a -s mmddhhmmyy
where the mmddhhmmyy string equals the current month, day, hour, minute, and year, minus 24 hours.
- To list error-record templates for which logging is turned off for any error-log entries, enter:
errpt -t -F log=0
- To view all entries from the alternate error-log file
/var/adm/ras/errlog.alternate, enter:
errpt -i /var/adm/ras/errlog.alternate
- To view all hardware entries from the alternate error-log file
/var/adm/ras/errlog.alternate, enter:
errpt -i /var/adm/ras/errlog.alternate -d H
- To display a detailed report of all errors logged for the error label
ERRLOG_ON, enter:
errpt -a -J ERRLOG_ON
- To display a detailed report of all errors and group duplicate errors, enter:
errpt -aD
- To display a detailed report of all errors logged for the error labels
DISK_ERR1andDISK_ERR2during the month of August, enter:
errpt -a -J DISK_ERR1,DISK_ERR2 -s 0801000004 -e 0831235904"
파일
| 파일 | 설명 |
|---|---|
/etc/objrepos/SWservAt |
소프트웨어 서비스 보조 속성 객체 클래스, 곧 오류 로그 구성 데이터베이스 |
영어 원문
- /etc/objrepos/SWservAt — Contains the software service aids attributes object class; that is, the error log configuration database.
Related reference:
- diag Command
Related information:
- uname command
- errlog subroutine
- Examples of Detailed Error Reports
리눅스(GNU)와 다른 점
리눅스에는 AIX 오류 로그 같은 별도 저장소가 없고, 커널·시스템 메시지를 dmesg, journalctl -k, journalctl -p err, /var/log/messages(또는 /var/log/syslog)로 봅니다. 하드웨어 오류는 rasdaemon의 ras-mc-ctl --errors나 mcelog로 봅니다. 오류 ID·템플릿·분류(H/S)로 고르는 기능은 없고 우선순위(-p)와 단위(-u), 시간(--since)으로 고릅니다.