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

設定 SNMPv3

貢獻者

請遵循此程序來設定支援乙太網路交換器健全狀況監控( CSHM )的 SNMPv3 。

關於這項工作

下列命令可在NVIDIA SN2100交換器上設定v3使用者名稱:

  • 對於*無驗證*:「net add SNMP伺服器使用者名稱_SNMPv3 user auth-none"

  • 若為* MD5/SHA驗證*:「net add SNMP伺服器使用者名稱_SNMPv3使用者_[auth-md5 | auth-SHa]auth-password

  • 若為使用AES-D5/SHA加密的* MD5/SHA驗證*:「net add SNMP伺服器使用者名稱_SNMPv3使用者_驗證-md5 | auth-SHA」auth-password[加密-AES-|加密- des]PRIV-password

下列命令可在ONTAP Sfeside上設定一個v3使用者名稱:「cluster1::*>安全登入create -user-or group name MPv2_user-applicationSNMP -imize-method USM -reme-switch-ipaddress_address_」

下列命令會使用 CSHM 建立 SNMPv3 使用者名稱: cluster1::*> system switch ethernet modify -device DEVICE -snmp-version SNMPv3 -community-or-username SNMPv3_USER

步驟
  1. 設定交換器上的v3使用者使用驗證和加密:

    net show snmp status

    顯示範例
    cumulus@sw1:~$ net show snmp status
    Simple Network Management Protocol (SNMP) Daemon.
    ---------------------------------  ----------------
    Current Status                     active (running)
    Reload Status                      enabled
    Listening IP Addresses             all vrf mgmt
    Main snmpd PID                     4318
    Version 1 and 2c Community String  Configured
    Version 3 Usernames                Not Configured
    ---------------------------------  ----------------
    cumulus@sw1:~$
    cumulus@sw1:~$ net add snmp-server username SNMPv3User auth-md5 <password> encrypt-aes <password>
    cumulus@sw1:~$ net commit
    --- /etc/snmp/snmpd.conf        2020-08-02 21:09:34.686949282 +0000
    +++ /run/nclu/snmp/snmpd.conf   2020-08-11 00:13:51.826126655 +0000
    @@ -1,26 +1,28 @@
     # Auto-generated config file: do not edit. #
     agentaddress udp:@mgmt:161
     agentxperms 777 777 snmp snmp
     agentxsocket /var/agentx/master
     createuser _snmptrapusernameX
    +createuser SNMPv3User MD5 <password> AES <password>
     ifmib_max_num_ifaces 500
     iquerysecname _snmptrapusernameX
     master agentx
     monitor -r 60 -o laNames -o laErrMessage "laTable" laErrorFlag != 0
     pass -p 10 1.3.6.1.2.1.1.1 /usr/share/snmp/sysDescr_pass.py
     pass_persist 1.2.840.10006.300.43 /usr/share/snmp/ieee8023_lag_pp.py
     pass_persist 1.3.6.1.2.1.17 /usr/share/snmp/bridge_pp.py
     pass_persist 1.3.6.1.2.1.31.1.1.1.18 /usr/share/snmp/snmpifAlias_pp.py
     pass_persist 1.3.6.1.2.1.47 /usr/share/snmp/entity_pp.py
     pass_persist 1.3.6.1.2.1.99 /usr/share/snmp/entity_sensor_pp.py
     pass_persist 1.3.6.1.4.1.40310.1 /usr/share/snmp/resq_pp.py
     pass_persist 1.3.6.1.4.1.40310.2 /usr/share/snmp/cl_drop_cntrs_pp.py
     pass_persist 1.3.6.1.4.1.40310.3 /usr/share/snmp/cl_poe_pp.py
     pass_persist 1.3.6.1.4.1.40310.4 /usr/share/snmp/bgpun_pp.py
     pass_persist 1.3.6.1.4.1.40310.5 /usr/share/snmp/cumulus-status.py
     pass_persist 1.3.6.1.4.1.40310.6 /usr/share/snmp/cumulus-sensor.py
     pass_persist 1.3.6.1.4.1.40310.7 /usr/share/snmp/vrf_bgpun_pp.py
    +rocommunity cshm1! default
     rouser _snmptrapusernameX
    +rouser SNMPv3User priv
     sysobjectid 1.3.6.1.4.1.40310
     sysservices 72
    -rocommunity cshm1! default
    
    
    net add/del commands since the last "net commit"
    ================================================
    
    User        Timestamp                   Command
    ----------  --------------------------  -------------------------------------------------------------------------
    SNMPv3User  2020-08-11 00:13:51.826987  net add snmp-server username SNMPv3User auth-md5 <password> encrypt-aes <password>
    
    cumulus@sw1:~$
    cumulus@sw1:~$ net show snmp status
    Simple Network Management Protocol (SNMP) Daemon.
    ---------------------------------  ----------------
    Current Status                     active (running)
    Reload Status                      enabled
    Listening IP Addresses             all vrf mgmt
    Main snmpd PID                     24253
    Version 1 and 2c Community String  Configured
    Version 3 Usernames                Configured     <---- Configured here
    ---------------------------------  ----------------
    cumulus@sw1:~$
  2. 設定位在邊上的v3使用者ONTAP :

    security login create -user-or-group-name SNMPv3User -application snmp -authentication-method usm -remote-switch-ipaddress 10.231.80.212

    顯示範例
    cluster1::*> security login create -user-or-group-name SNMPv3User -application snmp -authentication-method usm -remote-switch-ipaddress 10.231.80.212
    
    Enter the authoritative entity's EngineID [remote EngineID]:
    
    Which authentication protocol do you want to choose (none, md5, sha, sha2-256)
    [none]: md5
    
    Enter the authentication protocol password (minimum 8 characters long):
    
    Enter the authentication protocol password again:
    
    Which privacy protocol do you want to choose (none, des, aes128) [none]: aes128
    
    Enter privacy protocol password (minimum 8 characters long):
    Enter privacy protocol password again:
  3. 設定 CSHM 以監控新的 SNMPv3 使用者:

    system switch ethernet show-all -device "sw1 (b8:59:9f:09:7c:22)" -instance

    顯示範例
    cluster1::*> system switch ethernet show-all -device "sw1 (b8:59:9f:09:7c:22)" -instance
                                       Device Name: sw1 (b8:59:9f:09:7c:22)
                                        IP Address: 10.231.80.212
                                      SNMP Version: SNMPv2c
                                     Is Discovered: true
    DEPRECATED-Community String or SNMPv3 Username: -
               Community String or SNMPv3 Username: cshm1!
                                      Model Number: MSN2100-CB2FC
                                    Switch Network: cluster-network
                                  Software Version: Cumulus Linux version 4.4.3 running on Mellanox Technologies Ltd. MSN2100
                         Reason For Not Monitoring: None
                          Source Of Switch Version: LLDP
                                    Is Monitored ?: true
                       Serial Number of the Device: MT2110X06399  <---- serial number to check
                                       RCF Version: MSN2100-RCF-v1.9X6-Cluster-LLDP Aug-18-2022
    
    cluster1::*>
    cluster1::*> system switch ethernet modify -device "sw1 (b8:59:9f:09:7c:22)" -snmp-version SNMPv3 -community-or-username SNMPv3User
  4. 驗證新建立的 SNMPv3 使用者所查詢的序號、是否與 CSHM 輪詢期間結束後上一步所述的序號相同。

    system switch ethernet polling-interval show

    顯示範例
    cluster1::*> system switch ethernet polling-interval show
             Polling Interval (in minutes): 5
    
    cluster1::*> system switch ethernet show-all -device "sw1 (b8:59:9f:09:7c:22)" -instance
                                       Device Name: sw1 (b8:59:9f:09:7c:22)
                                        IP Address: 10.231.80.212
                                      SNMP Version: SNMPv3
                                     Is Discovered: true
    DEPRECATED-Community String or SNMPv3 Username: -
               Community String or SNMPv3 Username: SNMPv3User
                                      Model Number: MSN2100-CB2FC
                                    Switch Network: cluster-network
                                  Software Version: Cumulus Linux version 4.4.3 running on Mellanox Technologies Ltd. MSN2100
                         Reason For Not Monitoring: None
                          Source Of Switch Version: LLDP
                                    Is Monitored ?: true
                       Serial Number of the Device: MT2110X06399  <---- serial number to check
                                       RCF Version: MSN2100-RCF-v1.9X6-Cluster-LLDP Aug-18-2022