author:skate
time:2011/08/06
oswatch的安装和使用
1.下载和安装
oswatch的安装与使用也比较简单,和nmon一样,都是下载后直接解压就可以使用的。
oswatch是通过调用系统的命令完成信息的收集,命令如下:ps ,top ,mpstat ,iostat,netstat ,traceroute vmstat 。支持的操作系统有AIX ,Tru64 ,Solaris ,HP-UX ,Linux ; 当然也有windows版本的
可以在metlink直接下载:OS Watcher User Guide [ID 301137.1]
下载的就是tar包,然后直接解压,查看是否有执行权限,没有的话就赋予执行权限
1.
[root@dhdb software]# pwd
/tmp/software
[root@dhdb software]# ls
osw302.tar
[root@dhdb software]# tar xvf osw302.tar
osw/
osw/Exampleprivate.net
osw/OSWatcher.sh
osw/OSWatcherFM.sh
osw/OSWgREADME.txt
osw/iosub.sh
osw/mpsub.sh
osw/oswg.jar
osw/oswib.sh
osw/oswlnxio.sh
osw/oswlnxtop.sh
osw/oswnet.sh
osw/oswrds.sh
osw/oswsub.sh
osw/pssub.sh
osw/startOSW.sh
osw/stopOSW.sh
osw/tarupfiles.sh
osw/topaix.sh
osw/topsub.sh
osw/vmsub.sh
osw/tmp/
osw/src/
osw/src/coe_logo.gif
osw/src/missing_graphic.gif
osw/src/oswg_input.txt
osw/src/OSW_profile.htm
osw/src/Thumbs.db
osw/src/tombody.gif
osw/src/watch.gif
osw/README.txt
[root@dhdb software]# ls
osw osw302.tar
[root@dhdb software]# ls osw
Exampleprivate.net OSWatcher.sh oswlnxio.sh oswsub.sh startOSW.sh topaix.sh
iosub.sh oswg.jar oswlnxtop.sh pssub.sh stopOSW.sh topsub.sh
mpsub.sh OSWgREADME.txt oswnet.sh README.txt tarupfiles.sh vmsub.sh
OSWatcherFM.sh oswib.sh oswrds.sh src tmp
[root@dhdb software]# ls -l osw
total 1336
-rwxr-xr-x 1 1003 dba 1730 Aug 20 2009 Exampleprivate.net
-rwxr-xr-x 1 1003 dba 549 Aug 20 2009 iosub.sh
-rwxr-xr-x 1 1003 dba 549 Aug 20 2009 mpsub.sh
-rwxr-xr-x 1 1003 dba 4451 Aug 20 2009 OSWatcherFM.sh
-rwxr-xr-x 1 1003 dba 22511 May 4 15:06 OSWatcher.sh
-rw-r--r-- 1 1003 dba 1226302 Feb 11 21:49 oswg.jar
-rw-r--r-- 1 1003 dba 14781 May 4 15:45 OSWgREADME.txt
-rwxr-xr-x 1 1003 dba 415 Aug 20 2009 oswib.sh
-rwxr-xr-x 1 1003 dba 659 Aug 20 2009 oswlnxio.sh
-rwxr-xr-x 1 1003 dba 829 Aug 20 2009 oswlnxtop.sh
-rwxr-xr-x 1 1003 dba 357 Aug 20 2009 oswnet.sh
-rwxr-xr-x 1 1003 dba 826 Aug 20 2009 oswrds.sh
-rwxr-xr-x 1 1003 dba 529 Aug 20 2009 oswsub.sh
-rwxr-xr-x 1 1003 dba 549 Aug 20 2009 pssub.sh
-rw-r--r-- 1 1003 dba 8513 May 4 15:37 README.txt
drwxr-xr-x 2 1003 dba 4096 Aug 31 2009 src
-rwxr-xr-x 1 1003 dba 1638 Feb 11 21:50 startOSW.sh
-rwxr-xr-x 1 1003 dba 560 Aug 20 2009 stopOSW.sh
-rwxr-xr-x 1 1003 dba 127 Aug 20 2009 tarupfiles.sh
drwxr-xr-x 2 1003 dba 4096 Aug 20 2009 tmp
-rwxr-xr-x 1 1003 dba 431 Aug 20 2009 topaix.sh
-rwxr-xr-x 1 1003 dba 550 Aug 20 2009 topsub.sh
-rwxr-xr-x 1 1003 dba 549 Aug 20 2009 vmsub.sh
[root@dhdb software]#
[root@dhdb osw]# cp startOSW.sh /bin/oswstart
[root@dhdb osw]# cp startOSW.sh /usr/bin/oswstart
[root@dhdb osw]# cp startOSW.sh /usr/local/bin/oswstart
[root@dhdb osw]# oswstart
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...
[root@dhdb osw]# cp stopOSW.sh /bin/oswstop
[root@dhdb osw]# cp stopOSW.sh /usr/bin/oswstop
[root@dhdb osw]# cp stopOSW.sh /usr/local/bin/oswstop
oswatch的使用很简单,它需要两个参数
#oswstart arg1 arg2
arg1:数据收集的间隔,以秒为单位
arg2: 数据收集多长时间,以小时为单位
例如下面是每30秒收集一次信息,要收集一小时
[root@dhdb osw]# oswstart 30 1
[root@dhdb osw]#
Testing for discovery of OS Utilities...
VMSTAT found on your system.
Warning... IOSTAT not found on your system. No IOSTAT data will be collected.
Warning... MPSTAT not found on your system. No MPSTAT data will be collected.
NETSTAT found on your system.
TOP found on your system.
Discovery completed.
Starting OSWatcher v3.0.2 on Sat Aug 6 18:01:31 CST 2011
With SnapshotInterval = 30
With ArchiveInterval = 1
OSWatcher - Written by Carl Davis, Center of Expertise, Oracle Corporation
Starting Data Collection...
osw heartbeat:Sat Aug 6 18:01:31 CST 2011
如果是第一次开始收集的话,会在oswatch安装目录下生成一个archive子目录用于存放收集到信息,例如
[root@dhdb osw]# ls ./archive/
oswiostat oswmeminfo oswmpstat oswnetstat oswprvtnet oswps oswslabinfo oswtop oswvmstat
[root@dhdb osw]#
信息收集之后就可以查看,
[root@dhdb osw]# java -jar oswg.jar -i ./archive
Starting OSWg V3.0.1
OSWatcher Graph Written by Oracle Center of Expertise
Copyright (c) 2008 by Oracle Corporation
Parsing Data. Please Wait...
ERROR. You do not have a legitimate version of java in your PATH.
Linux users please download and install java from java.sun.com or
see the OSWgREADME for instructions on how to use the version of java
that comes shipped with the Oracle database.
[root@dhdb osw]#
那是因为没有使用oracle的java的版本,把oracle的java版本加到root的环境变量里即可,如下:
将jar 的环境加入path:
export PATH=$ORACLE_HOME/jre/1.4.2/bin:$PATH
[root@dhdb osw]# vi /root/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
. ~/.bash_profile111
# User specific environment and startup programs
PATH=$HOME/bin:/oracle/oracle/product/10.2.0/db_1/jre/1.4.2/bin:$PATH
export PATH
unset USERNAME
~
~
~
~
"~/.bash_profile" 15L, 262C written
[root@dhdb osw]#
[root@dhdb ~]# java -jar /tmp/software/osw/oswg.jar -i /tmp/software/osw/archive
Starting OSWg V3.0.1
OSWatcher Graph Written by Oracle Center of Expertise
Copyright (c) 2008 by Oracle Corporation
Parsing Data. Please Wait...
Parsing file dhdb_vmstat_11.08.06.1700.dat ...
Parsing file dhdb_vmstat_11.08.06.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 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 P to Generate A Profile
Enter Q to Quit Program
Please Select an Option:6
至此,oswatch的安装使用都介绍完了。
oswatch和nmon对比
1.oswatch监控,收集,查看都可以在服务器上完成;而nmon的查看需要传到windows端完成
2.据我的使用,nmon查看的信息更全面,而且看着更舒服
-----end---------