check mk 監控 oracle

來源:互聯網
上載者:User

標籤:賦權   group   inux   1.2   roc   login   dir   $1   jobs   

1、安裝新版check_mk_agent,1.2.5i7版本以上並確定mk_oracle指令碼已經安裝完畢

從伺服器端拷貝mk_oracle指令碼到目標伺服器

cp /usr/share/check-mk-agent/plugins/mk_oracle /usr/lib/check_mk_agent/plugins/ls -lth /usr/lib/check_mk_agent/plugins/mk_oracle

2、資料庫對check_mk使用者賦權:
(1)授予select_catalog_role to check_mk

[email protected]# su - oracle[email protected]:~> export ORACLE_SID=<SID of an Instance>[email protected]:~> sqlplus / as sysdbasqlplus> create user check_mk identified by secret_password;sqlplus> grant select_catalog_role to check_mk;sqlplus> connect check_mk/secret_passwordsqlplus> exit[email protected]:~> export ORACLE_SID=<SID of an Instance>

(2)ASM相關

[email protected]# su - oracle[email protected]:~> ps ax | grep pmon | grep ASM[email protected]:~> export ORACLE_SID=+ASM1[email protected]:~> sqlplus / as sysasmsqlplus> create user check_mk identified by secret_password;sqlplus> grant sysdba to check_mk;sqlplus> exit

3、修改/etc/check_mk/sqlplus.sh檔案
vi /etc/check_mk/sqlplus.sh
修改為:

ORACLE_SID=$1if [ -z "$ORACLE_SID" ] ; then    echo "Usage: $0 ORACLE_SID" >&2    exit 1fisu - oracle -c "ORACLE_SID=$ORACLE_SIDORAENV_ASK=NOsource /home/oracle/.bash_profilesqlplus -s check_mk/password"

4、編輯/etc/check_mk/mk_oracle.cfg檔案
vi /etc/check_mk/mk_oracle.cfg
添加:

#ASMUSER=check_mk:password:sysdba:hostname:port#DBUSER=check_mk:password:sysdba:hostname:portASMUSER=check_mk:passwordDBUSER=check_mk:password

拷貝tns檔案到/etc/check_mk
cp /u01/app/oracle/11.2.0/dbhome_1/network/admin/tnsnames.ora /etc/check_mk/

5、編輯/etc/check_mk/sqlnet.ora

vi /etc/check_mk/sqlnet.oraLOG_DIRECTORY_CLIENT = /var/log/check_mk/oracle_clientDIAG_ADR_ENABLED = OFFSQLNET.WALLET_OVERRIDE = FALSEWALLET_LOCATION = (SOURCE=  (METHOD = FILE)  (METHOD_DATA = (DIRECTORY=/etc/check_mk/oracle_wallet)) )

6、執行驗證語句:

export MK_CONFDIR="/etc/check_mk";/usr/lib/check_mk_agent/plugins/mk_oracle -texport MK_CONFDIR="/etc/check-mk-agent";/usr/share/check-mk-agent/plugins/mk_oracle -t

輸出:
[[email protected] check_mk]# export MK_CONFDIR="/etc/check_mk";/usr/lib/check_mk_agent/plugins/mk_oracle -t

<<<oracle_instance>>><<<oracle_sessions>>><<<oracle_logswitches>>><<<oracle_undostat>>><<<oracle_recovery_area>>><<<oracle_processes>>><<<oracle_recovery_status>>><<<oracle_longactivesessions>>><<<oracle_dataguard_stats>>><<<oracle_performance>>><<<oracle_tablespaces>>><<<oracle_rman>>><<<oracle_jobs>>><<<oracle_ts_quotas>>><<<oracle_resumable>>><<<oracle_locks>>><<<oracle_instance>>><<<oracle_asm_diskgroup>>>
-----------------------------------------------Logincheck to Instance: hisdb  Version: 11.2The Oracle base remains unchanged with value /u01/app/oracleLogin ok User: CHECK_MK on datahis

出現Login ok 字樣,說明配置成功了

7、許可權設定:

chmod 700 /etc/check_mk/sqlplus.shchmod 600 /etc/check_mk/mk_oracle.cfgchown oracle.root /etc/check_mk/sqlplus.sh /etc/check_mk/mk_oracle.cfg

check mk 監控 oracle

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.