Connectrix Cisco MDS 系列:如何编辑 SCG 脚本以启用密码编码
Summary: SCG, Base64 编码, Cisco, ESRS 脚本, 密码 Base64 编码
Instructions
这是通过 SolveOnline for Cisco 生成的“SCG Callhome 设置”步骤的一部分,通过 LINUX 计算机编辑脚本以启用密码编码 (Base64)。
以下是针对该过程的任务 3 和 4 解释的示例。
重要提示:在编辑脚本之前,您需要生成访问代码和 PIN,它们将用作脚本中的用户名和密码。 需要为您配置的每台交换机执行此过程。
有关生成访问代码和 PIN 的步骤,请参阅以下文章(Brocade 和 Cisco 交换机的步骤相同):
https://www.dell.com/support/kbdoc/en-us/000345325
任务 3:通过 LINUX 计算机编辑脚本以启用密码编码 (Base64)。
3.复制
ch_script_<NX-OS Version>.tar 文件和 esrs_auth.sh 从 DELL 支持站点下载到 Linux 服务器的文件。
示例:
- 可以使用 WINSCP 从 Windows 主机拷贝到 Linux 服务器。
导致 Linux 根目录:
[root@host ~]# ls
anaconda-ks.cfg Desktop Downloads index.html Music Public Videos
ch_script_v8_4_2b.tar Documents esrs_auth.sh initial-setup-ks.cfg Pictures Templates
[root@host ~]#
ch_script.tar 和 esrs_auth.sh files.
执行 esrs_auth.sh bash 文件使用命令 “bash esrs_auth.sh”.
示例并通过 CLI 提供请求的信息(注意:用户名将是访问代码,密码将是开始时生成的 PIN):
[root@host ~]#
[root@host ~]# bash esrs_auth.sh
Enter script file name: ch_script_v8_4_2b.tar
Enter username for add/del of device to ESRS backend: ABCA9F6D
Enter password for add/del of device to ESRS backend: ****
Enter esrsv-primary-ipaddress of the product: 10.xx.yy.zz
Enter serial number of the product: XXX12345-CLI
Enter ip-address of the product: 1.2.3.4
Enter esrs model of the product: CONNECTRIX-GW
product-connectivity-add.sh updated...
Product ESRSV Primary address updated...
Product serial number updated...
Product IP Address updated...
Product esrs model updated...
[root@host ~]#
[root@host ~]# mv ch_script_v8_4_2b.tar ch_script_v8_4_2b_edit.tar
[root@host ~]#
通过 Winscp 将修改后的脚本从 Linux 主机复制到 ftp 服务器。
复制修改后的脚本 ch_script_<NX-OS version>.tar 文件从 Linux 服务器复制到交换机 bootflash:scripts 目录。
(如果是控制器,请将.tar文件同时复制到活动和备用管理程序 (bootflash://sup-active/scripts and bootflash://sup-standby/scripts))
交换机的示例。
MDS-9250i#
MDS-9250i# copy ftp://anonymous@aa.bb.cc.dd/cisco/ch_script_v8_4_2b_edit.tar bootflash:scripts/ch_script_v8_4_2b_edit.tar
Password:
Copy complete, now saving to disk (please wait)...
MDS-9250i#
MDS-9250i# dir bootflash:scripts/
112640 Feb 18 12:53:05 2021 ch_script_v8_4_2b_edit.tar
Usage for bootflash://sup-local
869765120 bytes used
2489880576 bytes free
3359645696 bytes total
MDS-9250i#
任务 4:在 MDS 交换机上启用 ESRS ConnectHome。
7. 在 MDS 交换机上启用 ESRS ConnectHome
示例:
MDS-9250i#
MDS-9250i# config
MDS-9250i(config)#
MDS-9250i(config)# callhome
MDS-9250i(config-callhome)#
MDS-9250i(config-callhome)# alert-group all script-name ch_script_v8_4_2b_edit.tar
MDS-9250i(config-callhome)#
提醒:执行上述命令后,确保通过 REST 将设备添加到 SRS 网关。
登录到客户站点安装的 ESRS 网关的 WebUI,然后进入 Alerts 页面。
成功添加的设备将进入状态为 201 的警报。
如果状态为 401,则存在身份验证错误,设备未添加到网关。
(401 表示身份验证错误“REST 请求中缺少托管产品序列号字段”或“REST 请求中缺少设备型号”。
注意:如果将任何一个警报组映射到脚本名称,默认情况下,所有警报组都将映射到脚本。
默认情况下,您可以启用“所有”警报组。
如果您是首次配置交换机,请确保在交换机上启用了 callhome 和 cfs 分发。
使用以下命令启用 callhome 和 cfs 分发:
MDS-9250i# config
Enter configuration commands, one per line. End with CNTL/Z.
MDS-9250i(config)#
MDS-9250i(config)# callhome
MDS-9250i(config-callhome)#
MDS-9250i(config-callhome)# enable
MDS-9250i(config-callhome)#
MDS-9250i(config-callhome)# distribute
MDS-9250i(config-callhome)#
MDS-9250i(config-callhome)# commit
MDS-9250i(config-callhome)#
MDS-9250i#
MDS-9250i# show callhome status
Distribution : Enabled
MDS-9250i#
MDS-9250i#
MDS-9250i# show cfs application name callhome
Enabled : Yes
Timeout : 20
Merge Capable : Yes
Scope : Physical-fc-ip
Region : Default
MDS-9250i#
继续执行 SCG Callhome 设置步骤
的步骤说明:生成的文件确实包含敏感信息,应在拷贝到交换机后从 Windows/Linux 主机中删除。