Need help in a script for server information
Hello Geeks,
I am new to Scripting. My task is to create a script that would pull the old server(unix) and new server(linux) information and should display all the task information for migration/cutover purpose to the other areas. We already have a script that gives information about ip, subnet, gateway and other information as follows: #readip ad30db01 Server IP Subnet Gateway VLAN 10.x.x.x 255.x.x.x 10.x.x.1 100 There is a main server which has info about all the servers and we execute the readip from the main server which gets info about any old or new server. So, in my script, I am calling this script, and I want to display only few contents of the readip output as follows: Hostname: (I should display the server ip from the read ip only out) Subnet: Should display the subnet from the readip output Gateway: Same Vlan: Same If anyone could help me with this part, I would include it in my script and would ask for the next part if I don't get it. Please let me know if I am not clear. Thank you. |
Code:
for server in <list> You would substitute "<list>" with whatever you want for list. e.g. It could be: for server in ad30db01 ad30db02 ad30db03 --OR-- If you had a file that had a list of servers in it: for server in $(cat <file>) where <file> is replaced with the name of the actual file in which the servers are listed. |
All times are GMT -5. The time now is 06:25 PM. |