OSWatcher使用簡介-創(chuàng)新互聯(lián)

  OSWatcher Black Box, 簡稱OSW,是oracle提供的一個小但是非常有用的工具,它通過調(diào)用OS自己提供的命令來記錄OS運(yùn)行時的一些性能參數(shù),比如CPU/Memory/Swap/Network IO/Disk IO相關(guān)的信息。

成都創(chuàng)新互聯(lián)公司2013年成立,先為梁子湖等服務(wù)建站,梁子湖等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢服務(wù)。為梁子湖企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。

但是部署OSW有很多好處:

1. 它比較容易部署,并且容易刪除。
2. 資源消耗比較小,不管是從CPU,內(nèi)存還是磁盤空間來說。
3. 平時不需要維護(hù),并且在發(fā)生問題時可以幫我們迅速定位問題是否發(fā)生在OS端

數(shù)據(jù)庫是運(yùn)行在OS之上的,如果OS發(fā)生了異常,那么數(shù)據(jù)庫肯定也會受到影響;如果我們僅僅從數(shù)據(jù)庫的角度去分析這樣的問題時,很難有個好結(jié)果.

官方博客介紹如下:

https://blogs.oracle.com/Database4CN/entry/%E5%88%A9%E5%99%A8osw_oswatcher_black_box_%E4%B9%8B%E7%AE%80%E4%BB%8B%E7%AF%87

1、下載

從MOS上里的文檔301137.1上下載OSW,需要有MOS賬號

百度網(wǎng)盤:http://pan.baidu.com/s/1bYdzJ4

2、安裝

隨便找一個目錄解壓安裝,不要在/tmp目錄,不必須root用戶

[oracle@rhel6 ~]$ mkdir oswatcher [oracle@rhel6 ~]$ mv oswbb734.tar oswatcher/ [oracle@rhel6 ~]$ cd oswatcher/ [oracle@rhel6 oswatcher]$ ls oswbb734.tar [oracle@rhel6 oswatcher]$ tar -xvf oswbb734.tar  oswbb/ oswbb/call_uptime.sh oswbb/profile/ oswbb/analysis/ oswbb/tar_up_partial_archive.sh oswbb/oswsub.sh oswbb/oswrds.sh oswbb/src/ oswbb/src/missing_graphic.gif oswbb/src/tombody.gif oswbb/src/coe_logo.gif oswbb/src/Thumbs.db oswbb/src/OSW_profile.htm oswbb/src/oswbba_input.txt oswbb/src/watch.gif oswbb/oswib.sh oswbb/call_du.sh oswbb/tarupfiles.sh oswbb/ltop.sh oswbb/nfssub.sh oswbb/docs/ oswbb/docs/OSWatcher/ oswbb/docs/OSWatcher/OSWatcherUserGuide.pdf oswbb/docs/OSWatcher/oswbb_README.txt oswbb/docs/The_Analyzer/ oswbb/docs/The_Analyzer/oswbba_README.txt oswbb/docs/The_Analyzer/oswbbaUserGuide.pdf oswbb/docs/The_Analyzer/OSWatcherAnalyzerOverview.pdf oswbb/OSWatcher.sh oswbb/psmemsub.sh oswbb/call_sar.sh oswbb/oswnet.sh oswbb/Exampleprivate.net oswbb/mpsub.sh oswbb/Example_extras.txt oswbb/OSWatcherFM.sh oswbb/startOSWbb.sh oswbb/ifconfigsub.sh oswbb/iosub.sh oswbb/oswbba.jar oswbb/vmsub.sh oswbb/xtop.sh oswbb/stopOSWbb.sh

OSWatcher包含兩部分:

oswbb:這是一個shell腳本,用于收集和存儲數(shù)據(jù)

oswbba:這是一個java工具用于分析收集到的數(shù)據(jù)并提供建議,還可以生成圖片或html文檔。

3、啟動OSWatcher

startOSWbb.sh腳本有四個參數(shù):

ARG1 = snapshot interval in seconds.
ARG2 = the number of hours of archive data to store.
ARG3 = (optional) the name of a compress utility to compress each file automatically after it is created.
ARG4 = (optional) an alternate (non default) location to store the archive directory.

如果不輸入任何參數(shù),默認(rèn)間隔30秒收集一次數(shù)據(jù),并且默認(rèn)保存48小時的數(shù)據(jù)。

默認(rèn)收集到的數(shù)據(jù)會存儲在解壓目錄下的archive目錄下,這個目錄是在第一次啟動startOSWbb.sh腳本時創(chuàng)建的。

#啟動startOSWbb.sh腳本,間隔15秒,保存5天的數(shù)據(jù) [oracle@rhel6 oswbb]$ nohup sh startOSWbb.sh 15 120 & [1] 3131 [oracle@rhel6 oswbb]$ nohup: ignoring input and appending output to `nohup.out' [1]+  Done                    nohup sh startOSWbb.sh 15 120 #查看輸出日志 [oracle@rhel6 oswbb]$ more nohup.out  Setting the archive log directory to/home/oracle/oswatcher/oswbb/archive Testing for discovery of OS Utilities... VMSTAT found on your system. IOSTAT found on your system. MPSTAT found on your system. IFCONFIG 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 = 2 Discovery completed. #生成的archive目錄下生成了對應(yīng)不同收集信息的目錄 [oracle@rhel6 oswbb]$ cd archive [oracle@rhel6 archive]$ ls oswifconfig  oswiostat  oswmeminfo  oswmpstat  oswnetstat  oswprvtnet  oswps  oswslabinfo  oswtop  oswvmstat

MOS文檔 ID 1531223.1有詳細(xì)的介紹各個目錄的含義。

在OSWbb第一次使用時,它會創(chuàng)建一些歸檔的子目錄。 這些歸檔目錄包含7個子目錄,每一個子目錄對應(yīng)一個收集數(shù)據(jù)。 這7個目錄分別對應(yīng):top, vmstat, iostat, mpstat, netstat, ps 和一個可選的traceprivate network。

要啟動private network,必須先在oswbb目錄下創(chuàng)建一個private.net的可執(zhí)行文件。 這個文件里的內(nèi)容可以是用來驗證RAC private network的traceroute命令,不同平臺使用traceroute命令的參數(shù)不盡相同,private.net文件可以可以根據(jù)Exampleprivate.net文件來修改創(chuàng)建。

HP-UX的一個例子

###################################################################### #HP Example ###################################################################### echo "zzz ***"`date` traceroute -r -F 192.168.2.21 traceroute -r -F 192.168.2.22 ###################################################################### # DO NOT DELETE THE FOLLOWING LINE!!!!!!!!!!!!!!!!!!!!! ###################################################################### rm locks/lock.file

4、分析OSWatcher收集到的日志

使用oswbba.jar包進(jìn)行日志的分析,但是jara要在1.4.2及以上版本。

兩種方法分析數(shù)據(jù)

1)生成圖形

[oracle@rhel6 oswbb]$ export DISPLAY=192.168.56.1:0.0 [oracle@rhel6 oswbb]$ java -jar oswbba.jar -i archive Starting OSW Analyzer V7.3.3 OSWatcher Analyzer Written by Oracle Center of Expertise Copyright (c)  2014 by Oracle Corporation Parsing Data. Please Wait... Scanning file headers for version and platform info... Parsing file rhel6_iostat_16.12.19.1100.dat ... Parsing file rhel6_vmstat_16.12.19.1100.dat ... Parsing file rhel6_netstat_16.12.19.1100.dat ... Parsing file rhel6_top_16.12.19.1100.dat ... Parsing file rhel6_ps_16.12.19.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 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 Alter Graph Time Scale Only (Does not change analysis dataset) Enter D to Return to Default Graph Time Scale Enter R to Remove Currently Displayed Graphs Enter A to Analyze Data Enter S to Analyze Subset of Data(Changes analysis dataset including graph time scale) Enter P to Generate A Profile Enter X to Export Parsed Data to File Enter Q to Quit Program Please Select an Option:7 Generating file gif/Dec19110157_1482117313/OSWg_OS_Memory_Swap.gif Generating file gif/Dec19110157_1482117313/OSWg_OS_Memory_Free.gif Generating file gif/Dec19110157_1482117313/OSWg_OS_Memory_Page_In_Rate.gif

OSWatcher使用簡介

2)生成報告

[oracle@rhel6 oswbb]$ java -jar oswbba.jar -i archive -A Scanning file headers for version and platform info... Parsing file rhel6_iostat_16.12.19.1100.dat ... Parsing file rhel6_vmstat_16.12.19.1100.dat ... Parsing file rhel6_netstat_16.12.19.1100.dat ... Parsing file rhel6_top_16.12.19.1100.dat ... Parsing file rhel6_ps_16.12.19.1100.dat ... Dates accepted. Verifying valid begin/end data points... Validating times in the archive... Recalibrating data... Scanning file headers for version and platform info... Parsing file rhel6_iostat_16.12.19.1100.dat ... Parsing file rhel6_vmstat_16.12.19.1100.dat ... Parsing file rhel6_netstat_16.12.19.1100.dat ... Parsing file rhel6_top_16.12.19.1100.dat ... Parsing file rhel6_ps_16.12.19.1100.dat ... A new analysis file analysis/rhel6_1482117679897.txt has been created. #生成的分析報告在analysis目錄中 [oracle@rhel6 oswbb]$ more analysis/rhel6_1482117679897.txt This report is best viewed in a fixed font editor like textpad... OSWatcher Analyzer Input Archive:       archive Archive Source Dest: /home/oracle/oswatcher/oswbb/archive Archive Start Time:  Dec 19 11:01:57 2016 Archive Stop Time:   Dec 19 11:20:59 2016 Hostname:            RHEL6 OS Version:          Linux Snapshot Freq:       15 CPU COUNT:           2 ...... Subsystem       Status ------------------------ CPU             OK MEMORY          OK I/O             WARNING  NET             OK ......

MOS文檔 ID 461053.1有詳細(xì)介紹使用分析工具。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

本文名稱:OSWatcher使用簡介-創(chuàng)新互聯(lián)
本文鏈接:http://muchs.cn/article20/cdihjo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計、外貿(mào)網(wǎng)站建設(shè)、品牌網(wǎng)站建設(shè)、ChatGPT微信公眾號、網(wǎng)站排名

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)