UnixPedia : HPUX / LINUX / SOLARIS: HPUX : SERVER DOWNTIME PRE AND POST CHECKS

Friday, January 3, 2014

HPUX : SERVER DOWNTIME PRE AND POST CHECKS

DATA COLLECTOR :

PRE IMPLEMENTION


Make a executable file :
#cat >Data_pre.sh
Loggin=`logname`
export  DIR=/home/$Loggin/ 
cd $DIR
mkdir $DIR/todayaction2;cd todayaction2;parstatus >parstatus.pre_output;setboot -v >setboot.pre_output; \
bdf >bdf.pre_output;vparstatus >vparstatus.pre_output; \
sysdef > sysdef.pre_output; \
vgdisplay  -v >vgdisplay.pre_output; \
tail /var/adm/syslog/syslog.log > syslog.pre_output; \
ioscan >ioscan.pre_output;netstat -in >netstat.pre_output; \
cmviewcl -v >cmviewcl.pre_output;lanscan >lanscan.pre_output; \
ps -ef |grep -i pmon >oracle.pre_output;netstat -rn >netrpre_outpute.pre_output; \
swapinfo -tam >swap.pre_output; \
ps -efx >Porcess.pre_output; \
mount  -v   >mount-v-pre_output ; mount  -p >mount-p-pre_output ; \
lvlnboot -v >lvlnboot.pre_output ;ps -ef |grep -i horc > horc.pre_output; \
showmount -e >showmount-e-pre_output ; showmount -a >showmount-a-pre_output; \
uptime >uptime-pre_output ; vgdisplay -v >vgdisplay_pre_output; \
cp -p /etc/lvmtab /etc/lvmtab.`logname`.`date +%d-%m-%Y`.pre_output

tar -cvf  /home/$Loggin/Data_collectoin_`uname -n`_Before.tar /home/$Loggin/todayaction2
uuencode  /home/$Loggin/Data_collectoin_`uname -n`_Before.tar Data_collectoin_`uname -n`_Before.tar | mailx -m -s " Data_collectoin_`uname -n`_Before.tar " $Loggin@its.njn.com

put the correct domain


POST IMPLEMENTATION.
Make a executable file :
#cat >Data_Post.sh       

Loggin=`logname`
export DIR=/home/$Loggin/ 
cd $DIR
mkdir $DIR/todayaction2;cd todayaction2;parstatus >parstatus.post_output;setboot -v >setboot.post_output; \
sysdef > sysdef.post_output; \
bdf >bdf.post_output;vparstatus >vparstatus.post_output; \
vgdisplay  -v >vgdisplay. post_output; \
tail /var/adm/syslog/syslog.log > syslog.post_output; \
ioscan >ioscan.post_output;netstat -in >netstat.post_output; \
cmviewcl -v >cmviewcl.post_output;lanscan >lanscan.post_output; \
ps -ef |grep -i pmon >oracle.post_output;netstat -rn >netrpre_outpute.post_output; \
swapinfo -tam >swap.posst_output; \
ps -efx >Porcess.post_output; \
mount  -v   >mount-v-post_output ; mount  -p >mount-p-post_output ; \
lvlnboot -v >lvlnboot.post_output ;ps -ef |grep -i horc > horc.post_output; \
showmount -e >showmount-e-post_output ; showmount -a >showmount-a-post_output; \
uptime >uptime-post_output ; vgdisplay -v >vgdisplay_post_output; \
cp -p /etc/lvmtab /etc/lvmtab.`logname`.`date +%d-%m-%Y`.post_output
tar -cvf  /home/$Loggin/Data_collectoin_`uname -n`_After.tar /home/$Loggin/todayaction2
uuencode /home/$Loggin/Data_collectoin_`uname -n`_After.tar Data_collectoin_`uname –n`_After.tar | mailx -m -s " Data_collectoin_`uname -n`_After.tar " $Loggin@its.njn.com

put the correct domain 

No comments:

Post a Comment