Wednesday, May 30, 2012

Finding WWN of HBA on Linux

/usr/sbin/hbanyware/hbacmd listhbas

[root@hqiqlrajdb01 ~]# /usr/sbin/hbanyware/hbacmd listhbas


Manageable HBA List

Port WWN : 10:20:00:00:c9:cc:52:08

Node WWN : 20:00:00:00:c9:cc:52:08

Fabric Name: 20:29:00:35:73:a1:15:01

Flags : 8010fe0d

Host Name : testdb01

Mfg : Emulex Corporation

Serial No. : 5CJKL11490ZD

Port Number: 0

Mode : Initiator


Port WWN : 10:00:99:00:c9:cc:52:09

Node WWN : 20:00:90:00:c9:cc:52:09

Fabric Name: 00:00:00:00:00:00:00:00

Flags : 8000fe0d

Host Name : testdb01

Mfg : Emulex Corporation

Serial No. : 5ZF11490ZD

Port Number: 1

Mode : Initiator




Thursday, May 3, 2012

TimeZone change (Permanent without reboot) on RedHat Linux 5.7.

Today I would like to share Time Zone chane on RHEL 5.7 - Simple
But need to have the info on time & quick. Four commnds! :-)

cd /etc
rm localtime
ln -s /usr/share/zoneinfo/America/New_York localtime
date

Thats it!

Thanks.

Thursday, March 29, 2012

How to Add NAS path on the mount point on RHEL 5.7.

This is a short note on adding the NAS path once it has been allocated by the EMC storage Engineer for the respective servers.


You will get the path information looking like this:


file://10.168.11.111/234590_MQL.


You have to convert that according to the fstab file syntax.


10.168.11.111:/234590_MQL /usr/app/share nfs rw,nolock,soft,intr,bg,nfsvers=3,rsize=32768,wsize=32768,proto=tcp 0 0


Now reboot the server and run df -h command to check the NAS mount.

Below is an example:


root@sandbox03 ~ # df -h

Filesystem Size Used Avail Use% Mounted on


10.168.11.111:/234590_MQL

197G 608K 197G 1% /usr/app/share



Thanks,

-Raj

Thursday, March 1, 2012

Finding only "Files", "Directories and soft links in the Existing directory.

Hi This may be a small and good tip - instead of writing a shell script, which I was trying to find only files in the existing directory. And just thought of using the unix inbuilt command "find" to do this :-)
1.Find only Files in the existing dir:
 find . -type f -name '*'
2.Find only Directory in the existing directory.
 find . -type d -name '*'
3 find only symbolic links
 find . -type l -name '*' 10:12:10

10:12:10 rsangvik@test100 $ ls -l


total 188

-rw-r--r-- 1 rsangvik users 65 Feb 29 10:12 an.pl

-rw-r--r-- 1 rsangvik users 138 Feb 29 12:23 apple

-rwxr-xr-x 1 rsangvik users 75 Feb 29 10:32 array.pl

-rwxr-xr-x 1 rsangvik users 181 Feb 23 15:48 break

-rwxr-xr-x 1 rsangvik users 216 Feb 16 15:03 com_output.sh

-rwxr-xr-x 1 rsangvik users 186 Feb 23 15:36 dater

-rwxr-xr-x 1 rsangvik users 276 Feb 29 10:28 default_scalar.pl

-rw-r--r-- 1 rsangvik users 784 Feb 29 11:32 echo

-rwxr-xr-x 1 rsangvik users 67 Feb 29 10:03 foreach.pl

-rwxr-xr-x 1 rsangvik users 151 Feb 29 09:32 if.pl

-rwxr-xr-x 1 rsangvik users 125 Feb 29 09:26 input.pl

-rw-r--r-- 1 rsangvik users 7001 Feb 29 11:56 mytestfile

-rwxr-xr-x 1 rsangvik users 87 Feb 29 15:32 num.pl

-rwxr-xr-x 1 rsangvik users 282 Feb 29 15:11 parse1.pl

-rwxr-xr-x 1 rsangvik users 224 Feb 29 11:52 parse.pl

-rwx------ 1 rsangvik users 113 Feb 13 16:16 passcrypt.pl

-rwxr-xr-x 1 rsangvik users 139 Feb 29 10:57 pop.pl

-rwxr-xr-x 1 rsangvik users 168 Feb 29 11:15 push.pl

-rwxr-xr-x 1 rsangvik users 241 Feb 29 15:02 regex.pl

lrwxrwxrwx 1 rsangvik users 6 Mar 1 10:06 soft -> num.pl

drwxr-xr-x 2 rsangvik users 4096 Mar 1 09:43 test

-rwxr-xr-x 1 rsangvik users 66 Feb 29 10:10 while.pl

-rw-r--r-- 1 rsangvik users 7001 Feb 29 11:56 yourtestfile

[~/script]

10:12:13 rsangvik@test100 $ find . -type f -name '*'

./parse1.pl

./com_output.sh

./num.pl

./foreach.pl

./an.pl

./parse.pl

./apple

./passcrypt.pl

./echo

./break

./push.pl

./yourtestfile

./pop.pl

./if.pl

./default_scalar.pl

./input.pl

./while.pl

./dater

./regex.pl

./mytestfile

./array.pl

[~/script]

10:12:19 rsangvik@test100 $ find . -type d -name '*'

./test

[~/script]

10:12:26 rsangvik@test100 $ find . -type l -name '*'

./soft

Tuesday, October 18, 2011

Patch 144325-01 failed to install due to a failure produced by pkgadd.

Patching the Solaris 10 Sparc to the latest patch level.
While patching the server I got this error and tried to search internet, Got some answers But they were contradicting each other.
Hence thought jotting down the issue here so that, this blog will act as a reference material for me and many other in case.....
1.
-bash-3.00$ metastat -c
d4 m 10GB d40 d41
d40 s 10GB c1t0d0s4
d41 s 10GB c1t1d0s4
d3 m 10GB d30 d31
d30 s 10GB c1t0d0s3
d31 s 10GB c1t1d0s3
d1 m 27GB d10 d11
d10 s 27GB c1t0d0s0
d11 s 27GB c1t1d0s0


metadb metadetach metadevadm
bash-3.00# metadetach d1 d11
d1: submirror d11 is detached
bash-3.00# metadetach d3 d31
d3: submirror d31 is detached
bash-3.00# metadetach d4 d41
d4: submirror d41 is detached
bash-3.00# metastat -c
d4 m 10GB d40
d40 s 10GB c1t0d0s4
d3 m 10GB d30
d30 s 10GB c1t0d0s3
d1 m 27GB d10
d10 s 27GB c1t0d0s0
d41 s 10GB c1t1d0s4
d31 s 10GB c1t1d0s3
d11 s 27GB c1t1d0s0

2. copy the output of various commands like...

# cat /etc/vfstab ; ulimit -a ; mount ; df -h ; sysdef -i; prtconf > /tmp/prepatch_`hostname`.txt

3. Boot the system in # init 0

4. at ok prompt ok boot -s

5 Assuming that the patches have already been copied to the desired location.

6. Once I hooked the script got the following error:

Approved patches will be installed in this order:

144325-01


Checking installed patches...
Executing prepatch script...
Verifying sufficient filesystem capacity (dry run method)...

Patch 144325-01 failed to install due to a failure produced by pkgadd.

See /var/sadm/patch/144325-01/log for details

Patchadd is terminating.

some of the post suggested to add the "install" account and "nobody"
account. this did not help. But while patching previous server I did not got this type of error, so just tried to recall what different I did here. Got it!

While copying the patches on the server to be patched I always created a dir with 777 permissions and will then delete, once done.

This time I had created a dir 766 and that was causing this error so ran.....

# chmod -R 777 /patch

# ./patchadd

that's it!

Happy patching.

Wednesday, August 31, 2011

Apache Tomcat 5.5.33 installation on RedHat Linux 5.4



Download the following 2 files from the

http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html

http://apache.mesi.com.ar/tomcat/tomcat-5/v5.5.33/bin/apache-tomcat-5.5.33.tar.gz

http://apache.mesi.com.ar/tomcat/tomcat-5/v5.5.33/bin/apache-tomcat-5.5.33-admin.tar.gz

[root@rajphx tmp]# pwd
/tmp

[root@rajphx tmp]# ls -ltr /tmp/

-rw-rw-r-- 1 test test 81030452 Aug 30 23:52 jdk-7-linux-i586.rpm
-rw-rw-r-- 1 test test 6531699 Aug 30 23:53 apache-tomcat-5.5.33.tar.gz

[root@rajphx tmp]# rpm -ivh jdk-7-linux-i586.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...


Now....

Add following line once the jdk is installed. This rpm contains both JAVA runtime and development package.

vi /etc/java/java.conf

JAVA_HOME="/usr/java/jdk1.7.0"

# export JAVA_HOME=/usr/java/jdk1.7.0/

I have copied the apache tomcat tar file in the /opt/tomcat. This may vary as per the requirement.
May be you can install in /var as per the production requirement. But this depends.

[root@rajphx tomcat]# ls -l
total 10888
drwxr-xr-x 11 root root 4096 Aug 31 01:05 apache-tomcat-5.5.33
-rw-r--r-- 1 root root 2918400 Aug 31 01:04 apache-tomcat-5.5.33-admin.tar
-rw-r--r-- 1 root root 8205713 Aug 31 00:59 apache-tomcat-5.5.33.tar.gz



[root@rajphx bin]# ./startup.sh
Using CATALINA_BASE: /opt/tomcat/apache-tomcat-5.5.33
Using CATALINA_HOME: /opt/tomcat/apache-tomcat-5.5.33
Using CATALINA_TMPDIR: /opt/tomcat/apache-tomcat-5.5.33/temp
Using JRE_HOME: /usr/java/jdk1.7.0/
Using CLASSPATH: /opt/tomcat/apache-tomcat-5.5.33/bin/bootstrap.jar
[root@rajphx bin]# ps -ef | grep tomcat
root 10390 1 99 01:00 pts/1 00:00:08 /usr/java/jdk1.7.0//bin/java -Djava.util.logging.config.file=/opt/tomcat/apache-tomcat-5.5.33/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/apache-tomcat-5.5.33/common/endorsed -classpath /opt/tomcat/apache-tomcat-5.5.33/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat/apache-tomcat-5.5.33 -Dcatalina.home=/opt/tomcat/apache-tomcat-5.5.33 -Djava.io.tmpdir=/opt/tomcat/apache-tomcat-5.5.33/temp org.apache.catalina.startup.Bootstrap start
root 10432 9365 0 01:00 pts/1 00:00:00 grep tomcat


Now accessthe apache tomcat by typing this in your browser window.

http://192.168.1.332:8080/

Friday, June 24, 2011

How to find the heap size in weblogic 10.2 ?

I had this question asked by one of our developer. reaserched on Internet But could not find the straight answer. The output I was trying to get was on command line
with JAVA, looks like there is a java program available on internet. But did not wanted to put that on the server, as I am not a JAVA developer :-)

The simple way i found the information is:
Go to the actual installation path of Weblogic and find the files ending by extension .ini OR .cf. I am not sure if this is application specific. And grep

bash-3.00$ grep -i MaxPermSize *

HEAP="-Xms512m -Xmx768m -XX:NewSize=86m -XX:MaxPermSize=256m"

so you need to be in the folder where the configuration files of the Weblogic are residing.