Skip to main content
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

配置日誌收集

貢獻者 netapp-yvonneo netapp-aoife aclose-ntap

乙太網路交換器健康監視器 (CSHM) 負責確保叢集和儲存網路交換器的運作健康,並收集交換器日誌以進行偵錯。此流程引導您完成設定收集、請求詳細的*支援*日誌以及啟用由AutoSupport收集的*定期*資料的每小時收集流程。

注意: 如果啟用 FIPS 模式,則必須完成以下步驟:

註
  1. 依照廠商提供的說明,在交換器上重新產生 SSH 金鑰。

  2. 使用ONTAP重新產生 SSH 金鑰 debug system regenerate-systemshell-key-pair

  3. 使用以下方式重新執行日誌收集設定例程: `system switch ethernet log setup-password`命令

開始之前

  • 使用者必須有權存取該開關。 `show`命令。如果這些使用者不可用,請建立一個新使用者並授予該使用者必要的權限。

  • 必須為交換器啟用交換器健康監控功能。透過確保以下方式驗證這一點: `Is Monitored:`輸出中該欄位設定為*true* `system switch ethernet show`命令。

  • 用於收集博通和Cisco交換器的日誌:

    • 本機使用者必須具有網路管理員權限。

    • 對於每個啟用了日誌收集的叢集設置,都應該在交換器上建立一個新使用者。這些交換器不支援同一用戶使用多個 SSH 金鑰。任何額外的日誌收集設定都會覆蓋使用者的任何現有 SSH 金鑰。

  • 為了支援使用NVIDIA交換器收集日誌,必須允許用於日誌收集的_user_ 執行此交換器。 `cl-support`無需提供密碼即可執行命令。若要啟用此用法,請執行下列命令:

    echo '<user> ALL = NOPASSWD: /usr/cumulus/bin/cl-support' | sudo EDITOR='tee -a' visudo -f /etc/sudoers.d/cumulus

步驟

ONTAP 9.15.1 及更高版本
  1. 若要設定日誌收集,請對每個交換器執行以下命令。系統會提示您輸入用於日誌收集的交換器名稱、使用者名稱和密碼。

    注意: 如果對使用者規範提示回答 y,請確保使用者擁有必要的權限,如下所述:開始之前

    system switch ethernet log setup-password
    cluster1::*> system switch ethernet log setup-password
    Enter the switch name: <return>
    The switch name entered is not recognized.
    Choose from the following list:
    cs1
    cs2
    
    cluster1::*> system switch ethernet log setup-password
    
    Enter the switch name: cs1
    Would you like to specify a user other than admin for log collection? {y|n}: n
    
    Enter the password: <enter switch password>
    Enter the password again: <enter switch password>
    
    cluster1::*> system switch ethernet log setup-password
    
    Enter the switch name: cs2
    
    Would you like to specify a user other than admin for log collection? {y|n}: n
    
    Enter the password: <enter switch password>
    Enter the password again: <enter switch password>
註 對於 CL 5.11.1,建立使用者 cumulus 並對以下提示回答 y:您是否要指定 admin 以外的使用者進行日誌收集? {y|n}: y
  1. 步驟2:啟用定期日誌收集。

    system switch ethernet log modify -device <switch-name> -periodic-enabled true
    cluster1::*> system switch ethernet log modify -device cs1 -periodic-enabled true
    
    Do you want to modify the cluster switch log collection configuration? {y|n}: [n] y
    
    cs1: Periodic log collection has been scheduled to run every hour.
    
    cluster1::*> system switch ethernet log modify -device cs2 -periodic-enabled true
    
    Do you want to modify the cluster switch log collection configuration? {y|n}: [n] y
    
    cs2: Periodic log collection has been scheduled to run every hour.
    
    cluster1::*> system switch ethernet log show
                                              Periodic    Periodic    Support
    Switch                                    Log Enabled Log State   Log State
    
    cs1                                       true        scheduled   never-run
    cs2                                       true        scheduled   never-run
    2 entries were displayed.
  2. 請求支援日誌收集:

    system switch ethernet log collect-support-log -device <switch-name>
    cluster1::*> system switch ethernet log collect-support-log -device cs1
    
    cs1: Waiting for the next Ethernet switch polling cycle to begin support collection.
    
    cluster1::*> system switch ethernet log collect-support-log -device cs2
    
    cs2: Waiting for the next Ethernet switch polling cycle to begin support collection.
    
    cluster1::*> *system switch ethernet log show
                                              Periodic    Periodic    Support
    Switch                                    Log Enabled Log State   Log State
    
    cs1                                       false       halted      initiated
    cs2                                       true        scheduled   initiated
    2 entries were displayed.
  3. 要查看日誌收集的所有詳細信息,包括定期收集的啟用情況、狀態訊息、上一個時間戳和文件名,以及支援收集的請求狀態、狀態訊息、上一個時間戳和文件名,請使用以下命令:

    system switch ethernet log show -instance
    cluster1::*> system switch ethernet log show -instance
    
                        Switch Name: cs1
               Periodic Log Enabled: true
                Periodic Log Status: Periodic log collection has been scheduled to run every hour.
        Last Periodic Log Timestamp: 3/11/2024 11:02:59
              Periodic Log Filename: cluster1:/mroot/etc/log/shm-cluster-info.tgz
              Support Log Requested: false
                 Support Log Status: Successfully gathered support logs - see filename for their location.
         Last Support Log Timestamp: 3/11/2024 11:14:20
               Support Log Filename: cluster1:/mroot/etc/log/shm-cluster-log.tgz
    
                        Switch Name: cs2
               Periodic Log Enabled: false
                Periodic Log Status: Periodic collection has been halted.
        Last Periodic Log Timestamp: 3/11/2024 11:05:18
              Periodic Log Filename: cluster1:/mroot/etc/log/shm-cluster-info.tgz
              Support Log Requested: false
                 Support Log Status: Successfully gathered support logs - see filename for their location.
         Last Support Log Timestamp: 3/11/2024 11:18:54
               Support Log Filename: cluster1:/mroot/etc/log/shm-cluster-log.tgz
    2 entries were displayed.
ONTAP 9.14.1 及更早版本
  1. 若要設定日誌收集,請對每個交換器執行以下命令。系統會提示您輸入用於日誌收集的交換器名稱、使用者名稱和密碼。

    注意: 如果回答 `y`根據使用者規格提示,確保使用者擁有必要的權限,具體權限要求請參閱相關文件。開始之前

    system switch ethernet log setup-password
    cluster1::*> system switch ethernet log setup-password
    Enter the switch name: <return>
    The switch name entered is not recognized.
    Choose from the following list:
    cs1
    cs2
    
    cluster1::*> system switch ethernet log setup-password
    
    Enter the switch name: cs1
    Would you like to specify a user other than admin for log collection? {y|n}: n
    
    Enter the password: <enter switch password>
    Enter the password again: <enter switch password>
    
    cluster1::*> system switch ethernet log setup-password
    
    Enter the switch name: cs2
    
    Would you like to specify a user other than admin for log collection? {y|n}: n
    
    Enter the password: <enter switch password>
    Enter the password again: <enter switch password>
註 對於 CL 5.11.1,建立使用者 cumulus 並對以下提示回答 y:您是否要指定 admin 以外的使用者進行日誌收集? {y|n}: y
  1. 若要要求支援日誌收集並啟用定期收集,請執行下列命令。這將啟動兩種類型的日誌收集:詳細日誌收集和詳細日誌收集。 `Support`日誌和每小時收集的數據 `Periodic`數據。

    system switch ethernet log modify -device <switch-name> -log-request true
    cluster1::*> system switch ethernet log modify -device cs1 -log-request true
    
    Do you want to modify the cluster switch log collection configuration? {y|n}: [n] y
    
    Enabling cluster switch log collection.
    
    cluster1::*> system switch ethernet log modify -device cs2 -log-request true
    
    Do you want to modify the cluster switch log collection configuration? {y|n}: [n] y
    
    Enabling cluster switch log collection.

    等待 10 分鐘,然後檢查日誌收集是否完成:

    system switch ethernet log show
警告 如果日誌收集功能報告了任何錯誤狀態(在輸出中可見), system switch ethernet log show ), 看"排查日誌收集問題"更多詳情請見下文。
下一步是什麼?

"配置 SNMPv3(可選)"