Friday, January 25, 2013

Script For Searching alerts in Syslog and Dropping a mail


#!/usr/bin/sh
#################################################################################
#       Script Name  : syslog_error_chk.sh                                                                                                     #                                                                                    
#                                                                                                              #                                                              
#       Description  : Searches for errors in syslog and mail .                                                                        #                                                          
#################################################################################

Thursday, January 24, 2013

Unix Interview Questions

How to convert a ext2 file system to ext3 ?

What modprobe will do in Linux ?

what is the use of kudzu ?



@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@

How to print two files columwise in third file ?

paste -d' ' file1 file2 

How to check different error count in a log file ?

Maintain error count record and if the error count is more than previous ignore. if the error count is less than previous reset the counters.  

How to reverse a string or check weather its a palindrome or not ?

string_new = rev string1 #### it gives the reverse of the string.
test string_new = string1; if [$? -eq 0] ;then do echo "its a palindrome";fi

########################################################3

1) Tell me about yourself ?

2) tell me your day to day activities ?

3.) replacing a boot disk ?

4) patching HP-Ux ?

5) Hardware models you worked on ?

6) processor of Hp9000 series ?

7) How do you trouble shoot ?

8) script to cut a particular field ?

9) script to print a file reversely ?

tail -r myfile.txt

or
tac reverse of cat

tac myfile.txt

10) perl scripting exp >. ?

11)  Disk addition ?

12) Disk addition in cluster ?

13) creating a software depot ?

14) checking model /

15) do you have any specific questions ?



***************************************

 Tell me about your work .. ?

Rate yourself in Perl Scripting and Shell scripting ?

How you write modules in puppet ?

About exadata & Data Ontap ?

Perl Scripting:

 -- > Autoloader ?

---> Difference between a module and package ?

Tell me about your environment in puppet ?

How to configure password less ssh ?

Any Other Questions to Ask ?

*************************************
***********************************
Tell me about yourself?

How do you rate on scale of 1-10?

Hp Service Guard?
 How to configure a package?

How do you mirror lv?

How do you restore a failed disk?

what is major number ? minor number ?

Saturday, January 12, 2013

Useful links


Redhat LVM



Linux SAN and devices:


Solaris file system:


Hpux Bad disk:






Hp Ux Troubleshooting:


Sunday, September 9, 2012

Capacity Request for LVM (Hp ux and Redhat)

Types:

Linux Normal::

1. discover new disk by scanning hbas (vendor specific scripts ) or echo "- - -"
2. then use fdisk
3.pvcreate /dev/rdsk/C0t1d23
4.mknod
5.vgcreate
6.lvcreate
   b.) makefs
7.mount

##################for existing lv ##########
vgextend
lvextend
extend2fs  or resize2fs depending on the version which supports

Linux Cluster::

For Cluster follow the same procedure ..

we have to restart cluster service in other node
service cmcld stop/start

Hp-Ux Normal:

1.) take ioscan out put to one file & then do insf -c disk to discover the disk
2.) take ioscan out put and compare to find new disks
3.) pvcreate /dev/rdsk/cxtydz
4.)vgcreate
5.)lvcreate
6.)makefs
7.)mount


##################for existing lv ##########
vgextend
lvextend
fsadm or extendfs depending on the version which supports

Hp-Ux Cluster:

Follow the above steps .  . if extended vg then we have to do vgexport in preview mode and  in other node we to export the vg and we have to import again with new map file.

Node 1: (active)
vgexport -p -v -s -m old.dsk old.map /dev/testvg
scp old.map node2:/

Node 2:
vgexport /dev/testvg
vgimport -m old.map -s /dev/testvg



Hp-Ux BCV / GBCV :

We have to mask the corresponding BCV / GBCV luns

Common Problems::

1.) File system is 100% utilized..
 a) then we have to extend small amount
 b) Free up some space to write
2.) Number of free PE s completed
3.) Need to defragment the file system


Wednesday, April 4, 2012

grep -r in Hp-Ux // Recursive grep in Hp-Ux


We can use the below script to search recursively in hp-ux. We can added this to path. so that we can run it directly any time.

#!/usr/bin/sh
typeset DIR=$1
typeset PAT=$2
find ${DIR} -xdev -type f | while read FILE
do
[ `file ${FILE} | grep -c ascii` -eq 0 ] && continue
grep "$PAT" ${FILE} /dev/null
done
exit 0