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

  OSWatcher Black Box, 簡(jiǎn)稱OSW,是oracle提供的一個(gè)小但是非常有用的工具,它通過調(diào)用OS自己提供的命令來記錄OS運(yùn)行時(shí)的一些性能參數(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. 平時(shí)不需要維護(hù),并且在發(fā)生問題時(shí)可以幫我們迅速定位問題是否發(fā)生在OS端

數(shù)據(jù)庫是運(yùn)行在OS之上的,如果OS發(fā)生了異常,那么數(shù)據(jù)庫肯定也會(huì)受到影響;如果我們僅僅從數(shù)據(jù)庫的角度去分析這樣的問題時(shí),很難有個(gè)好結(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賬號(hào)

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

2、安裝

隨便找一個(gè)目錄解壓安裝,不要在/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:這是一個(gè)shell腳本,用于收集和存儲(chǔ)數(shù)據(jù)

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

3、啟動(dòng)OSWatcher

startOSWbb.sh腳本有四個(gè)參數(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í)的數(shù)據(jù)。

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

#啟動(dò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目錄下生成了對(duì)應(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ì)的介紹各個(gè)目錄的含義。

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

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

HP-UX的一個(gè)例子

###################################################################### #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使用簡(jiǎn)介

2)生成報(bào)告

[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. #生成的分析報(bào)告在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小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

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

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

廣告

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

微信小程序開發(fā)