Useful UNIX Commands For WebSphere
Useful UNIX Commands For WebSphere
Administrator
These are some useful commands that i came across when administrating WebSphere
Application Server or WebSphere Portal Server. Note these commands are specifically written
for LINUX but most of them would for other UNIX platforms like Solaris, AIX and other flavours
of LINUX like SUSE or REDHAT.
/AppServer/java/jre/lib/ext/ibmext.jar
-Dwas.status.socket=54859 -classpath
/cust/IBM/WebSphere/AppServer/profiles/AppSrv02/properties:/cust/IBM/WebSphere/AppSer
4)Find CPU usage with the process listing in runtime and much more statistics in terms of
memory, virtual memory, etc.
top
12:00:20 up 118 days, 15:16, 2 users, load average: 0.07, 0.02, 0.00
572 processes: 570 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: cpu user nice system irq softirq iowait idle
total 2.7% 0.0% 1.1% 0.0% 0.0% 0.0% 95.9%
cpu00 1.9% 0.0% 0.3% 0.0% 0.0% 0.0% 97.6%
cpu01 3.5% 0.0% 1.9% 0.1% 0.0% 0.0% 94.2%
Mem: 11819592k av, 5088092k used, 6731500k free, 0k shrd,
295304k buff
3998132k active, 682312k inactive
Swap: 2048276k av, 0k used, 2048276k free 1258592k
cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU
COMMAND
17719 root 16 0 306M 306M 3992 S 0.7 2.6 22:14 1 java
19358 root 16 0 2532 2532 896 R 0.5 0.0 0:00 1 top
17771 root 15 0 306M 306M 3992 S 0.4 2.6 3:48 0 java
18058 root 16 0 458M 458M 4032 S 0.1 3.9 12:55 0 java
1 root 15 0 512 512 452 S 0.0 0.0 1:19 0 init
2 root RT 0 0 0 0 SW 0.0 0.0 0:00 0
migration/0
5)Continuous CPU usage monitoring and find the average CPU used.
a) sar -u 2 5
b) sar -o output.file 12 8 >/dev/null 2>&1 &
c) nohup sar -o output.file 12 8 >/dev/null 2>&1 &
2)prints just one line with the total size of the directory, the below example show the size of
the /usr/IBM/Websphere WebSphere Portal Server directory.
du -ch | grep total
bash-2.05b# du -ch | grep total
6.3G total
The below example shows the information like CNAME , Aliases, ipaddres , etc about
www.google.com
;; QUESTION SECTION:
;www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 585119 IN CNAME www.l.google.com.
www.l.google.com. 69 IN A 216.239.51.99
www.l.google.com. 69 IN A 216.239.51.104
;; AUTHORITY SECTION:
l.google.com. 60734 IN NS g.l.google.com.
l.google.com. 60734 IN NS b.l.google.com.
l.google.com. 60734 IN NS f.l.google.com.
l.google.com. 60734 IN NS c.l.google.com.
l.google.com. 60734 IN NS a.l.google.com.
l.google.com. 60734 IN NS e.l.google.com.
l.google.com. 60734 IN NS d.l.google.com.
Non-authoritative answer:
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 216.239.51.99
Name: www.l.google.com
Address: 216.239.51.104
2) List all network interfaces, the below example list two interfaces eth0 and eth1 and a
loopback.
infconfig -a
bash-2.05b# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:11:43:32:49:99
inet addr:10.2.150.74 Bcast:10.5.50.127 Mask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:357854361 errors:0 dropped:0 overruns:0 frame:0
TX packets:383621806 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3168219417 (3021.4 Mb) TX bytes:3724305382 (3551.7
Mb)
Interrupt:17
3) To find more information about a network interface, the below example shows detail
information about interface eth0.
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: d
Wake-on: d
Link detected: yes
File related commands
----------------------
1) find text in the matching files and show the filename with the pattern. The below example
shows the list of filenames and the location of the hostname in those files, which will be
helpful when changing hostnames for your websphere installation.
2) Soemtimes you might run out of diskspace and want to clean up some files, so this command
will help you find all large files. In this example it will list all the files greater than 10 mb in
size.
4) Sometimes you might encounter a situation for example when running xmlaccess or wsadmin
where you might want to write stdout to the file as well as to the console so that you have a
copy even when the standard output disappears because of the screen buffer size.
5) find files that is recently updated which might be useful to see what changes are made to
the system recently (e.g) below command shows the files that are modified within the last 20
minutes(-mmin) and 20 days (-mtime)
free
cat /proc/meminfo
bash-2.05b# free
total used free shared buffers
cached
Mem: 11819592 4938416 6881176 0 298148
1440200
-/+ buffers/cache: 3200068 8619524
Swap: 2048276 0 2048276