OSwatcher作為Oracle官方推薦的OS層面運行狀態檢測的指令碼工具。在Exadata是預設已經安裝。
但是Exadata是如何在系統啟動後,自動啟動OSwatcher呢?我們如何去修改OSwatcher的參數,來調整監控和日誌儲存的策略呢?
本文正是介紹,從系統啟動到OSwatcher運行,中間經曆過的指令碼調用,以及如何修改OSwatcher參數的。
1. 首先檢查rc.local檔案,可以發現/etc/rc.d/rc.Oracle.Exadata
# vi /etc/rc.d/rc.local-----------------------------------------########### BEGIN DO NOT REMOVE Added by Oracle Exadata ###########if [ -x /etc/rc.d/rc.Oracle.Exadata ]; then . /etc/rc.d/rc.Oracle.Exadata <<<<<<<<<<<<<<<<<<<<<<This script will be run automaticlly, when the OS startsfi########### END DO NOT REMOVE Added by Oracle Exadata ###########-----------------------------------------
2. 查看rc.Oracle.Exadata,找到/opt/oracle.cellos/vldrun -all
# vi /etc/rc.d/rc.Oracle.Exadata-----------------------------------------# Perform validations step/opt/oracle.cellos/vldrun -all <<<<<<<<<<<<<<<<<<<<<<This script will be run automaticlly, when the OS starts-----------------------------------------
3. 檢查當前OSwatcher的設定,每15秒收集一次,產生的日誌儲存168小時7天),bzip2的壓縮模式,最大日誌尺寸是3G
# ps -ef | grep OSWroot 15962 1 0 04:00 pts/1 00:00:00 /bin/ksh ./OSWatcher.sh 15 168 bzip2 3root 15994 15962 0 04:00 pts/1 00:00:00 /bin/ksh ./OSWatcherFM.sh 168 3root 16272 9529 0 04:00 pts/1 00:00:00 grep OSW
4. 指令碼/opt/oracle.cellos/vldrun會調用oswatcher指令碼來啟動oswatcher
# ls -al /opt/oracle.cellos/validations/init.d/oswatcher-r-xr-x--- 1 root root 5128 Aug 19 03:39 oswatcher# chmod 750 oswatcher <<<<<<<<<<<<<<<<<<<<<<<<Change the right, then we can edit it as per our expected.# ls -al oswatcher-rwxr-x--- 1 root root 5128 Aug 19 03:39 oswatcher
5. 檢查當前oswatcher指令碼中的設定,並修改本次修改將原有的最大儲存3G的日誌,修改為最大日誌尺寸為4G)
# vi oswatcher----------------------------------------fi(umask 0037; nohup ./startOSW.sh 15 168 bzip2 4 >/var/log/cellos/start_oswatcher.log 2>&1 &)& <<<<<<<<<<<<change this part of the script, will let the script run as per our expected.# Dont direct logs to startosw.log. It grows too large and fast# (nohup ./startOSW.sh 15 168 bzip2 3 >/dev/null 2>&1 &)&popd >/dev/null----------------------------------------
6. 停止oswatcher
#/opt/oracle.oswatcher/osw/stopOSW.sh# ps -ef | grep OSWroot 10528 9529 0 03:59 pts/1 00:00:00 grep OSW 7. 手動啟動oswatcher# /opt/oracle.cellos/vldrun -script oswatcherLogging started to /var/log/cellos/validations.logCommand line is ./validations/bin/vldrun.pl -quiet -script oswatcherRun validation oswatcher - PASSEDThe each boot completed with SUCCESS
8.再次檢查OSwatcher的設定,最大日誌尺寸已經改為4G
# ps -ef|grep OSWroot 109041 1 0 03:37 pts/1 00:00:00 /bin/ksh ./OSWatcher.sh 15 168 bzip2 4root 109073 109041 0 03:37 pts/1 00:00:00 /bin/ksh ./OSWatcherFM.sh 168 4root 109348 59019 0 03:37 pts/1 00:00:00 grep OSW
更對oswatcher細節,可以參考以下官方文檔(註:目前文檔1585389.1中已經記錄如何永久修改exadata上osw的設定, 但是本人測試的時候,該文檔並沒有相關記錄)
OSWatcher does not Retain Data for the Full Retention Period Specified (Doc ID 1585389.1)
OSWatcher Black Box (Includes: [Video]) (Doc ID 301137.1)
本文出自 “小小狗窩” 部落格,請務必保留此出處http://hsbxxl.blog.51cto.com/181620/1354316