Configure log collection on a MetroCluster IP switch
In a MetroCluster IP configuration, you can configure log collection to collect switch logs for debugging purposes.
|
|
On Broadcom and Cisco switches, a new user is required for each cluster with log collection. For example, MetroCluster 1, MetroCluster 2, MetroCluster 3, and MetroCluster 4 all require a separate user to be configured on the switches. Multiple SSH keys for the same user is not supported. |
-
If you use FIPS mode, complete the following before setting up log collection:
-
Regenerate SSH keys on the switch using the vendor instructions.
-
Regenerate SSH keys in ONTAP using
debug system regenerate-systemshell-key-pair. -
Re-run log collection setup using the
system switch ethernet log setup-passwordcommand.
-
-
You must have access to the switch
showcommands. If you do not, create a new switch user and grant the necessary privileges. -
Switch health monitoring must be enabled for the switch. Verify by checking that the
Is Monitored:field is set to true in the output ofsystem switch ethernet show. -
For log collection with Broadcom and Cisco switches:
-
The local user must have network admin privileges.
-
Create a new switch user for each cluster with log collection enabled. These switches do not support multiple SSH keys for the same user, running setup again overwrites the existing SSH key.
-
-
For support log collection with NVIDIA switches, the log collection user must be able to run the
cl-supportcommand without a password. To allow this, run:echo '<user> ALL = NOPASSWD: /usr/cumulus/bin/cl-support' | sudo EDITOR='tee -a' visudo -f /etc/sudoers.d/cumulus
Follow the steps for your version of ONTAP to set up log collection, enable periodic data collection, and optionally request on-demand support logs.
-
To set up log collection, run the following command for each switch. You are prompted to enter the switch name, username, and password for log collection.
NOTE: If answering y to the user specification prompt, make sure that the user has the necessary permissions as outlined in [Before you begin].
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>
|
|
For CL 5.11.1, create the user cumulus and respond y to the following prompt: Would you like to specify a user other than admin for log collection? {y|n}: y |
-
Enable periodic log collection:
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. -
Request support log collection:
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. -
To view all details of log collection, including the enablement, status message, previous timestamp and filename of periodic collection, the request status, status message, and previous timestamp and filename of support collection, use the following:
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.
-
To set up log collection, run the following command for each switch. You are prompted to enter the switch name, username, and password for log collection.
NOTE: If answering
yto the user specification prompt, make sure that the user has the necessary permissions as outlined in [Before you begin].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>
|
|
For CL 5.11.1, create the user cumulus and respond y to the following prompt: Would you like to specify a user other than admin for log collection? {y|n}: y |
-
To request support log collection and enable periodic collection, run the following command. This starts both types of log collection: the detailed
Supportlogs and an hourly collection ofPeriodicdata.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.Wait for 10 minutes and then check that the log collection completes:
system switch ethernet log show
|
|
If any error statuses are reported by the log collection feature (visible in the output of system switch ethernet log show), see Troubleshoot log collection for further details.
|