OSW工具-Oracle的OS watcher

OSW简介
 
OSW是Oracle提供的一个监控操作系统的工具包,主要用于监视系统的状态,包括cpu,内存,io,网络等,可以运行于linux和windows,这个工具包可以从Metalink下载。

Metalink Note:301137.1

 

在OSW 4.0 之前是:OSWatcher 和 OSWg的关系。

OSW 4.0 后变成了: OSWbb 与 OSWbba 的关系。

 

安装及启动


下载解包以后即可使用:

下面用osw4.0做为例子,4.0以前的版本是一样的

下载好之后,可以 直接解压使用
[oracle@test10 osw]$ tar -xvf oswbb4.0.tar 
oswbb/
oswbb/htop.sh
oswbb/docs/
oswbb/docs/OSWbba_README.txt
oswbb/docs/OSW_bb_README.txt
oswbb/docs/OSW_Black_Box_Analyzer_Overview.pdf
oswbb/docs/OSWatcher_Black_Box_UG.pdf
oswbb/docs/OSWatcher_Black_Box_Analyzer_UG.pdf
oswbb/Exampleprivate.net
oswbb/stopOSWbb.sh     --关闭osw
oswbb/iosub.sh
oswbb/profile/
oswbb/OSWatcherFM.sh
oswbb/mpsub.sh
oswbb/gif/             --生成的图片放在这里
oswbb/pssub.sh
oswbb/oswnet.sh
oswbb/vmsub.sh
oswbb/oswlnxio.sh
oswbb/oswib.sh
oswbb/startOSWbb.sh     --开始osw 后面有两个参加,第一个是间隔时间(S),第二个是保存时间(HH),不带参数为每30秒采样一样,保存48小时
oswbb/oswsub.sh
oswbb/analysis/
oswbb/oswbba.jar       --生成图片时运行这个jar包
oswbb/locks/
oswbb/tmp/
oswbb/OSWatcher.sh
oswbb/topaix.sh
oswbb/tarupfiles.sh
oswbb/xtop.sh
oswbb/src/
oswbb/src/Thumbs.db
oswbb/src/OSW_profile.htm
oswbb/src/tombody.gif
oswbb/src/missing_graphic.gif
oswbb/src/coe_logo.gif
oswbb/src/watch.gif
oswbb/src/oswbba_input.txt
oswbb/oswrds.sh

开始osw:
[oracle@test10 oswbb]$ ./startOSWbb.sh 
[oracle@test10 oswbb]$ 
Info...You did not enter a value for snapshotInterval.
Info...Using default value = 30
Info...You did not enter a value for archiveInterval.
Info...Using default value = 48

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.

Testing for discovery of OS CPU COUNT
OSWbb is looking for the CPU COUNT on your system
CPU COUNT will be used by oswbba to automatically look for cpu problems

CPU COUNT found on your system.
CPU COUNT = 1

Discovery completed.

Starting OSWatcher Black Box v4.0   on Wed Oct 10 12:19:25 EDT 2012
With SnapshotInterval = 30
With ArchiveInterval = 48

OSWatcher Black Box - Written by Carl Davis, Center of Expertise, Oracle Corporation
For questions on install/usage please go to MOS (Note:301137.1)
If you need further assistance or have comments or enhancement
requests you can email me Carl.Davis@Oracle.com

Starting Data Collection...

oswbb heartbeat:Wed Oct 10 12:19:30 EDT 2012
 
产生的数据保存在archive里。
但这里的数据是.dat的文件,不易看,可以使用OSWbba 生成图像。
 
使用OSWbba前先设置jdk,安装 oracle时会默认安装jdk 
PATH=$ORACLE_HOME/jdk/bin:$PATH        --设置jdk

java -jar oswbba.jar -i /oracle/osw/osw/osw/oswbb4.0/oswbb/archive      --生成图片,后面的路径为osw收集的数据保存的路径


[oracle@test10 oswbb]$ java -jar oswbba.jar -i /oracle/osw/osw/osw/oswbb4.0/oswbb/archive

Starting OSW Black Box Analyzer V4.0
OSWatcher Black Box Analyzer Written by Oracle Center of Expertise
Copyright (c)   2012 by Oracle Corporation

Parsing Data. Please Wait...

Parsing file test10.com.cn_iostat_12.10.10.1200.dat ...

Parsing file test10.com.cn_vmstat_12.10.10.1200.dat ...

Parsing file test10.com.cn_top_12.10.10.1200.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 5 to Display Disk IO Graphs

Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter 8 to Generate All Disk 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 P to Generate A Profile
Enter A to Analyze Data
Enter Q to Quit Program

Please Select an Option:8
device=dm-0
Generating file gif/Oct10120543_1349886246/OSWg_dm-0_OS_IO_RPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_dm-0_OS_IO_WPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_dm-0_OS_IO_ST.gif
Generating file gif/Oct10120543_1349886246/OSWg_dm-0_OS_IO_PB.gif
device=sda
Generating file gif/Oct10120543_1349886246/OSWg_sda_OS_IO_RPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda_OS_IO_WPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda_OS_IO_ST.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda_OS_IO_PB.gif
device=sda1
Generating file gif/Oct10120543_1349886246/OSWg_sda1_OS_IO_RPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda1_OS_IO_WPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda1_OS_IO_ST.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda1_OS_IO_PB.gif
device=dm-1
Generating file gif/Oct10120543_1349886246/OSWg_dm-1_OS_IO_RPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_dm-1_OS_IO_WPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_dm-1_OS_IO_ST.gif
Generating file gif/Oct10120543_1349886246/OSWg_dm-1_OS_IO_PB.gif
device=sda2
Generating file gif/Oct10120543_1349886246/OSWg_sda2_OS_IO_RPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda2_OS_IO_WPS.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda2_OS_IO_ST.gif
Generating file gif/Oct10120543_1349886246/OSWg_sda2_OS_IO_PB.gif

根据需要生成图片,图片保存在gif文件夹下。

[oracle@test10 oswbb]$ ./stopOSWbb.sh   --停止osw


osw4.0前的版本是一样的,
生成图片时用的是 oswg.jar 这个jar包
java -jar oswg.jar -i /oracle/osw/osw/osw/oswbb4.0/oswbb/archive

 

OSW的诊断信息字段含义说明

 

 

 

字段

描述
oswiostat
tinShows the total number of characters read by the system for all ttys
toutShows the total number of characters written by the system to all ttys.
kpsindicates the amount of data transferred (read or written) to the drive in KB per second
tpsIndicates 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.
servaverage response time of transactions, in milliseconds
usPercentage of CPU cycles spent on user processes
syPercentage of CPU cycles spent on system processes wt
wtShows 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
cpuProcessor ID
minfMinor faults
mifMajor Faults
xcalProcessor cross-calls (when one CPU wakes up another by interrupting it).
intrInterrupts
ithr
 
Interrupts as threads (except clock)
cswContext switches
icswInvoluntary context switches
migrThread migrations to another processor
smtxNumber of times a CPU failed to obtain a mutex
srwNumber of times a CPU failed to obtain a read/write lock on the first try
sysclNumber of system calls
usrPercentage of CPU cycles spent on user processes
sysPercentage of CPU cycles spent on system processes
wtPercentage of CPU cycles spent waiting on event
idlPercentage of unused CPU cycles or idle time when the CPU is basically doing nothing
oswnetstat
nameDevice name of interface
MtuMaximum transmission unit
NetNetwork Segment Address
addressNetwork address of the device
ipktsInput packets
IerrsInput errors
opktsOutput Packets
OerrsOutput errors
collisCollisions
queueNumber in the Queue
oswps
fFlags s State of the process
uidThe effective user ID number of the process
pidThe process ID of the process
ppidThe process ID of the parent process.
dProcessor utilization for scheduling (obsolete).
priThe priority of the process.
niNice value, used in priority computation.
addrThe memory address of the process.
szThe total size of the process in virtual memory, including all mapped files and devices, in pages.
wchanThe address of an event for which the process is sleeping (if blank, the process is running).
stimeThe starting time of the process, given in hours, minutes, and seconds.
ttyThe controlling terminal for the process (the message ?, is printed when there is no controlling terminal).
timeThe cumulative execution time for the process.
cmdThe command name process is executing.
oswtop
PID Process ID of process
USERNAMEUsername of process
THRProcess thread PRI Priority of process
NICENice value of process
SIZETotal size of a process, including code and data, plus the stack space in kilobytes
RESAmount of physical memory used by the process
STATECurrent 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
TIMEThe CPU time that a process has used since it started
%CPUThe CPU time that a process has used since the last update
COMMANDThe task's command name
oswvmstat
PROCS
rNumber of processes that are in a wait state and basically not doing anything but waiting to run
bNumber of processes that were in sleep mode and were interrupted since the last update
wNumber of processes that have been swapped out by mm and vm subsystems and have yet to run
MEMORY
swapThe amount of swap space currently available free The size of the free list
PAGE
repage reclaims
mfminor faults
pikilobytes paged in
pokilobytes paged out
frkilobytes freed
deanticipated short-term memory shortfall (Kbytes)
srpages scanned by clock algorithm
DISK
BiDisk blocks sent to disk devices in blocks per second
FAULTS
InInterrupts per second, including the CPU clocks
SySystem calls
CsContext switches per second within the kernel
CPU
UsPercentage of CPU cycles spent on user processes
SyPercentage of CPU cycles spent on system processes
IdPercentage of unused CPU cycles or idle time when the CPU is basically doing nothing

 

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

 

报错及处理:

报错一:

[oracle@test oswbb]$ java -jar oswbba.jar -i archive

Starting OSW Black Box Analyzer V4.0.1
OSWatcher Black Box Analyzer Written by Oracle Center of Expertise
Copyright (c)  2012 by Oracle Corporation

Parsing Data. Please Wait...

Parsing file TEST_iostat_13.10.19.1700.dat ...
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:10:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:11:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:12:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:13:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:14:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:15:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:16:49 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:25:59 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:26:29 2012
Timestamp Error. Expected format: May 3 16:11:12 2006.
Timestamp Error. Found format: May 16 17:26:59 2012

Parsing file TEST_vmstat_13.10.19.1700.dat ...
An exception occured in insertVmstatLists on line 8
An exception occured in insertVmstatLists on line 14
An exception occured in insertVmstatLists on line 20
An exception occured in insertVmstatLists on line 26
An exception occured in insertVmstatLists on line 32
An exception occured in insertVmstatLists on line 38
An exception occured in insertVmstatLists on line 44
An exception occured in insertVmstatLists on line 53
An exception occured in insertVmstatLists on line 59
An exception occured in insertVmstatLists on line 65

Parsing file TEST_top_13.10.19.1700.dat ...


No data found in input archive directory archive
Please rerun OSWbba with proper input directory containing OSW archive data.
Program aborting...

 

在生成图形界面的时候报错,注意Timestamp Error报错信息, 产生这个错误的原因就是我的操作系统是中文环境,osw要英文日期格式才可以。

 

解决办法:

[oracle@TEST archive]$ echo $LANG 
zh_CN.UTF-8

[oracle@TEST ~]$ LANG=en
[oracle@TEST ~]$ echo $LANG
en

 

报错二:

 

[oracle@TEST oswbb]$ java -jar oswbba.jar -i archive

Starting OSW Black Box Analyzer V4.0.1
OSWatcher Black Box Analyzer Written by Oracle Center of Expertise
Copyright (c)  2012 by Oracle Corporation

Parsing Data. Please Wait...

Parsing file TEST_iostat_13.10.19.1700.dat ...
Parsing file TEST_iostat_13.10.19.1800.dat ...

Parsing file TEST_vmstat_13.10.19.1700.dat ...
Parsing file TEST_vmstat_13.10.19.1800.dat ...

Parsing file TEST_top_13.10.19.1700.dat ...
Parsing file TEST_top_13.10.19.1800.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 5 to Display Disk IO Graphs

Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter 8 to Generate All Disk 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 P to Generate A Profile
Enter A to Analyze Data
Enter Q to Quit Program

Please Select an Option:2
>>> Input Error:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
        at java.awt.Window.<init>(Window.java:318)
        at java.awt.Frame.<init>(Frame.java:419)
        at java.awt.Frame.<init>(Frame.java:384)
        at e.a(Unknown Source)
        at OSWGraph.OSWGraph.main(Unknown Source)
[oracle@TEST oswbb]$

 

原因:无法通过X11图形界面显示,因为我用的SecureCRT,没有图形界面,故报错。

 

解决办法:

如果能访问服务器的图形界面最好,如何条件不允许,可以使用工具Xmanager或者VNC


 VNC的安装配置详见:http://blog.csdn.net/langkeziju/article/details/9832879

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值