安裝使用OSWatcher監控工具

oxoxooxx發表於2011-01-12

今天在eygle大師的微博看到介紹OSWatcher工具,晚上有空就在自己機器上安裝後,初步測試一下,此工具透過shell指令碼呼叫系統中常用的統計資訊蒐集工具,
比如VMSTAT,IOSTAT,MPSTAT,NETSTAT,TOP等工具,蒐集作業系統,網路等相關的統計資訊;另外,提供了一個jar包,透過呼叫此包可以將蒐集的統計資訊以圖形化的形式展示.

下面主要涉及兩個實踐操作:
一.在linux上安裝java環境
摘要:
1.直接執行jdk對應的bin 檔案安裝
./*.bin
2.修改profile
vi /etc/profile
新增如下資訊:
export JAVA_HOME=/usr/local/java
export PATH=/usr/local/java/bin:$PATH
export CLASSPATH=/usr/local/java/lib:.
3.使profile生效
source /etc/profile

二.安裝並使用OSWatcher
1.tar zxvf 解壓osw安裝檔案*.tar.gz
2.osw相應的指令碼工具
Exampleprivate.net
OSWatcher.sh
OSWatcherFM.sh
OSWg.jar
OSWgREADME
oswnet.sh
oswsub.sh
README
startOSW.sh
stopOSW.sh
tarupfiles.sh
topaix.sh

操作詳細資訊:
===========================================
一.在linux上安裝java環境
[wangm@dbp ~]$ su -
Password:
[root@dbp ~]# cd /var/ftp/pub
[root@dbp pub]# ls
jdk-7-ea-bin-b19-linux-i586-30_aug_2007-rpm.bin
osw.zip
[root@dbp pub]# chmod 777 jdk-7-ea-bin-b19-linux-i586-30_aug_2007-rpm.bin
[root@dbp pub]# ./jdk-7-ea-bin-b19-linux-i586-30_aug_2007-rpm.bin
Pre-Release Software Evaluation Agreement

SUN MICROSYSTEMS, INC. ("SUN") IS WILLING TO LICENSE THE JAVA SE DEVELOPMENT KIT (JDK), VERSION 7, PRE-RELEASE SOFTWARE TO LICENSEE ONLY UPON THE CONDITION THAT LICENSEE ACCEPTS ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING OR INSTALLING THIS SOFTWARE, LICENSEE ACCEPTS THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT. INDICATE ACCEPTANCE BY SELECTING THE "ACCEPT" BUTTON AT THE BOTTOM OF THIS AGREEMENT. IF LICENSEE IS NOT WILLING TO BE BOUND BY ALL THE TERMS, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THE AGREEMENT AND THE DOWNLOAD OR INSTALL PROCESS WILL NOT CONTINUE.

1.0 DEFINITIONS "Licensed Software" means the Java SE Development Kit (JDK), Version 7, pre-release software in binary and/or source code forms, any other machine readable materials (including, but not limited to, libraries, source files, header files, and data files), Feedback (as defined in Section 5.0), any user manuals, programming guides and other documentation provided to Licensee by Sun under this Agreement.

2.0 LIMITED LICENSE

2.1 Source Code. Sun grants to Licensee, a non-exclusive, non-transferable, royalty-free and limited license to view the source code portions of the Licensed Software internally for the purposes of evaluation only.

2.2 Binary Code. Sun grants to Licensee, a non-exclusive, non-transferable, royalty-free and limited license to use the binary code portions of the Licensed Software internally for the purposes of evaluation only.

2.3 No licenses are granted to Licensee for any other purposes, Licensee may not sell, rent, loan or otherwise encumber or transfer Licensed Software in whole or in part, to any third party.

3.0 LICENSE RESTRICTIONS

3.1 Licensee may not duplicate Licensed Software other than for a single copy of Licensed Software for archival purposes only. Licensee agrees to reproduce any
copyright and other proprietary right notices on any such copy.

3.2 Licensed Software is "Confidential Information". Licensee may not disclose
or use Confidential Information, except for the purposes specified in this Agreement. Licensee will protect the Confidential Information with the same degree of care, as Licensee uses to protect its own Confidential Information.

3.3 Except as otherwise provided by law, Licensee may not modify or create derivative works of the Licensed Software, or reverse engineer, disassemble or decompile binary portions of the Licensed Software, or otherwise attempt to derive the source code from such portions.

3.4 No right, title, or interest in or to Licensed Software, any trademarks, service marks, or trade names of Sun or Sun's licensors is granted under this Agreement.

3.5 Licensee shall have no right to use the Licensed Software for productive or
commercial use.

4.0 NO SUPPORT Sun is under no obligation to support Licensed Software or to provide Licensee with updates or error corrections (collectively "Software Updates"). If Sun, at its sole option, supplies Software Updates to Licensee, the Software Updates will be considered part of Licensed Software, and subject to the terms of this Agreement.

5.0 LICENSEE DUTIES Licensee agrees to evaluate and test the Software for use in Licensee's software environment and provide feedback to Sun in a manner reasonably requested by Sun. Any and all test results, error data, reports or other information, feedback or materials made or provided by Licensee relating to Software (collectively, "Feedback") are the exclusive property of Sun and Licensee hereby assigns all Feedback to Sun at no cost to Sun. Sun may use such Feedback in any manner and for any purpose, without limitation, liability or obligation to Licensee.

6.0 TERM AND TERMINATION OF AGREEMENT

6.1 This Agreement will commence on the date on which Licensee receives Licensed Software (the "Effective Date") and will expire ninety (90) days from the Effective Date, unless terminated earlier as provided herein.

6.2 Either party may terminate this Agreement upon ten (10) days' written notice to the other party. However, Sun may terminate this Agreement immediately should any Licensed Software become, or in Sun's opinion be likely to become, the subject of a claim of infringement of a patent, trade secret or copyright.

6.3 Sun may terminate this Agreement immediately should Licensee materially breach any of its provisions or take any action in derogation of Sun's rights to the Confidential Information licensed to Licensee.

6.4 Upon termination or expiration of this Agreement, Licensee will immediately
cease use of and destroy Licensed Software, any copies thereof.

6.5 Rights and obligations under this Agreement which by their nature should survive, will remain in effect after termination or expiration hereof.

7.0 DISCLAIMER OF WARRANTY

7.1 Licensee acknowledges that Licensed Software may contain errors and is not designed, licensed, or intended for use in the design, construction, operation or maintenance of any nuclear facility ("HighRisk Activities"). Sun disclaims any
express or implied warranty of fitness for such uses. Licensee represents and warrants to Sun that it will not use, distribute or license the Licensed Software
for High Risk Activities.

7.2 LICENSED SOFTWARE IS PROVIDED "AS IS". ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS, AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

8.0 LIMITATION OF LIABILITY

8.1 Licensee acknowledges that the Licensed Software may be experimental and that the Licensed Software may have defects or deficiencies, which cannot or will not be corrected by Sun. Licensee will hold Sun harmless from any claims based on Licensee's use of the Licensed Software for any purposes other than those of internal evaluation, and from any claims that later versions or releases of any Licensed Software furnished to Licensee are incompatible with the Licensed Software provided to Licensee under this Agreement.

8.2 To the extent not prohibited by law, in no event will Sun be liable for any
indirect, punitive, special, incidental or consequential damage in connection with or arising out of this Agreement (including loss of business, revenue, profits, use, data or other economic advantage), however it arises, whether for breach or in tort, even if Sun has been previously advised of the possibility of such
damage.

9.0 U.S. GOVERNMENT RESTRICTED RIGHTS If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in accordance with 48 C.F.R. 227.7202-4 (for Department of Defense (DOD) acquisitions)
and with 48 C.F.R. 2.101 and 12.212 (for non-DOD acquisitions).

10.0 GENERAL TERMS

10.1 Any action relating to or arising out of this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply.

10.2 Licensed Software and technical data delivered under this Agreement are subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee.

10.3 It is understood and agreed that, notwithstanding any other provision of this Agreement, Licensee's breach of this Agreement will cause Sun irreparable damage for which recovery of money damages would be inadequate, and that Sun will therefore be entitled to seek timely injunctive relief to protect Sun's rights under this Agreement in addition to any and all remedies available at law.

10.4 Neither party may assign or otherwise transfer any of its rights or obligations under this Agreement, without the prior written consent of the other party, except that Sun may assign this Agreement to an affiliated company.

10.5 This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications,
proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter, including any Binary Code Licenses, Supplemental Terms, or other licenses contained within Licensed
Software. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party.
Do you agree to the above license terms? [yes or no]
yes
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP ().
inflating: jdk-7-ea-linux-i586.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...

Done.
[root@dbp pub]# vi /etc/profile
新增如下資訊:
export JAVA_HOME=/usr/local/java
export PATH=/usr/local/java/bin:$PATH
export CLASSPATH=/usr/local/java/lib:.

[root@dbp pub]# source /etc/profile
[root@dbp pub]# java -version
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b19)
Java HotSpot(TM) Client VM (build 1.7.0-ea-b19, mixed mode, sharing)
[root@dbp pub]#

二.安裝並使用OSWatcher
[root@dbp pub]# unzip osw.zip
Archive: osw.zip
creating: osw/
inflating: osw/Exampleprivate.net
inflating: osw/OSWatcher.sh
inflating: osw/OSWatcherFM.sh
inflating: osw/OSWg.jar
inflating: osw/OSWgREADME
inflating: osw/oswnet.sh
inflating: osw/oswsub.sh
inflating: osw/README
inflating: osw/startOSW.sh
inflating: osw/stopOSW.sh
inflating: osw/tarupfiles.sh
inflating: osw/topaix.sh
[root@dbp pub]# ls
10201_database_linux32.zip osw.zip rac asmdisk2~ test_ftp
database proc rac_rpm_setup_note.txt
osw rac asmdisk2 rac_rpm_setup_note.txt~
[root@dbp pub]# cd osw
[root@dbp osw]# ls -ltr
total 772
-rw-r--r-- 1 root root 409 Apr 9 2007 topaix.sh
-rw-r--r-- 1 root root 127 Apr 9 2007 tarupfiles.sh
-rw-r--r-- 1 root root 560 Apr 9 2007 stopOSW.sh
-rw-r--r-- 1 root root 1101 Apr 9 2007 startOSW.sh
-rw-r--r-- 1 root root 401 Apr 9 2007 oswsub.sh
-rw-r--r-- 1 root root 334 Apr 9 2007 oswnet.sh
-rw-r--r-- 1 root root 722088 Apr 9 2007 OSWg.jar
-rw-r--r-- 1 root root 11784 Apr 9 2007 OSWatcher.sh
-rw-r--r-- 1 root root 4451 Apr 9 2007 OSWatcherFM.sh
-rw-r--r-- 1 root root 1731 Apr 9 2007 Exampleprivate.net
-rw-r--r-- 1 root root 4997 Apr 18 2007 README
-rw-r--r-- 1 root root 3426 Apr 18 2007 OSWgREADME
[root@dbp osw]# chmod 777 *
[root@dbp osw]# ls -ltr
total 772
-rwxrwxrwx 1 root root 409 Apr 9 2007 topaix.sh
-rwxrwxrwx 1 root root 127 Apr 9 2007 tarupfiles.sh
-rwxrwxrwx 1 root root 560 Apr 9 2007 stopOSW.sh
-rwxrwxrwx 1 root root 1101 Apr 9 2007 startOSW.sh
-rwxrwxrwx 1 root root 401 Apr 9 2007 oswsub.sh
-rwxrwxrwx 1 root root 334 Apr 9 2007 oswnet.sh
-rwxrwxrwx 1 root root 722088 Apr 9 2007 OSWg.jar
-rwxrwxrwx 1 root root 11784 Apr 9 2007 OSWatcher.sh
-rwxrwxrwx 1 root root 4451 Apr 9 2007 OSWatcherFM.sh
-rwxrwxrwx 1 root root 1731 Apr 9 2007 Exampleprivate.net
-rwxrwxrwx 1 root root 4997 Apr 18 2007 README
-rwxrwxrwx 1 root root 3426 Apr 18 2007 OSWgREADME
[root@dbp osw]# ./OSWatcher
OSWatcherFM.sh OSWatcher.sh
[root@dbp osw]# ./OSWatcher.sh 60 2

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 Jan 12 00:31:15 EST 2011
With SnapshotInterval = 60
With ArchiveInterval = 2

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

Starting Data Collection...

osw heartbeat:Wed Jan 12 00:31:15 EST 2011
osw heartbeat:Wed Jan 12 00:32:16 EST 2011

[root@dbp osw]# java -jar OSWg.jar -i 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 dbp_iostat_01.12.11.0000.dat ...
Parsing file dbp_vmstat_01.12.11.0000.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

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23937368/viewspace-1044547/,如需轉載,請註明出處,否則將追究法律責任。

相關文章