Config Server - SH

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

[BEGIN] 27/06/2019 04:47:49 a. m.

(/home/admunix) $ cat config_server.sh | more


#!/bin/ksh
echo " ************ Archivos de configuracion del equipo ************* "
echo "uname -a"
uname -a >> config_`uname -n`_`date "+%m%d%y"`.txt
echo "" >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "Version de SO servidor"


cat /etc/*release >> config_`uname -n`_`date "+%m%d%y"`.txt
echo "" >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "Numero de Serie servidor"


lshal|egrep -i "system.serial" >> config_`uname -n`_`date "+%m%d%y"`.txt
echo "" >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "uptime"
uptime >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "date"
date >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "df -h"


df -h >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "mount"
mount >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "/etc/fstab"
more /etc/fstab >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "Interfaces IPs"


/sbin/ip add show >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "Tabla de ruteo"


netstat -ran >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "Procesadores"
cat /proc/cpuinfo| egrep -i "processor" >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo "Memoria Total"


cat /proc/meminfo|grep -i "MemTotal" >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo " Servicios "


chkconfig --list >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo " Bonding "


cat /proc/net/bonding/bond0 >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt
echo " Bonding "
cat /proc/net/bonding/bond1 >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo " Bonding "


cat /proc/net/bonding/bond2 >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo " Bonding "


cat /proc/net/bonding/bond3 >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo " Bonding "


cat /proc/net/bonding/bond4 >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo " Permisos discos "


ls -lrt /dev >> config_`uname -n`_`date "+%m%d%y"`.txt
echo >> config_`uname -n`_`date "+%m%d%y"`.txt

echo ""
uptime | awk '{print "Dias Arriba:"$3}' >> config_`uname -n`_`date "+%m%d%y"`.txt

echo ""
echo "Memoria usada: $((`free -m | grep '+' | awk '{print $3}'`*100/`free -m | grep
'Mem:' | awk '{print $2}'`))% (`free -m | grep '+' | awk '{print $3}'`MB) de `free
-m | grep 'Mem:' | awk '
{print $2}'`Mb Disponible" >> config_`uname -n`_`date "+%m%d%y"`.txt

echo ""

top -n 1 | grep Cpu| awk '{print "Consumo de CPU="$5" Libre"}' >> config_`uname -
n`_`date "+%m%d%y"`.txt

echo ""

top -n 1 | grep Swap| awk '{print "Consumo de swap="$6" Libre"}' >> config_`uname
-n`_`date "+%m%d%y"`.txt

echo ""

(admunix@ixtlmxbesg5:SKULL)

[END] 27/06/2019 04:47:58 a. m.

You might also like