Monday, August 9, 2010

Power series AIX find how many threads you have

Power hardware can run multiple cores per socket (cpu) and multiple threads per core.

To find how many threads are running in each core use /usr/sbin/smtctl;

SMT: Simultaneous Multi-Threading


[root@mymachine] / # smtctl

This system is SMT capable.

SMT is currently enabled.

SMT boot mode is not set.
SMT threads are bound to the same virtual processor.

proc0 has 2 SMT threads.
Bind processor 0 is bound with proc0
Bind processor 1 is bound with proc0


proc2 has 2 SMT threads.
Bind processor 2 is bound with proc2
Bind processor 3 is bound with proc2

Thursday, July 22, 2010

IBM Must Gather info links

MustGather for WebSphere Process Server Business Process Choreographer

MustGather for WebSphere Application Server


MustGather for WebSphere Enterprise Service Bus

You can use below trace string *=info:com.ibm.ws.sibx.*=fine:com.ibm.wsspi.sibx.*=all:com.ibm.websphere.sibx.*=all:com.ibm.ws.sib.processor.utils.UserTrace=all:com.ibm.ws.sibx.mediation.primitives.*=all

In case of XSL failures start trace with “com.ibm.ws.sibx.*=all” and look for “Serialized DataObject prior to transformation” and “Result of transformation”.

Must Gather for WebSphere Application Server and WebSphere MQ/JMS trace
WebSphere Application Server V8.0 and V8.5:

*=info:JMSApi=all:Messaging=all:com.ibm.mq.*=all:WAS.j2c=all:Transaction=all

WebSphere Application Server V6 and V7.0:

*=info:JMSApi=all:JMSServer=all:Messaging=all:JMS_WASTraceAdapter=all:com.ibm.mq.*=all:jmsApi=all:WAS.j2c=all:Transaction=all


Must Gather for WebSphere DataPower SOA applicances
WebSphere DataPower SOA Appliances: Ethernet port test



Must Gather for performance, hang, high CPU on AIX


Must Gather for WebSpher MQ



Must Gather for WebSphere Process Server


Must Gather for WebSphere Integration Developer

Must Gather for WebSphere Message Broker

Friday, April 16, 2010

Java Objects from dead very nice java snippet

Challenge: can you write code that invokes foo()?
class Impossible {
public Impossible() {
throw new AssertionError("you cannot instantiate me");
}

public void foo() {
System.out.println("The impossible is possible!");
}
}


http://blog.publicobject.com/2010/04/java-objects-back-from-dead.html


Please visit the link to find the answer. It's very nice


Arun

Friday, February 5, 2010

Get DataObject as String

You can use below snippet to get a given DataObject as String

try {
java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream();
BOXMLSerializer boXml = (BOXMLSerializer) ServiceManager.INSTANCE.locateService("com/ibm/websphere/bo/BOXMLSerializer");
boXml.writeDataObject(myBO, myBO.getType().getURI(), myBO.getType().getName(), bos);
byte[] b = bos.toByteArray();
String s = new String(b);
bos.close();

}catch (java.io.IOException ioe){
ioe.printStackTrace();
}catch (Exception e ) {
e.printStackTrace();
}




Tuesday, February 2, 2010

Search multiple files using find

Search multiple files in multiple directories using find.
find /usr /opt \( -name fileName1 -o -name fileName2 \) -print

Search for fileName1, fileName2 in /usr /opt diretories.




Search and replace a foo with bar in all xml files in a specific directory

for i in `find /directory/Files -name '*.xml' `
do
echo "Changing $i file "
sed 's/foo/bar/g' $i > tmp.xml && mv tmp.txt $i
done

Transfer files accross machines using plink (putty)

Hi;

Quite often we need to download/upload files to different machines. If you have configured putty with certificates; you can use plink and cygwin gzip (to speedup the download/upload).


plink userName@PuttySession gzip -c gzip -d > fileName

Ex:

plink mruser@myServer gzip -c /var/mqm/qmgrs/SampleQmgr/errors/AMQERR01.LOG gzip -d > AMQERR01.LOG

gzip -c will compress the file and writes to stdout
gzip -d will uncompress (using pipe .. it will read from stdout as it's input).

You can also do simple cat and redirect the file...but compress the file would speed-up the transfer.

Monday, January 18, 2010

How to get server name in WebSphere

Hi;

If you need to find the server name programmatically in WebSphere environment you can use below API

import com.ibm.websphere.runtime.*;



System.out.println("Server Display Name " + com.ibm.websphere.runtime.ServerName.getDisplayName());
System.out.println("Server Full Name " + com.ibm.websphere.runtime.ServerName.getFullName());
System.out.println("Server pid " + com.ibm.websphere.runtime.ServerName.getPid());
System.out.println("Server Server ID " + com.ibm.websphere.runtime.ServerName.getServerId());
System.out.println("Server SMF ID " + com.ibm.websphere.runtime.ServerName.getSMFId());