Вы находитесь на странице: 1из 1

#!

/bin/bash
#Collecting Server configuration detail for decommission process, also backkup the
detials and send by mail.

#Collect the server OS details"


uname -a > test1

#Collect the server IP details"


ifconfig -a > test2

#Collect the DNS configuration"


cat /etc/resolve.conf > test3

#Collect the server version and MAC address"


cat /etc/redhat-release > test4
ifconfig -a | sed -n '1p' | awk ' { print $4, $5 } ' > test4

#Collect the server serial number"


dmidecode | grep -i serial > test5

#Collect the server network details "


netstat -a > test6

#Collect the LUN information "


cat /proc/scsi/scsi > test7
dmesg | grep -i "attached " >> test7

#Collect the WWN number "


systool -c scsi_host -v > test8
cat /sys/class/scsi_host/host*/port_name >> test8

#Collect the local storage details "


fdisk -l > test9

#Display the multipath I/O details"


multipath -l > test10

#Collecting the multiple file details into single file


cat test1.txt test2.txt test3.txt test4.txt test5.txt test6.txt test7.txt test8.txt
test9.txt test10.txt > backup.txt && ./backup < backup.txt

#Sending the backup file by mail.


uuencode backup.txt | mailx -s "decommission backup"
s.q.krishnamoorthy@accenture.com

Вам также может понравиться