Oracle OS Watcher使用说明


OSW是Oracle提供的一个用于操作系统监控的工具包,这个工具包可以从Metalink下载。Metalink Note:301137.1
 
OSW支持的平台
OSW is certified to run on the following platforms:
AIX
Tru64
Solaris
HP-UX
Linux[@more@]

OSW的安装
从metalink上下载后(并ftp 到unix server上),直接tar开就可以使用了。如果是compress格式的,先解压缩,比如:
uncompress osw.tar.Z
tar xvf osw.tar
 
[cs1] /oracle> tar xvf osw.tar
x .
x ./osw
x ./osw/Exampleprivate.net, 1731 bytes, 4 media blocks.
x ./osw/OSWatcher.sh, 11784 bytes, 24 media blocks.
x ./osw/OSWatcherFM.sh, 4451 bytes, 9 media blocks.
x ./osw/OSWg.jar, 722088 bytes, 1411 media blocks.
x ./osw/oswnet.sh, 334 bytes, 1 media blocks.
x ./osw/oswsub.sh, 401 bytes, 1 media blocks.
x ./osw/startOSW.sh, 1101 bytes, 3 media blocks.
x ./osw/stopOSW.sh, 560 bytes, 2 media blocks.
x ./osw/tarupfiles.sh, 127 bytes, 1 media blocks.
x ./osw/topaix.sh, 409 bytes, 1 media blocks.
x ./osw/README, 4997 bytes, 10 media blocks.
x ./osw/OSWgREADME, 3426 bytes, 7 media blocks.
OSW的卸载
 
如果想卸载OSW,直接将osw的工作目录删除即可。
rm -fr ./osw
 
OSW的设置
 
当OSW安装完毕后,OSW的解压缩脚本里就提供了管理osw的启动和停止的scripts。当第一次运行OSW的时候,系统会自动在osw的目录下创建一个子目录archive,并在archive目录下再创建7个子目录。
[cs1] /oracle/osw> cd archive
[cs1] /oracle/osw/archive> ls -ltr
total 0
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswprvtnet
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswvmstat
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswtop
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswps
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswnetstat
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswmpstat
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswiostat
[cs1] /oracle/osw/archive>
 
如 果要收集private networks 信息,必须要手工创建一个可执行文件在osw目录下,并且命名为private.net。这个文件的设置可以参考osw目录下提供的 Exampleprivate.net.这个文件中包含了用来检查RAC private networks 运行traceroute的命令.
比如:
traceroute -r -F node1
traceroute -r -F node2
OSW的启动
 
启动OSW非常简单。只要运行startOSW.sh就可以了。该shell 需要2个参数,第一个参数指定采样时间间隔,第二个指定存储数据的时间。缺省情况下(如果不输入参数),OSW采样以30秒为间隔,存储24小时的数据.
 
对于超过保留期限的数据,File Manager 会自动清理(File Manager 每隔一个小时调度一次)
 
下面是我在cs1上运行的启动过程:
[cs1] /oracle/osw> startOSW.sh 60 1
Testing for discovery of OS Utilities...VMSTAT found on your system.IOSTAT found on your system.MPSTAT found on your system.NETSTAT found on your system.

Discovery completed.

Starting OSWatcher V2.0.2 on Fri Jul 13 10:24:43 BEIST 2007
With SnapshotInterval = 60
With ArchiveInterval = 1OSWatcher - Written by Carl Davis, Center of Expertise, Oracle Corporation

Starting Data Collection...osw heartbeat:Fri Jul 13 10:24:43 BEIST 2007

[cs1] /oracle/osw>
 
OSW的停止
 
停止OSW 服务,通过stopOSW.sh来完成
 
./stopOSW.sh
OSW的诊断输出
 
运行osw后,收集的信息被放在archive下的对应的7个子目录下,以ascii格式存放。文件命名格式如下:
__MM.DD.YY.HH24.dat
 
比如我测试收集到的文件如下:
[cs1] /oracle/osw/archive> ls -ltrR
total 0
drwxr-xr-x 2 oracle dba 256 Jul 13 10:24 oswprvtnet
drwxr-xr-x 2 oracle dba 256 Jul 13 11:00 oswvmstat
drwxr-xr-x 2 oracle dba 256 Jul 13 11:00 oswtop
drwxr-xr-x 2 oracle dba 256 Jul 13 11:00 oswps
drwxr-xr-x 2 oracle dba 256 Jul 13 11:00 oswnetstat
drwxr-xr-x 2 oracle dba 256 Jul 13 11:00 oswmpstat
drwxr-xr-x 2 oracle dba 256 Jul 13 11:00 oswiostat
./oswprvtnet:
total 0

./oswvmstat:
total 48
-rw-r--r-- 1 oracle dba 18199 Jul 13 10:59 cs1_vmstat_07.13.07.1000.dat
-rw-r--r-- 1 oracle dba 3024 Jul 13 11:05 cs1_vmstat_07.13.07.1100.dat

./oswtop:total 1704
-rw-r--r-- 1 oracle dba 741040 Jul 13 10:59 cs1_top_07.13.07.1000.dat
-rw-r--r-- 1 oracle dba 122988 Jul 13 11:05 cs1_top_07.13.07.1100.dat

./oswps:
total 1696
-rw-r--r-- 1 oracle dba 739085 Jul 13 10:59 cs1_ps_07.13.07.1000.dat
-rw-r--r-- 1 oracle dba 121733 Jul 13 11:05 cs1_ps_07.13.07.1100.dat

./oswnetstat:
total 696
-rw-r--r-- 1 oracle dba 297692 Jul 13 10:59 cs1_netstat_07.13.07.1000.dat
-rw-r--r-- 1 oracle dba 49644 Jul 13 11:05 cs1_netstat_07.13.07.1100.dat

./oswmpstat:
total 208
-rw-r--r-- 1 oracle dba 82064 Jul 13 10:59 cs1_mpstat_07.13.07.1000.dat
-rw-r--r-- 1 oracle dba 13714 Jul 13 11:05 cs1_mpstat_07.13.07.1100.dat

./oswiostat:
total 920
-rw-r--r-- 1 oracle dba 393502 Jul 13 10:59 cs1_iostat_07.13.07.1000.dat
-rw-r--r-- 1 oracle dba 65568 Jul 13 11:05 cs1_iostat_07.13.07.1100.dat
[cs1] /oracle/osw/archive>
OSW的诊断信息字段含义说明
 
 
字段
描述
oswiostat

tin
Shows the total number of characters read by the system for all ttys
tout
Shows the total number of characters written by the system to all ttys.
kps
indicates the amount of data transferred (read or written) to the drive in KB per second
tps
Indicates the number of transfers per second that were issued to the physical disk. A transfer is an I/O request to the physical disk. Multiple logical requests can be combined into a single I/O request to the disk.
serv
average response time of transactions, in milliseconds
us
Percentage of CPU cycles spent on user processes
sy
Percentage of CPU cycles spent on system processes wt
wt
Shows the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request
id
 
Percentage of unused CPU cycles or idle time when the CPU is basically doing nothing .
oswmpstat

cpu
Processor ID
minf
Minor faults
mif
Major Faults
xcal
Processor cross-calls (when one CPU wakes up another by interrupting it).
intr
Interrupts
ithr
 
Interrupts as threads (except clock)
csw
Context switches
icsw
Involuntary context switches
migr
Thread migrations to another processor
smtx
Number of times a CPU failed to obtain a mutex
srw
Number of times a CPU failed to obtain a read/write lock on the first try
syscl
Number of system calls
usr
Percentage of CPU cycles spent on user processes
sys
Percentage of CPU cycles spent on system processes
wt
Percentage of CPU cycles spent waiting on event
idl
Percentage of unused CPU cycles or idle time when the CPU is basically doing nothing
oswnetstat

name
Device name of interface
Mtu
Maximum transmission unit
Net
Network Segment Address
address
Network address of the device
ipkts
Input packets
Ierrs
Input errors
opkts
Output Packets
Oerrs
Output errors
collis
Collisions
queue
Number in the Queue
oswps

f
Flags s State of the process
uid
The effective user ID number of the process
pid
The process ID of the process
ppid
The process ID of the parent process.
d
Processor utilization for scheduling (obsolete).
pri
The priority of the process.
ni
Nice value, used in priority computation.
addr
The memory address of the process.
sz
The total size of the process in virtual memory, including all mapped files and devices, in pages.
wchan
The address of an event for which the process is sleeping (if blank, the process is running).
stime
The starting time of the process, given in hours, minutes, and seconds.
tty
The controlling terminal for the process (the message ?, is printed when there is no controlling terminal).
time
The cumulative execution time for the process.
cmd
The command name process is executing.
oswtop

PID
Process ID of process
USERNAME
Username of process
THR
Process thread PRI Priority of process
NICE
Nice value of process
SIZE
Total size of a process, including code and data, plus the stack space in kilobytes
RES
Amount of physical memory used by the process
STATE
Current CPU state of process. The states can be S for sleeping, D for uninterrupted, R for running, T for stopped/traced, and Z for zombied
TIME
The CPU time that a process has used since it started
%CPU
The CPU time that a process has used since the last update
COMMAND
The task's command name
oswvmstat

PROCS

r
Number of processes that are in a wait state and basically not doing anything but waiting to run
b
Number of processes that were in sleep mode and were interrupted since the last update
w
Number of processes that have been swapped out by mm and vm subsystems and have yet to run
MEMORY

swap
The amount of swap space currently available free The size of the free list
PAGE

re
page reclaims
mf
minor faults
pi
kilobytes paged in
po
kilobytes paged out
fr
kilobytes freed
de
anticipated short-term memory shortfall (Kbytes)
sr
pages scanned by clock algorithm
DISK

Bi
Disk blocks sent to disk devices in blocks per second
FAULTS

In
Interrupts per second, including the CPU clocks
Sy
System calls
Cs
Context switches per second within the kernel
CPU

Us
Percentage of CPU cycles spent on user processes
Sy
Percentage of CPU cycles spent on system processes
Id
Percentage of unused CPU cycles or idle time when the CPU is basically doing nothing


[cs1] /oracle/osw> java -jar OSWg.jar -i /oracle/osw/archive

Starting OSWg V2.0.4
OSWatcher Graph Written by Oracle Center of Expertise
Copyright (c) 2007 by Oracle Corporation

Parsing Data. Please Wait...

Parsing file cs1_vmstat_07.13.07.1000.dat ...
Parsing file cs1_vmstat_07.13.07.1100.dat ...

Parsing Completed.


Enter 1 to Display CPU Process Queue Graphs
Enter 2 to Display CPU Utilization Graphs
Enter 3 to Display CPU Other Graphs
Enter 4 to Display Memory Graphs

Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files

Enter L to Specify Alternate Location of Gif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently Displayed Graphs
Enter Q to Quit Program

Please Select an Option:6
OSWG_RunQueue.gif
OSWG_BlockQueue.gif
OSWG_CpuIdle.gif
OSWG_CpuSystem.gif
OSWG_CpuUser.gif
OSWG_Interrupts.gif
OSWG_CS.gif


Enter 1 to Display CPU Process Queue Graphs
Enter 2 to Display CPU Utilization Graphs
Enter 3 to Display CPU Other Graphs
Enter 4 to Display Memory Graphs

Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files

Enter L to Specify Alternate Location of Gif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently Displayed Graphs
Enter Q to Quit Program

Please Select an Option:q
[cs1] /oracle/osw>

如果要查看输出结果,可以直接在上面的菜单中选择你要查看的信息。

使用OSWg的注意事项
 
如果我们需要分析的文件很多,那么java需要更多memory,否则可能会遇到类似如下的错误:
java.lang.OutOfMemoryError
 
这个时候,我们就不得不增加java heap的大小。如果要增加java heap的大小,可以通过使用-Xmx 参数来设置,比如:
java -jar -Xmx10M OSWg.jar -i /oracle/osw/archive
 
[cs1] /oracle/osw> java -jar -Xmx10M OSWg.jar -i /oracle/osw/archive

Starting OSWg V2.0.4
OSWatcher Graph Written by Oracle Center of Expertise
Copyright (c) 2007 by Oracle Corporation

Parsing Data. Please Wait...

Parsing file cs1_vmstat_07.13.07.1000.dat ...
Parsing file cs1_vmstat_07.13.07.1100.dat ...

Parsing Completed.


Enter 1 to Display CPU Process Queue Graphs
Enter 2 to Display CPU Utilization Graphs
Enter 3 to Display CPU Other Graphs
Enter 4 to Display Memory Graphs

Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files

Enter L to Specify Alternate Location of Gif Directory
Enter T to Specify Different Time Scale
Enter D to Return to Default Time Scale
Enter R to Remove Currently Displayed Graphs
Enter Q to Quit Program

Please Select an Option:


ools:OSW工具-Oracle的OS watcher
作者:eygle |English Version

OSW是Oracle提供的一个用于操作系统监控的工具包,这个工具包可以从Metalink下载。Metalink Note:301137.1
下载解包以后即可使用:

$ tar -xvf osw.tar
x ., 0 bytes, 0 tape blocks
x ./osw, 0 bytes, 0 tape blocks
x ./osw/Exampleprivate.net, 1731 bytes, 4 tape blocks
x ./osw/OSWatcher.sh, 11784 bytes, 24 tape blocks
x ./osw/OSWatcherFM.sh, 4451 bytes, 9 tape blocks
x ./osw/OSWg.jar, 722088 bytes, 1411 tape blocks
x ./osw/oswnet.sh, 334 bytes, 1 tape blocks
x ./osw/oswsub.sh, 401 bytes, 1 tape blocks
x ./osw/startOSW.sh, 1101 bytes, 3 tape blocks
x ./osw/stopOSW.sh, 560 bytes, 2 tape blocks
x ./osw/tarupfiles.sh, 127 bytes, 1 tape blocks
x ./osw/topaix.sh, 409 bytes, 1 tape blocks
x ./osw/README, 4997 bytes, 10 tape blocks
x ./osw/OSWgREADME, 3426 bytes, 7 tape blocks

调用执行从startOSW.sh文件开始,该文件需要两个参数,第一个参数指定采样时间间隔,第二个指定存储数据的时间。缺省的,如果不输入参数,OSW采样以30秒为间隔,存储2448小时的数据。

以下是自定义参数的执行过程:

bash-2.03$ ./startOSW.sh 30 240
bash-2.03$
Testing for discovery of OS Utilities...

VMSTAT found on your system.
IOSTAT found on your system.
MPSTAT found on your system.
NETSTAT found on your system.
TOP found on your system.

Discovery completed.

Starting OSWatcher V2.0.2 on Tue Jul 3 14:40:21 CST 2007
With SnapshotInterval = 30
With ArchiveInterval = 240

OSWatcher - Written by Carl Davis, Center of Expertise, Oracle Corporation

Starting Data Collection...

osw heartbeat:Tue Jul 3 14:40:21 CST 2007
osw heartbeat:Tue Jul 3 14:40:51 CST 2007
osw heartbeat:Tue Jul 3 14:41:21 CST 2007

分析监控得到的数据,可以得到图表输出
具体设置可以参考OSWgREADME文件中的说明。

OSW生成的图表非常直观,可以用来对服务器的运行状况进行监控和报告:

-The End-
-----

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/670493/viewspace-1025013/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/670493/viewspace-1025013/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值