Connectrix Cisco MDS-Series: How to edit the SCG script to enable password encoding
Summary: SCG, Base64 encoding, Cisco, ESRS script, password Base64 Encoding
Instructions
This is part of the "SCG Callhome setup" Steps generated via the SolveOnline for Cisco, editing the script through a LINUX machine to enable password encoding (Base64).
Below are the samples explained for TASK 3 and 4 of that procedure.
IMPORTANT: Before editing the script, you will need to generate an Access Code and PIN which will be used as the username and password in the script. This process needs to be done for every switch that you are configuring.
See the following article for the steps to generate an Access Code and PIN (procedure is the same for Brocade and Cisco switches):
https://www.dell.com/support/kbdoc/en-us/000345325
Task 3: Editing the script through a LINUX machine to enable password encoding (Base64).
3. Copy the
ch_script_<NX-OS Version>.tar file and esrs_auth.sh files downloaded from DELL support site to a Linux server.
Example:
- Copying from a Windows hosts to the Linux server can be that can be done with WINSCP.
Result in Linux root directory:
[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 and esrs_auth.sh files.
Execute the esrs_auth.sh bash file using command “bash esrs_auth.sh”.
Example and provide the requested information through the CLI (note: the username will be the Access Code and the passsword will be the PIN which were generated at the start):
[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 ~]#
Copy the modified script off the Linux host to an ftp server via Winscp.
Copy the modified script ch_script_<NX-OS version>.tar file from Linux server to the switch bootflash:scripts directory.
(In case of Directors, copy the .tar file to both Active and standby supervisors (bootflash://sup-active/scripts and bootflash://sup-standby/scripts))
Example to a switch.
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#
Task 4: Enable ESRS ConnectHome on the MDS switch.
7. Enable ESRS ConnectHome on the MDS switch
Example:
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)#
Note: After you execute the above command, make sure the device is added to the SRS gateway through REST.
Login to the WebUI of ESRS gateway installed at customer site and go to Alerts page.
The device added successfully will be entered an alert with status 201.
If status is 401, then there is authentication error and device is not added to the gateway.
(401 means authentication error "Managed product Serial Number field is missing in REST request." or "Device Model is missing in REST request."
Note: If you map any one alert group to the script name, by default ALL the alert group will be mapped to script.
By default you can enable the “All” alert group.
If you are configuring switch for first time, make sure the callhome and cfs distribution is enabled on the switch.
Use the below commands to enable callhome and cfs distribution:
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#
Continue further in the procedure of the SCG Callhome setup steps
NOTE: The generated file does contain sensitive information and should be deleted from the Windows/Linux hosts after it has been copied over to the switch.