配置日志收集
以太网交换机健康监视器 (CSHM) 负责确保集群和存储网络交换机的运行健康,并收集交换机日志以进行调试。此流程指导您完成设置收集、请求详细的*支持*日志以及启用由AutoSupport收集的*定期*数据的每小时收集过程。
注意: 如果启用 FIPS 模式,则必须完成以下步骤:
|
|
|
开始之前
-
用户必须有权访问该开关。 `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
步骤
-
要设置日志收集,请对每个交换机运行以下命令。系统会提示您输入用于日志收集的交换机名称、用户名和密码。
注意: 如果对用户规范提示回答 y,请确保用户拥有必要的权限,如以下所述:开始之前 。
system switch ethernet log setup-passwordcluster1::*> 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 |
-
步骤2:启用定期日志收集。
system switch ethernet log modify -device <switch-name> -periodic-enabled truecluster1::*> 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. -
请求支持日志收集:
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. -
要查看日志收集的所有详细信息,包括定期收集的启用状态、状态消息、上一个时间戳和文件名,以及支持收集的请求状态、状态消息、上一个时间戳和文件名,请使用以下命令:
system switch ethernet log show -instancecluster1::*> 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.
-
要设置日志收集,请对每个交换机运行以下命令。系统会提示您输入用于日志收集的交换机名称、用户名和密码。
注意: 如果回答 `y`根据用户规范提示,确保用户拥有必要的权限,具体权限要求请参见相关文档。开始之前 。
system switch ethernet log setup-passwordcluster1::*> 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 |
-
要请求支持日志收集并启用定期收集,请运行以下命令。这将启动两种类型的日志收集:详细日志收集和详细日志收集。 `Support`日志和每小时收集的数据 `Periodic`数据。
system switch ethernet log modify -device <switch-name> -log-request truecluster1::*> 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 ), 看"排查日志收集问题"更多详情请见下文。
|