OS Watcher (OSW)系统性能监控软件

OS Watcher简称OSW,用于收集并归档操作系统cpu,memery,disk io等相关信息的工具,是oracle提供的,OSW内部是使用操作系统提供的命令来收集数据,它可以放在后台定期间隔一段时间自动收集,并可以设定数据保留时间

这个工具包可以从Metalink下载。Metalink Note:301137.1
OSW is certified to run on the following platforms:
1.AIX
2.Tru64
3.Solaris
4.HP-UX
5.Linux

安装很方便,下载后就是一个压缩包就不到300K,解压就可以使用

启动运行./startOSW.sh,后可选3个参数

./startOSW.sh <ARG1> <ARG2> <ARG3>
ARG1:表示收集间隔时间,默认为30秒
ARG1:表示数据保留时间,默认为48小时
ARG3:gzip或不跟,加gzip表示用gzip去压缩收集到的数据
注意:首次运行时会在osw目录下创建archive子目录,用于存放收集到的数据,都是以文件格式存放,间隔30秒采集一次并保留10小时,一般需要120M左右的空间。

调用前先要先确保安装sysstat

[oracle@orazhang osw]$ rpm -qa sysstat
sysstat-7.0.4-2.fc7

下面我开始在rhel 5 linux上试验

[oracle@orazhang osw]$ ll
total 772
-rw-r--r-- 1 oracle oinstall   1731  Apr  9  2007 Exampleprivate.net
-rw-r--r-- 1 oracle oinstall   4451 Apr  9   2007 OSWatcherFM.sh
-rw-r--r-- 1 oracle oinstall  11784 Apr  9  2007  OSWatcher.sh
-rw-r--r-- 1 oracle oinstall 722088 Apr  9  2007  OSWg.jar
-rw-r--r-- 1 oracle oinstall   3426 Apr 18  2007  OSWgREADME
-rw-r--r-- 1 oracle oinstall    334 Apr  9  2007  oswnet.sh
-rw-r--r-- 1 oracle oinstall    401 Apr  9  2007  oswsub.sh
-rw-r--r-- 1 oracle oinstall   4997 Apr 18  2007  README
-rw-r--r-- 1 oracle oinstall   1101 Apr  9  2007  startOSW.sh
-rw-r--r-- 1 oracle oinstall    560 Apr  9  2007  stopOSW.sh
-rw-r--r-- 1 oracle oinstall    127 Apr  9  2007  tarupfiles.sh
-rw-r--r-- 1 oracle oinstall    409 Apr  9  2007  topaix.sh
[oracle@orazhang osw]$ chmod +x *.sh
增加执行权限
[oracle@orazhang  osw]$ ll
total 772
-rw-r--r-- 1 oracle oinstall   1731 Apr  9  2007  Exampleprivate.net
-rwxr-xr-x 1 oracle oinstall   4451 Apr  9  2007  OSWatcherFM.sh
-rwxr-xr-x 1 oracle oinstall  11784 Apr  9  2007  OSWatcher.sh
-rw-r--r-- 1 oracle oinstall 722088 Apr  9  2007  OSWg.jar
-rw-r--r-- 1 oracle oinstall   3426 Apr 18  2007  OSWgREADME
-rwxr-xr-x 1 oracle oinstall    334 Apr  9  2007  oswnet.sh
-rwxr-xr-x 1 oracle oinstall    401 Apr  9  2007  oswsub.sh
-rw-r--r-- 1 oracle oinstall   4997 Apr 18  2007  README
-rwxr-xr-x 1 oracle oinstall   1101 Apr  9  2007  startOSW.sh
-rwxr-xr-x 1 oracle oinstall    560 Apr  9  2007  stopOSW.sh
-rwxr-xr-x 1 oracle oinstall    127 Apr  9  2007  tarupfiles.sh
-rwxr-xr-x 1 oracle oinstall    409 Apr  9  2007 topaix.sh

启动
[oracle@orazhang osw]$ ./startOSW.sh 3 4

以3秒为间隔,保留最后4小时的数据,对于超过保留期限的数据,File Manager 会自动清理(File Manager 每隔一个小时调度一次)

oracle@orazhang osw]$
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 Wed Sep 28 16:14:43 CST 2011
With SnapshotInterval = 3
With ArchiveInterval = 4

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

Starting Data Collection...

osw heartbeat:Wed Sep 28 16:14:43 CST 2011
osw heartbeat:Wed Sep 28 16:14:46 CST 2011
osw heartbeat:Wed Sep 28 16:14:49 CST 2011
...

会一直监听,如果想停止,开一新窗口运行stopOSW.sh 有点像tomcat呵呵

[oracle@orazhang osw]$ ./stopOSW.sh   

调用OSWg.jar,调用图形界面查看曲线图
[oracle@orazhang ~]$ export DISPLAY=192.168.3.140:0.0
[oracle@orazhang ~]$ ls
delete.sql  Desktop  firefox  login.sql  oraInventory  osw  rda  rdesktop-1.7.0  record  rmanfullbak.sh  sql  wxWidgets-2.9.1
[oracle@orazhang ~]$ cd osw

[oracle@orazhang osw]$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20070626 (Red Hat 4.1.2-14)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[oracle@orazhang osw]$ java -jar OSWg.jar -i /home/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 orazhang_iostat_09.28.11.1600.dat ...
Parsing file orazhang_vmstat_09.28.11.1600.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 Q to Quit Program

Please Select an Option:1
>>> Input Error: null

[oracle@orazhang osw]$ which java
/usr/bin/java
[oracle@orazhang osw]$ export PATH=/u01/app/oracle/product/10.2.0/db_1/jre/1.4.2/bin:$PATH
[oracle@orazhang osw]$ java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
[oracle@orazhang osw]$ which java
/u01/app/oracle/product/10.2.0/db_1/jre/1.4.2/bin/java
[oracle@orazhang osw]$ java -jar OSWg.jar -i /home/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 orazhang_iostat_09.28.11.1600.dat ...
Parsing file orazhang_vmstat_09.28.11.1600.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 Q to Quit Program

Please Select an Option:1

 可以看到图形了
 


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 Q to Quit Program

Please Select an Option:2

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 Q to Quit Program

Please Select an Option:q

note:

生成后在调用图形是一定要注意java的版本信息,GNU libgcj是有问题,用oracle自带的就可以10g自带1.4,11G j是java 5

你可能感兴趣的:(Watcher)