简介
本文档介绍在vPC设置中Nexus交换机的日志中出现未定义的用户名的原因。
先决条件
要求
本文档没有任何特定的要求。
使用的组件
本文档中的信息基于以下软件和硬件版本:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
背景信息
在Nexus 5000和Nexus 7000平台上运行NX-OS时,即使用户未明确定义这些用户名,也可以在记帐日志中观察到用户名,如“root”、“_emuser”、“svc-isan”和“admin”。这些用户名在交换机中预定义,本文档说明在记帐日志中可以观察到上述用户名的条件。
用户名 |
解释和日志 |
根 |
此测试是在Nexus 5000交换机上执行的。
===================================================
在Nexus 5000上,当运行命令copy run start时,当对其执行配置保存(copy run start)时,用户根将显示在日志中。请参阅以下示例:
Tue May 6 05:25:28 2014:type=update:id=10.10.10.10@pts/0:user=admin:cmd= Performing configuration copy. Tue May 6 05:25:30 2014:type=start:id=vsh.20707:user=root:cmd= Tue May 6 05:25:31 2014:type=stop:id=vsh.20707:user=root:cmd= Tue May 6 05:25:35 2014:type=update:id=10.10.10.10@pts/0:user=admin:cmd= copy running-config startup-config (SUCCESS) |
__eemuser |
此测试是在支持EEM(嵌入式事件管理器)功能的Nexus 5000交换机上执行。
========================================================
当在Nexus 5000交换机上配置EEM脚本,并检测到端口关闭事件时,EEM脚本将进入接口配置模式(在本例中,为了测试目的,特别针对交换矩阵扩展器(FEX)端口Ethernet 114/1/1),并将其恢复。请参阅以下示例:
Nexus5K# sh run eem !Command: show running-config eem !Time: Sun Apr 27 04:56:04 2014 version 6.0(2)N2(4) event manager applet test event syslog pattern "ETHPORT-5-IF_DOWN_NONE" action 1.0 cli enable action 2.0 cli conf t action 3.0 cli interface ether 114/1/1 action 4.0 cli no shut action 5.0 cli end
使用用户名“admin1”登录Nexus 5000,该用户名在本地配置。请参阅此登录会话示例:
Nexus1# show users NAME LINE TIME IDLE PID COMMENT admin1 pts/2 Apr 27 04:31 . 31579 (10.137.76.223) *
手动关闭连接到Nexus 5000的其中一个FEX模块上的端口E114/1/1。端口在此日志中退回:
2014 Apr 27 04:56:26 N5K-C5548UP %ETHPORT-5-IF_DOWN_NONE: Interface Ethernet114/1/32 is down (Transceiver Absent) 2014 Apr 27 04:56:27 N5K-C5548UP %ETHPORT-5-IF_ADMIN_UP: Interface Ethernet114/1/32 is admin up.
在记帐日志中,用户“eem_user”帐户在“admin1”用户手动关闭端口后未执行关闭。请参阅以下示例:
Sun Apr 27 04:56:25 2014:type=update:id=10.10.10.10@pts/2:user=admin1: cmd=configure terminal ; interface Ethernet114/1/1 (SUCCESS) Sun Apr 27 04:56:25 2014:type=update:id=10.10.10.10@pts/2:user=admin1: cmd=configure terminal ; interface Ethernet114/1/1 ; shutdown (REDIRECT) Sun Apr 27 04:56:26 2014:type=update:id=10.10.10.10@pts/2:user=admin1: cmd=configure terminal ; interface Ethernet114/1/1 ; shutdown (SUCCESS) Sun Apr 27 04:56:26 2014:type=start:id=vsh.32539:user=__eemuser:cmd= Sun Apr 27 04:56:27 2014:type=update:id=vsh.32539:user=__eemuser:cmd=configure terminal ; interface Ethernet114/1/1 (SUCCESS) Sun Apr 27 04:56:27 2014:type=update:id=vsh.32539:user=__eemuser:cmd=configure terminal ; interface Ethernet114/1/1 ; no shutdown (REDIRECT) Sun Apr 27 04:56:27 2014:type=update:id=vsh.32539:user=__eemuser:cmd=configure terminal ; interface Ethernet114/1/1 ; no shutdown (SUCCESS)
从上述时间戳和触发EEM脚本时,用户“eem_user”会记录“no shut”的操作。 |
svc-isan |
此测试是在Nexus 7000上执行的。
==================================================
当在Nexus 7000上配置EEM脚本并检测到端口管理关闭事件时,EEM脚本将进入接口配置模式(本例中为FEX接口Ethernet 101/1/10专用于测试目的),并将其恢复。请参阅以下示例:
event manager applet TEST event syslog pattern ".*ETHPORT-5-IF_DOWN_ADMIN_DOWN.*" action 1.0 cli enable action 2.0 cli conf t action 3.0 cli int e101/1/10 action 4.0 cli no shut action 5.0 cli end action 6.0 syslog msg INTERFACE CHANGED TO ADMIN NO SHUT \ action 7.0 syslog priority critical msg INTERFACE HAS BEEN CHANGED TO ADMIN UP
如果E101/1/10关闭,EEM脚本将触发且不关闭端口。在日志中,观察到以下消息:
2014 Mar 12 07:12:37 Nexus_7000 %ETHPORT-5-IF_DOWN_ADMIN_DOWN: Interface Ethernet101/1/10 is down (Administratively down) 2014 Mar 12 07:12:38 Nexus_7000 %ETHPORT-5-IF_ADMIN_UP: Interface Ethernet101/1/10 is admin up . 2014 Mar 12 07:12:38 Nexus_7000 %VSHD-5-VSHD_SYSLOG_CONFIG_I: Configured from vty by admin on vsh.23673 2014 Mar 12 07:12:38 Nexus_7000 %EEM_ACTION-2-CRIT: INTERFACE HAS BEEN CHANGED TO ADMIN UP
在记帐日志中,您会看到,关闭操作由admin执行,该帐户已用于登录Nexus 7000。您会看到EEM已触发,EEM的配置更改已记录为svc-isan。请参阅Nexus 7000的此记帐日志:
Wed Mar 12 07:12:37 2014:type=update:id=10.10.10.10@pts/0:user=admin: cmd=switchto ; configure terminal ; interface Ethernet101/1/10 ; shutdown (REDIRECT) Wed Mar 12 07:12:37 2014:type=update:id=10.10.10.10@pts/0:user=admin: cmd=switchto ; configure terminal ; interface Ethernet101/1/10 ; shutdown (SUCCESS) Wed Mar 12 07:12:38 2014:type=start:id=vsh.23673:user=svc-isan:cmd= Wed Mar 12 07:12:38 2014:type=update:id=vsh.23673:user=svc-isan: cmd=configure terminal ; interface Ethernet101/1/10 (SUCCESS) Wed Mar 12 07:12:38 2014:type=update:id=vsh.23673:user=svc-isan: cmd=configure terminal ; interface Ethernet101/1/10 ; no shutdown (REDIRECT) Wed Mar 12 07:12:38 2014:type=update:id=vsh.23673:user=svc-isan: cmd=configure terminal ; interface Ethernet101/1/10 ; no shutdown (SUCCESS) Wed Mar 12 07:12:38 2014:type=update:id=vsh.23673:user=svc-isan: cmd=syslog msg INTERFACE CHANGED TO ADMIN NO SHUT (SUCCESS) Wed Mar 12 07:12:38 2014:type=update:id=vsh.23673:user=svc-isan: cmd=syslog priority critical msg INTERFACE HAS BEEN CHANGED TO ADMIN UP (SUCCESS) |
admin |
此测试是在一对Nexus 5000上使用config-sync执行的。
========================================================
在一对Nexus 5000上配置同步的预配置可在以下位置找到:配置同步操作。
此配置用于交换机配置文件:
N5K1(config-sync-sp-if)# sh switch-profile buffer
switch-profile : Test ---------------------------------------------------------- Seq-no Command ---------------------------------------------------------- 2 interface Ethernet1/8 2.1 switchport 2.2 switchport mode trunk 2.3 switchport trunk allowed vlan 1-100 2.4 shutdown
提交更改并将其推送到对等交换机。然后确认它已成功应用:
N5K1(config-sync-sp-if)# commit Verification successful... Proceeding to apply configuration. This might take a while depending on amount of configuration in buffer. Please avoid other configuration changes during this time. Commit Successful
现在,检查N5K1上的记帐日志“test_user”,该日志是登录N5K1的用户名,其中记录了配置更改:
Thu Mar 6 08:19:22 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; switchport (REDIRECT) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; switchport (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; switchport (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; switchport mode trunk (REDIRECT) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; switchport mode trunk (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742(sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; switchport trunk allowed vlan 1-100 (REDIRECT) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; switchport trunk allowed vlan 1-100 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; shutdown (REDIRECT) Thu Mar 6 08:19:23 2014:type=update:id=ppm.23742 (sp-commit): user=test_user:cmd= configure terminal ; interface Ethernet1/8 ; shutdown (SUCCESS) Thu Mar 6 08:19:23 2014:type=stop:id=ppm.23742:user=test_user: cmd=Thu Mar 6 08:19:23 2014:type=update:id=10.10.10.10@pts/1: user=test_user:cmd= configure sync ; switch-profile Test ; commit (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=10.10.10.10@pts/1: user=test_user:cmd= configure sync ; commit (SUCCESS)
请参阅此对等Nexus 5000交换机,该交换机将配置更改从N5K1推送。记帐日志报告的时间戳与此相同,并表示“admin”已进行相同的配置更改:
Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit) :user=admin:cmd= configure terminal ; interface Ethernet1/8 ; switchport (REDIRECT) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 ; switchport (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 ; switchport (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 ; switchport mode trunk (REDIRECT) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 ; switchport mode trunk (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 ; switchport trunk allowed vlan 1-100 (REDIRECT) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 ; switchport trunk allowed vlan 1-100 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 (SUCCESS) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 ; shutdown (REDIRECT) Thu Mar 6 08:19:23 2014:type=update:id=ppm.21880 (sp-commit): user=admin:cmd= configure terminal ; interface Ethernet1/8 ; shutdown (SUCCESS) |