Nexus9の運用設定1(ログ出力)

Nexus9監視運用設定と出力

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

以下の仮想labのLinux管理サーバからNexusのLoアドレスを宛先にして監視運用する。
前提条件として監視サーバからNexusのLoアドレスまでNW到達性があること。

f:id:pinn38:20201103083640p:plain

確認すること

ログ出力 : rsyslogサーバ設定と起動

configバックアップ

[root@localhost ~]# cp /etc/rsyslog.conf /etc/rsyslog.conf.bk

設定ファイル編集

[root@localhost ~]# vi /etc/rsyslog.conf 
module(load="imudp") # needs to be done just once
input(type="imudp" port="514")

# Save Nexus9k.log
local5.*                                                /var/log/Nexus9k.log

rsyslog再起動

[root@localhost ~]# systemctl restart rsyslog

rsyslogステータス確認

[root@localhost ~]# systemctl status rsyslog
   Active: active (running)  ←となっていればOK

rsyslogサーバ設定の正常性テスト

[root@localhost etc]# logger -p local5.debug "test info message."
[root@localhost etc]# tail -f /var/log/Nexus9k.log 
Nov  2 20:05:03 localhost user[8154]: test info message.←出力されていればOK
ログ出力 : Nexus9k側設定
logging logfile NXlog 6 size 11111
logging server 172.16.0.1 5 use-vrf default facility local5
logging source-interface loopback0
logging timestamp milliseconds

設定確認 上記設定以外のlog出力設定はデフォルト

Nexus9k# sh logging

Logging console:                enabled (Severity: critical)
Logging monitor:                enabled (Severity: notifications)
Logging linecard:               enabled (Severity: notifications)
Logging timestamp:              Milliseconds
Logging source-interface :      enabled (Interface: loopback0)
Logging rate-limit:             enabled
Logging server:                 enabled
{172.16.0.1}
        server severity:        notifications
        server facility:        local5
        server VRF:             default
        server port:            514
Logging origin_id :             disabled
Logging RFC :                   disabled
Logging logflash:               enabled (Severity: information)
Logging logfile:                enabled
        Name - NXlog: Severity - information Size - 11111


Facility        Default Severity        Current Session Severity
--------        ----------------        ------------------------
aaa                     3                       3
acllog                  2                       2
aclmgr                  3                       3
(省略)

IFをshutしてみる

Nexus9k(config)# int e1/3
Nexus9k(config-if)# shutdown 
Nexus9k(config-if)# no shutdown 

ログサーバで出力確認・・・以下出力確認OK

[root@localhost etc]# tail -f /var/log/Nexus9k.log 
Nov  2 19:50:16 localhost user[7941]: test info message.
Nov  2 19:58:11 40.40.40.40 : 2020 Nov  2 19:58:10.799 JST: %ETHPORT-5-IF_DOWN_CFG_CHANGE: Interface Ethernet1/3 is down(Config change)
Nov  2 19:58:11 40.40.40.40 : 2020 Nov  2 19:58:10.805 JST: %ETHPORT-5-IF_DOWN_ADMIN_DOWN: Interface Ethernet1/3 is down (Administratively down)
Nov  2 19:58:16 40.40.40.40 : 2020 Nov  2 19:58:16.086 JST: last message repeated 1 time
Nov  2 19:58:16 40.40.40.40 : 2020 Nov  2 19:58:16.086 JST: %ETHPORT-5-IF_ADMIN_UP: Interface Ethernet1/3 is admin up .