I need to get SSH banner from bunch of nodes from Cisco ACI. Let's name it as ABC-ACI-APC-01
configured with IP Address 10.1.1.1
.
Let say there are 50 IP Addresses available in this ACI started from 10.1.1.2
till 10.1.1.50
I can SSH manually one by one like this to get the device's SSH banner. But this is not the best solution considering the number of devices that I have.
ABC-ACI-APC-01# ssh [email protected]
=======================================================================
UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED
You must have explicit, authorized permission to access or configure
this device.
Unauthorized attempts and actions to access or use this system may
result in civil and/or criminal penalties.
All activities performed on this device are logged and monitored.
=======================================================================
Password:
Last login: Thu Mar 19 07:56:09 2020 from 10.1.1.254
Cisco Nexus Operating System (NX-OS) Software
XYZ_ACI_LEF_01#
XYZ_ACI_LEF_01# vsh_lc
vsh_lc_ro
module-1# show clock
11:14:57.091 UTC Mon Mar 23 2020
module-1#
module-1# exit
XYZ_ACI_LEF_01#
SSH again, repeat the process.
Looking at the number of nodes, would it be possible to automate this?
Is there any sample script I can use and run it from Cisco ACI which is ABC-ACI-APC-01 in this case?
What I want to do is to read the IP list from file, let say ip.txt
Perform the SSH, get in, and run additional command which is vsh_lc, followed by show clock.
Then, exit and repeat the same process again.
10.1.1.2
till10.1.1.50
and the script needs to be run from the ACI itself10.1.1.1
.