PowerFlex:傳送訊息至 rsyslog

Summary: 本知識文章說明如何正確設定和使用 ScaleIO 的 rsyslog,同時強調如何將各種 syslog 嚴重性層級分割成個別的記錄檔。 以下命令、檔案路徑和範例取自 RedHat 型系統 (RHEL/CentOS),如果使用不同的 Linux 版本作為 rsyslog 接收器,可能會有所不同。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms

先決條件:

  • 已安裝的 ScaleIO 系統
  • 安裝在伺服器上的「rsyslog」套裝用於接收系統記錄訊息。

 

Cause

Resolution

ScaleIO 組態:

  • 啟用在 ScaleIO 中張貼 rsyslog 訊息: 
    scli --start_remote_syslog --remote_syslog_server_ip <IP> --remote_syslog_server_port <PORT_NUMBER> --syslog_facility <FACILITY_NUMBER>
  • 查詢 rsyslog 設定,確認組態正確無誤:
    scli --query_remote_syslog

注意:這僅在主要 MDM 上完成。發生容錯移轉時,這些值會複製到新的主要 MDM。

 

Rsyslog 主機組態:

  • 確認已安裝 rsyslog 套裝:
    rpm -qa rsyslog

     
  • 確認 rsyslog 已啟動並執行中:
    ps -ef | grep -i rsyslog | grep -v grep

     
  • 根據下列範例設定/etc/rsyslog.conf 檔案:
    local6.info;local6.debug;local6.warn         /var/log/syslog.log
    local6.err         /var/log/syslog.err
    local6.crit         /var/log/syslog.crit

     

        在上述範例中,使用了設施代碼 #22,在 rsyslog.conf 檔案中以「local6」表示。

        語法如下:“設施。嚴重性 /path/to/log/file」

        若要僅記錄「錯誤」嚴重性訊息,請使用:「local6.err /var/log/syslog.err」

        要將多個嚴重性級別發送到單個檔中,請執行以下操作:“local6.info;本地6.調試;local6.warn /var/log/syslog.log“
 

 

        查看附錄 A 有關設施代碼和表示的完整清單,我們將使用 16 到 23 之間的任何工具作為 ScaleIO 日誌記錄的“自定義”工具。

 

  • 編輯完 /etc/rsyslog.conf 檔案後,請重新啟動 rsyslog 服務:
    systemctl restart rsyslog (RHEL/CentOS 7.x)
    service rsyslog restart (RHEL/CentOS 6.x)

 

 

附錄 A:

本附錄包括完整系統日誌協定 RFC 的 URL,以及要在 /etc/rsyslog.conf 檔中使用的設施代碼編號及其“localX”表示形式的清單。

http://tools.ietf.org/html/rfc5424

 

              0 條內核訊息
              1 條使用者級訊息
              2 郵件系統
              3 個系統守護程式
              4 條安全性/授權訊息
              系統記錄在內部產生的 5 則訊息
              6 行印表機子系統
              7 網路新聞子系統
              8 UUCP 子系統
              9 時鐘守護程式
             10 條安全性/授權訊息
             11 FTP 精靈
             12 NTP 子系統
             13 日誌審計
             14 紀錄警示
             15 時鐘守護程式(注 2)
             16 本地使用 0 (本地 0)
             17 本機使用 1 (本機1)
             18 本地使用 2 (本地 2)
             19 本地使用 3 (本地3)
             20 本地使用 4 (本地4)
             21 本地使用 5 (本地5)
             22 本地使用 6 (本地 6)
             23 本地使用 7 (本地7)

Additional Information

本 KB 文章為 ScaleIO 專屬。請查看主機作業系統的說明文件,以取得有關 rsyslog 和 rsyslog.conf 檔案的其他資訊。
Article Properties
Article Number: 000167187
Article Type: Solution
Last Modified: 10 Nov 2025
Version:  4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.