Monday, November 23, 2015

AIX commands


to compress content in current directory tar -cvf zip.tar .
to compress content in home directory tar -cvf zip.tar /home
to gzip content gzip scripts.tar
to extract to .tar file  gzip -d scripts.tar.gz or gunzip scripts.tar.gz
to decompress tar file tar -xvf scripts.tar

to check if port is assigned or not 

$ cat /etc/services | grep 6001
#                                26001-26207            # Unassigned

Volume Group 

With LVM, "logical" partitions can span across physical hard drives and can be resized (unlike traditional ext3 "raw" partitions). A physical disk is divided into one or more physical volumes (Pvs), and logical volume groups (VGs) are created by combining PVs as shown in Figure





$ lsvg -o
datavg
rootvg
$ lsvg -l datavg
datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
logdatavg           jfs2log    1       2       2    open/syncd    N/A
webspherelv         jfs2       40      80      2    open/syncd    /usr/IBM/WebSphere
itmlv               jfs2       16      32      2    open/syncd    /IBM/itm
$ df -g /usr/IBM/WebSphere
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/webspherelv     10.00      8.10   20%    40540     3% /usr/IBM/WebSphere

refer to link for details https://www.redhat.com/magazine/009jul05/features/lvm2/






General WAS Issues


Please use the below command to synchronize if you are not able to access the deployment manager console to synchronize.

Command: syncNode.sh <Hostname of Dmgr> <SOAP Connector Port address>

to find the boot strap port goto dmgr profiles /config /cells /cellname and refer serverindex.xml

to get info on various ports used in WAS refer to below link
     http://www-01.ibm.com/support/knowledgecenter/SS7JFU_8.5.5/com.ibm.websphere.migration.express.iseries.doc/ae/rmig_portnumber.html

password decoder for was
http://www.poweredbywebsphere.com/decoder.html

to add a user to admin / was console goto System administration -> Console settings -> Console users -> Console groups

it gets saved at security.xml at

/opt/InfoSphere/WebSphere/AppServer/profiles/default/config/cells/cellname
/opt/was/AppServer/profiles/dmgrprofile/config/cells/cellname

search with serverId to check if user added after recycle or to check existing users




General Issue Resolutions


to find out a process used by a port 

# netstat -anp | grep 12345
# netstat -anp | grep 12345
tcp    0   0 127.0.0.1:12345   0.0.0.0:*    LISTEN   6629/ssh
tcp    0   0 ::1:12345              :::*    LISTEN   6629/ssh

netstat -aAn|grep 9043
f1000e0006e9a3b8 tcp4       0      0  *.9043                *.*                   LISTEN
$ rmsock f1000e0006e9a3b8 tcpcb




msinfo32 will give processor info in windows server



Thursday, November 12, 2015

General Terms / Definitions


Network Appliance
  a relatively low cost computer designed to provide Internet access and without the full capabilities of a standard computer. 
  





NIM Server 

NIM provides a central management point for installing and maintainingAIX* images for both LPARs and individual servers. It allows for the creation of a master image (also called a golden image), which is used to install cloned LPARs that have the same OS kernel and characteristics.

A logical partition (LPAR) is the division of a computer's processor s, memory , and storage into multiple sets of resources so that each set of resources can be operated independently with its own operating system instance and application s.

HMC - Hardware Management Console is a technology created by IBM to provide a standard interface for configuring and operating partitioned (also known as an LPAR or virtualized system) and SMP systems such as IBM System i, IBM System p, IBM System z, and IBM Power Systems.


Forward lookup zone we give the name it will pick up the ip address

Reverse lookup if we give the number it will give the name 

dhcp The Dynamic Host Configuration Protocol (DHCP) is a network protocol that is
 used to configure network devices so that they can communicate on an IP network

NAS - network attached storage. Network-attached storage (NAS) is a file-level computer data storage server connected to a computer network providing data access to a heterogeneous group of clients. NAS is specialized for serving files either by its hardware, software, or configuration.

SANstorage area network (SAN) is a network that provides access to consolidated, block level data storage. SANs are primarily used to enhance storage devices, such as disk arrays, tape libraries, and optical jukeboxes, accessible to servers so that the devices appear to the operating system as locally attached devices.

TSM - IBM Spectrum Protect (Tivoli Storage Manager) is a data protection platform that gives enterprises a single point of control and administration for backup and recovery. It is the flagship product in the IBM Spectrum Protect (Tivoli Storage Manager) family.







Thursday, July 30, 2015

setupCmdLine.sh

The WebSphere Application Server uses the setupCmdLine.sh file, which defines the required environment needed for WebSphere Application Server. The file is sourced in all the start, stop, and monitoring scripts used by the WebSphere Application Server agent.
bash-3.00# cat /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh
#!/bin/sh
binDir='dirname ${0}'
. ${binDir}/setupCmdLine.sh
${WAS_HOME}/bin/startServer.sh "$@"

By design, the WebSphere Application Server agent does not source the user's profile. If you need to export any additional environment variables, create an environment file with the required variables and source it in following scripts:
startManager.sh, startNode.sh, startServer.sh, stopManager.sh, stopNode.sh, stopServer.sh, serverStatus.sh
For example, append a line in startServer.sh in the following manner:
# Call User Environment here.
<Path to env file>/setUserEnv.sh


We run setupCmdLine.sh because this file contains the paths of all the commands that have to run. Running this command makes sure that the path and classpath is updated with the most recent path.

/opt/was/AppServer/profiles/<<profilename>>/bin/setupCmdLine.sh

             Once you run setupCmdLine.sh, Switch back to your login credentials and run startManager.sh to start the deployment manager or corresponding nodeagent/server.

In order to run setupCmdLine.sh, the user must be logged on as was. To do this, do a $su – was. Enter the password when prompted.
setupCmdLine.sh

sample setupCmdLine.sh file


#!/bin/sh
# @(#) 1.21 CFG/ws/code/profile.templates/src/bin/setupCmdLine.sh, WAS.config.base, WAS61.CFG, cf250912.19 5/8/06 13:29:35 [6/13/09 11:33:16]

WAS_USER_SCRIPT="/opt/was/AppServer/profiles/<<profilename>>/bin/setupCmdLine.sh"
export WAS_USER_SCRIPT
USER_INSTALL_ROOT="/opt/was/AppServer/profiles/<<profilename>>"
WAS_HOME="/opt/was/AppServer"
JAVA_HOME="/opt/was/AppServer/java"
WAS_CELL=<<cell name>>
WAS_NODE=<<node name>>

#ulimit -n 10000

OSGI_INSTALL="-Dosgi.install.area=$WAS_HOME"
OSGI_CFG="-Dosgi.configuration.area=$USER_INSTALL_ROOT/configuration"

ITP_LOC="$WAS_HOME"/deploytool/itp
CONFIG_ROOT="$USER_INSTALL_ROOT"/config

CLIENTSAS=-Dcom.ibm.CORBA.ConfigURL=file:"$USER_INSTALL_ROOT"/properties/sas.client.props
STDINCLIENTSAS=-Dcom.ibm.CORBA.ConfigURL=file:"$USER_INSTALL_ROOT"/properties/sas.stdinclient.props
SERVERSAS=-Dcom.ibm.CORBA.ConfigURL=file:"$USER_INSTALL_ROOT"/properties/sas.server.props
CLIENTSOAP=-Dcom.ibm.SOAP.ConfigURL=file:"$USER_INSTALL_ROOT"/properties/soap.client.props
JAASSOAP=-Djava.security.auth.login.config="$USER_INSTALL_ROOT"/properties/wsjaas_client.conf
CLIENT_CONNECTOR_INSTALL_ROOT="$USER_INSTALL_ROOT"/installedConnectors
CLIENTSSL=-Dcom.ibm.SSL.ConfigURL=file:"$USER_INSTALL_ROOT"/properties/ssl.client.props
WAS_LOGGING="-Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager -Djava.util.logging.configureByServer=true"

QUALIFYNAMES=-qualifyHomeName
PATH="$JAVA_HOME"/ibm_bin:"$JAVA_HOME"/bin/:"$JAVA_HOME"/jre/bin:$PATH
WAS_EXT_DIRS="$JAVA_HOME"/lib:"$WAS_HOME"/classes:"$WAS_HOME"/lib:"$WAS_HOME"/installedChannels:"$WAS_HOME"/lib/ext:"$WAS_HOME"/web/help:"$ITP_LOC"/plugins/com.ibm.etoo
ls.ejbdeploy/runtime
WAS_CLASSPATH="$WAS_HOME"/properties:"$WAS_HOME"/lib/startup.jar:"$WAS_HOME"/lib/bootstrap.jar:"$WAS_HOME"/lib/j2ee.jar:"$WAS_HOME"/lib/lmproxy.jar:"$WAS_HOME"/lib/urlp
rotocols.jar:"$JAVA_HOME"/lib/tools.jar

PLATFORM=`/bin/uname`
case $PLATFORM in

  AIX)

    WAS_LIBPATH="$WAS_HOME"/bin
    NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/en_US/%N:${NLSPATH:=}
#    WAS_BOOTCLASSPATH=
    ;;

  Linux)

    WAS_LIBPATH="$WAS_HOME"/bin
    NLSPATH=/usr/lib/locale/%L/LC_MESSAGES/%N:${NLSPATH:=}
    JAVA_HIGH_ZIPFDS=200
#    WAS_BOOTCLASSPATH=
    ;;

  SunOS)

    if [ "$LANG" = "" ]
    then
       LANG=C
       export LANG
    fi
    WAS_LIBPATH="$WAS_HOME"/bin
    NLSPATH=/usr/lib/locale/%L/LC_MESSAGES/%N:${NLSPATH:=}
#    WAS_BOOTCLASSPATH=
    ;;

  HP-UX)

    WAS_LIBPATH="$WAS_HOME"/bin
    NLSPATH=/usr/lib/nls/msg/%L/%N:${NLSPATH:=}
#    WAS_BOOTCLASSPATH=
    ;;

  *)

    WAS_LIBPATH="$WAS_HOME"/bin
    NLSPATH=/usr/lib/locale/%L/LC_MESSAGES/%N:${NLSPATH:=}
#    WAS_BOOTCLASSPATH=
    ;;

esac

export PATH WAS_HOME WAS_CELL WAS_NODE JAVA_HOME ITP_LOC CLIENTSAS CLIENTSSL STDINCLIENTSAS SERVERSAS CLIENTSOAP CLIENT_CONNECTOR_INSTALL_ROOT WAS_LOGGING QUALIFYNAMES
WAS_EXT_DIRS WAS_CLASSPATH CONFIG_ROOT NLSPATH JAVA_HIGH_ZIPFDS WAS_LIBPATH OSGI_INSTALL OSGI_CFG



Sources:

https://sort.symantec.com/public/documents/sfha/6.1/linux/productguides/html/applicationha_webas_agent_61_kvm_lin/ch03s03.htm

Wednesday, July 29, 2015

close wait Issue

Close Wait problem


CLOSE_WAITS occur when the connection is open at one end and closed at one end.

CLOSE_WAITS occur due to a lot of reasons and the actual reason has to be figured out.

Login to the Webserver that shows the CLOSE_WAIT problem and run the below 

netstat -an | egrep 'CLOSE_WAIT' | awk '{print $5}'| sort | uniq -c | sort -nr

or place it as a shell script in /usr/local/adm/bin/count_closewait and run count_closewait going forth

//content of count_closewait.sh script is stated below
**begin
clear
echo "Here is the current Snapshot of CLOSE_WAIT ... "
echo
echo "Count Applicaiton (IP+Port) "
echo "===== ===================== "
netstat -an | egrep 'CLOSE_WAIT' | awk '{print $5}'| sort | uniq -c | sort -nr
echo
**end

below is a snapshot of the output 

Count Applicaiton (IP+Port)
===== =====================
  120 <<ipaddress1>>.9081
  110 <<ipaddress1>>.9087
   90 <<ipaddress1>>.9086
   85 <<ipaddress1>>.9088
   83 <<ipaddress1>>.9083
   88 <<ipaddress2>>.9082
   73 <<ipaddress2>>.9087
   71 <<ipaddress2>>.9084
   60 <<ipaddress2>>.9083

From the above output we infer the count of closewaits to a particular Server on a particular port. This displays the IP+Port with the maximum closewaits, at top.

  1. Out of all the outgoing connections from that server, check the IP and the corresponding port no. with the most number of CLOSE_WAIT’s associated with it.
  1. After identifying the ip and port no, do an nslookup to find the name of that server.
    nslookup <ipaddress>

Now login to the appropriate server as found from the above step.

  1. Now find the process id of the process running on that port number of the server on which the CLOSE_WAIT was detected. This can be done by using the lsof command
  lsof  | grep  <port no>

The corresponding Java/JVM instance will be process ID will be listed 

java    38863002  was  .....                0t0    TCP *:9083 (LISTEN)
ps -ef |grep <<pid>> in the above case 

ps -ef |grep 38863002 and the JVM instance will be found.

NOTE : Alternately you can also check the webserver plugin-cfg.xml for the port number above which will give you the application server instance being referred by it.

Now check the systemout logs of that JVM for the reason of CLOSE_WAIT.

  1. Some times the CLOSE_WAIT’s may be a result of network connectivity issues. Contact the Networks team to resolve the issue.
  1. If there is no problem in network connectivity, check the applications that are running on that JVM. This can be found by using the info_app command
      info_app | egrep ‘<JVM>|Server’

  1. If any application has a problem, then the CLOSE_WAIT’s may be due to the non responsiveness of that application. Contact the application support team for that and meanwhile perform the recycle of the web server to prevent any other applications having problems.
          If all the applications are running fine, then go ahead and recycle the Web Server.

      Notes

§  At any point of time, if you feel that the number of CLOSE_WAITS has gone too high, you’d better recycle the Web server. That should clear the issue
§  Usually, after performing the recycle of the web server on one side, the number of CLOSE_WAIT sockets on the other side also increases due to the increased load on the other server. Hence it is advised to recycle the other web server after the first one.