配置日志收集
以太网交换机运行状况监控器(CSHM)负责确保集群和存储网络交换机的运行状况、并收集交换机日志以进行调试。此过程将指导您完成设置收集、请求详细的*Support*日志以及启用每小时收集AutoSupport收集的*定期*数据的过程。
*注:*如果启用FIPS模式,则必须完成以下操作:
|
|
开始之前
-
用户必须能够访问交换机
show
命令。如果这些权限不可用、请创建一个新用户并向该用户授予必要的权限。 -
必须为交换机启用交换机运行状况监控。通过确保进行验证
Is Monitored:
字段在的输出中设置为*TRUE*system switch ethernet show
命令: -
对于NVIDIA交换机、必须允许日志收集用户在不显示密码提示的情况下运行日志收集命令。要允许使用此命令、请运行以下命令:
echo '<username> ALL = NOPASSWD: /usr/cumulus/bin/cl-support, /usr/sbin/csmgrctl' | sudo EDITOR='tee -a' visudo -f /etc/sudoers.d/cumulus
步骤
-
要设置日志收集、请对每个交换机运行以下命令。系统会提示您输入交换机名称、用户名和密码以收集日志。
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>
-
要请求支持日志收集并启用定期收集、请运行以下命令。此时将开始两种类型的日志收集:详细
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 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>
-
启用定期日志收集:
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.
-
请求支持日志收集:
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 -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.
|
如果日志收集功能报告了任何错误状态(在的输出中可见 system switch ethernet log show ),请参见以了解更多详细信息。 "对日志收集进行故障排除"
|
"配置SNMPv3 (可选)"(英文)