Shell Script for Linux server decommission

Hi Folks,

I would like to create a script for linux server decommissioning which should collect the all configuration details and store in a file. Now the server configuration details are collected manually.

The server configuration detail includes IP, DNS, OS Version, Network Interface Details, Domain Information, WWN & WWPN Number, Local Storage layout, LUN Details and Creating local user with administrator privilege.

Please assist me to get a good script to use in our environment.

Thanks...

People in here will be happy to help you improve, extend, and correct your script, so - any attempts / ideas / thoughts from your side?
You might want to start by assembling in a file all the commands used hitherto to collect manually.

1 Like

RudiC is absolutely right: we help you to help yourself, we don't write your scripts for you:

OK, here is some help: start by describing what "configuration details" these are an how they are collected manually. A list could look like this:

  • IP-address netstat -i
  • fileystems to mount /etc/fstab

etc.. All information either comes from a command (or series of commands) or from the content of some file or from some other source of information (like the place in the rack or the serial number of the hardware - you don't get these things off the server itself usually).

Once you have this list you can start to write a script to get one after the other information and write it down to a file.

I hope this helps.

bakunin

1 Like

Make sure that, having collected all the relevant information, you get the output off to another server that you will not be decommissioning.

Don't laugh, I've seen it not done to the point of "...well I stored the root password plaintext in a file on the server somewhere, but I don't know it so I can't get back in to find it....." sort of issues. Of course we got round it, but let's not fire up the server again if you don't have to.

Kind regards,
Robin