Nexus9の運用設定6(基本確認コマンド)

Nexus9監視運用設定と出力

運用フェーズで使いそうなコマンド出力を記載する。
※仮想NX-OSなので参考まで。

確認すること

■確認コマンドは設定モードからでも実行可能
Nexus9k(config)# sh clock 
08:38:16.494 JST Mon Oct 26 2020
Time source is NTP
■指定のセクション設定のみ確認することが可能

以下例はBGPセクションの設定のみ確認

Nexus9k# sh run sect bgp
show running-config | section bgp
feature bgp
snmp-server enable traps bgp
router bgp 888888
  neighbor 10.10.10.10
    bfd
    bfd interval 50 min_rx 50 multiplier 3
    remote-as 777777
    address-family ipv4 unicast
  neighbor 11.11.11.11
■デフォルトVRF

managementはmgmt0インターフェースに割り当て
その他のインターフェースはdefaultのVRFに割り当て

Nexus9k(config)# sh vrf
VRF-Name                           VRF-ID State   Reason                        
default                                 1 Up      --                            
management                              2 Up      --       
■NTP設定

NTPはvrf指定で同期。特定のVRFを設定していない場合defaultのVRFを使用

Nexus9k(config)# ntp server 192.168.3.1 prefer 
Nexus9k(config)# ntp server 192.168.3.2
※上記設定後use-vrf default部分は自動的に付与される。
Nexus9k# sh run | i ntp
ntp server 192.168.3.1 prefer use-vrf default
ntp server 192.168.3.2 use-vrf default
■NTP確認(IOSのsh ntp associations相当)
Nexus9k# sh ntp peer-status 
Total peers : 2
* - selected for sync, + -  peer mode(active), 
- - peer mode(passive), = - polled in client mode 
    remote                                 local                                   st   poll   reach delay   vrf
-----------------------------------------------------------------------------------------------------------------------
*192.168.3.1                             192.168.1.1                            4   64     377   0.00064  default
=192.168.3.2                             192.168.1.2                            4   64     377   0.00049  default
■MOTD バナー設定

ログイン時にプロンプトに表示させる - 1行あたり最大 80 文字 - 最大 40 行

Nexus9k(config)# banner motd # RT100_Nexus9000#
Nexus9k(config)# 
Nexus9k(config)# sh banner motd 
 RT100_Nexus9000
■ログインユーザ確認
Nexus9k(config)# sh users
NAME     LINE         TIME         IDLE          PID COMMENT
user   pts/2        Oct 26 06:30   .          3801 (192.168.3.1) *
トラヒック5分平均、30秒平均を見る(IOSのsh int sum の代わり)
Nexus9k# sh interface counters brief 

-------------------------------------------------------------------------------
Interface         Input Rate (avg)    Output Rate (avg)   
                  ------------------  ------------------  
                  Rate     Total      Rate     Total        Rate averaging
                  MB/s     Frames     MB/s     Frames       interval (seconds)
-------------------------------------------------------------------------------
Eth1/1            0        0          0        0            30      
                  0        0          0        0            300     
Eth1/2            0        0          0        0            30      
                  0        0          0        0            300     
Eth1/3            0        0          0        0            30      
(以下省略)
トラヒック30秒平均のみ出力
sh interface counters brief | include  Eth|Rate|MB|Inte
Interface         Input Rate (avg)    Output Rate (avg)   
                  Rate     Total      Rate     Total        Rate averaging
                  MB/s     Frames     MB/s     Frames       interval (seconds)
Eth1/1            0        0          0        0            30      
Eth1/2            0        0          0        0            30      
Eth1/3            0        0          0        0            30      
Eth1/4            0        0          0        0            30      
(以下省略)
■ロキング設定

※サーバアドレスの後の数字はseverityレベルで指定が無ければdefaultの5 notificationsが自動的に指定される。 ※facilityの指定が無ければdefaultのlocal7が自動的に指定される。
以下、facility local5、severity 6 に設定した場合、

Nexus9k(config)# sh run | i logg
logging server 192.168.1.1 6 use-vrf default facility local5
logging source-interface loopback0
no logging monitor
no logging console
■ロキング設定確認
Nexus9k(config-if)# sh logging server 
Logging server:                 enabled  ←有効
{192.168.1.1}
        server severity:        notifications
        server facility:        local5
        server VRF:             default
        server port:            514
{192.168.1.2}
        This server is temporarily unreachable  ←到達性がない場合
        server severity:        notifications
        server facility:        local5
        server VRF:             default
        server port:            514