Shell Script for Linux server decommission


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script for Linux server decommission
# 1  
Old 08-10-2017
RedHat 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...
# 2  
Old 08-11-2017
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.
This User Gave Thanks to RudiC For This Post:
# 3  
Old 08-11-2017
RudiC is absolutely right: we help you to help yourself, we don't write your scripts for you:

Quote:
Originally Posted by seenuvasan1985
which should collect the all configuration details and store in a file
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
This User Gave Thanks to bakunin For This Post:
# 4  
Old 08-11-2017
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

Last edited by rbatte1; 08-11-2017 at 07:26 AM.. Reason: Punctuation correction.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Except script to run a local shell script on remote server using root access

local script: cat > first.sh cd /tmp echo $PWD echo `whoami` cd /tmp/123 tar -cvf 789.tar 456 sleep 10 except script: cat > first #!/usr/bin/expect set ip 10.5.15.20 set user "xyz123" set password "123456" set script first.sh spawn sh -c "ssh $user@$ip bash < $script" (1 Reply)
Discussion started by: Aditya Avanth
1 Replies

2. UNIX for Dummies Questions & Answers

Copy files from Linux server local windows machine using a shell script

Hello, I need to create a shell script which will copy files - which are created on particular date and starting with particular name - to local windows XP machine. Is this possible.? Currently it is being done manually using winscp (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies

3. Shell Programming and Scripting

Shell script to copy a file from one server to anther server and execute the binary

Hi , Is there any script to copy a files (weblogic bianary + silent.xml ) from one server (linux) to another servers and then execute the copy file. We want to copy a file on multiple servers and run the installation. Thanks (1 Reply)
Discussion started by: Nawrajesh
1 Replies

4. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

5. Shell Programming and Scripting

Shell script for FTP a file from one server to another server

Hi Can any one help me for script. I need a script and this script has to execute daily to move the files. FTP from one server to another server EX: Sep 10 06:24 abc.txt Sep 11 06.56 abc.txt Sep 12 08.23 abc.txt these files are located at a/b/c/e/f in 123 server and copy... (0 Replies)
Discussion started by: mahantysk
0 Replies

6. Shell Programming and Scripting

FTP from Linux to windows server by shell script

Hi, Please advice whether my below requirement is feasible, My requirement : Automated FTP from linux server to windows server using a shell script on every monday. If feasible, please help me how to do this ? Thanks in advance (2 Replies)
Discussion started by: apsprabhu
2 Replies

7. UNIX for Dummies Questions & Answers

Linux Shell Question: how to print the shell script name ?

Suppose I have a script named "sc.sh" in the script how to print out its name "sc.sh"? (3 Replies)
Discussion started by: meili100
3 Replies

8. HP-UX

Need to decommission numerous HP N class servers...any thoughts to do quickly?

I have numerous N-class servers with internal and external disks that I need to wipe. Does anyone have any ideas to do this quick and painless. Anything other than a sledge hammer Also, do I need to be in single-user mode and if so how do I do that? Servers are running 11.11 Thanks (3 Replies)
Discussion started by: itry
3 Replies

9. Shell Programming and Scripting

how to move a file from one server to another server using FTP in shell script?

I have a file --> file1.txt i need to copy this file to another server using FTP....the 2 servers are server1 and server2..may i know how to write a script that can do this? thanks in advance! Im a newbie to this... (4 Replies)
Discussion started by: forevercalz
4 Replies
Login or Register to Ask a Question