AIX系統日誌學習筆記之一

來源:互聯網
上載者:User

AIX系統上線之後,難免會出現錯誤,為了應對錯誤,aix提供了很多處理錯誤的方法和日誌記錄機制,為修複故障和系統提供方便。
Errdemon是aix的一個守護進程,該進程會即時檢查/dev/drror裝置檔案,查看是否有新的內容,並將與系統錯誤模版對比,將錯誤資訊寫入系統錯誤記錄檔中。
 
Errdemon守護進程會在系統啟動是自動啟動,也可以手動啟動:
#/usr/lib/errdemon
關閉errdemon守護進程
#/usr/lib/errstop
#ps –ef | greperrdemon
 
AIX錯誤記錄檔記錄在/var/adm/ras/errlog中、
以下可以確定系統中錯誤記錄檔檔案的位置,記錄檔的大小,緩衝佔用情況等
/usr/lib/errdemon–l    
以下命令可以變更記錄檔檔案的大小
/usr/lib/errdemon–s 2097153
日誌緩衝設定
/usr/lib/errdemon–B 16384
 
AIX將日誌記錄下來之後,同時提供errpt命令來查看錯誤記錄檔。另外一個診斷命令是diag用來診斷和分析硬體錯誤,而errpt僅僅是列印錯誤。
1、errpt命令
# errpt --h
errpt: Not arecognized flag: -
Usage:   errpt -@ wpar_name -actgDP -s startdate -eenddate
         -N resource_name_list -Sresource_class_list -R resource_type_list
         -T err_type_list -d err_class_list -jid_list -k id_list
         -J label_list -K label_list -lseq_no_list -F flags_list
         -m machine_id -n node_id -i filename -yfilename -z filename
         -I filename
 
Process errorlog entries from the supplied file(s).
-i filename  Uses the error log file specified by thefilename parameter.
-y filename  Uses the error record template file specifiedby the filename
                         parameter.
-z filename  Uses the error logging message catalogspecified by the filename
                         parameter.
-I filename  Uses the diagnostics error log specified bythe filename
                        parameter.
 
Output formattederror log entries sorted chronologically.
顯示全部錯誤記錄檔的詳細資料
-a         Print adetailed listing. Default is a summary listing.
-c         Concurrent mode. Display error logentries as they arrive.
-t         Print error templates instead of errorlog entries.
-g         Output raw ascii  error record structures.
-D         Consolidate duplicate errors.
-P         Show only duplicates from the errordevice driver.
 
Error log entryqualifiers:
-@wpar_name    Select entries for the wparname.
下面兩個是起止日期
-s startdate  Selectentries posted later   than date.(MMddhhmmyy)
-e enddate    Selectentries posted earlier than date. (MMddhhmmyy)
-N list       Select resource_names   in 'list'.
-S list       Select resource_classes in 'list'.
-R list       Select resource_types   in 'list'.
-T list       Select types            in 'list'.
-d list       Select classes          in 'list'.
指定錯誤ID
-j list       Selectids              in 'list'.
-k list       Select ids  NOT        in 'list'.
-J list       Select labels           in 'list'.
-K list       Select labels NOT       in 'list'.
-l list       Select sequence_numbers in 'list'.
-F list       Select templates according to the valueof the
              Alert, Log, or Report field.
-m machine_idSelect entries for the machine id as output by uname -m.
-n node_id    Select entries for the node id    as output by uname -n.
 
'list' is a listof entries separated by commas.
錯誤資訊嚴重性:
error_type  =PERM,TEMP,PERF,PEND,UNKN,INFO
錯誤類型:                                              
error_class = H (HARDWARE), S (SOFTWARE), O (errloggerMESSAGES), U (UNDETERMINED)
 
常用的命令有:
1、列出簡短的出錯資訊
errpt | more
2、列出所有硬體出錯資訊      
errpt -d H
3、列出所有軟體錯誤資訊        
errpt -d S
4、列出詳細的出錯資訊
errpt –a
5、指定錯誤id號查詢     
errpt -aj ERROR_ID
6、永久錯誤資訊
errpt -T PERM -d H
 
2、錯誤記錄檔處理方法
#errclear                     從錯誤記錄檔中刪除記錄
#errstop/errdemon            停止錯誤記錄守護進程/啟動錯誤記錄守護進程
    #errclear
0315-136 Number of days is required, and must be zero or greater.
Usage:
errclear -@ wpar_name -J err_label_list -K err_label_list -Nresource_name_list
        -R resource_type_list -S resource_class_list -T err_type_list
        -d err_class_list -i filename -m machine_id -n node_id
        -j id_list -k id_list -l seq_no_list -y filename number_of_days
 
Delete error log entries in the specified list that are older than
number_of_days specified. Number_of_days refers to the number of twenty
four hour periods from command invocation time.
-@ wpar_name    Delete entriesfor the wpar name.
-J list       Select onlyerror_labels     in 'list'.
-K list       Select onlyerror_labels not in 'list'.
-N list       Select onlyresource_names   in 'list'.
-S list       Select onlyresource_classes in 'list'.
-R list       Select onlyresource_types   in 'list'.
-T list       Select onlyerror_types      in 'list'.
-d list      Select only error_classes    in'list'.
-i filename   Uses the errorlog file specified by the filename parameter.
-j list       Select onlyerror_ids        in 'list'.
-k list       Select onlyerror_ids  not   in 'list'.
-l list       Selectsequence_numbers in 'list'.
-m machine_id Delete entries for the machine id as output by uname-m.
-n node_id    Delete entriesfor the node id    as output by uname -n.
-y filename   Uses the error recordtemplate file specified by the filename
              parameter.
'list' is a list of entries separated by commas.
error_type = PERM,TEMP,PERF,PEND,UNKN,INFO
error_class = H (HARDWARE), S (SOFTWARE), O(errlogger MESSAGES), U (UNDETERMINED)
 
常用的errclear命令
  從錯誤記錄檔中刪除所有記錄,請輸入:
errclear  0
  從錯誤記錄檔中刪除所有軟體錯誤類的條目
errclear -d S 0
從錯誤記錄檔中刪除所有硬體錯誤類的條目
errclear -d H 0

摘自 wolf

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.