程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> Zabbix監控oracle數據庫

Zabbix監控oracle數據庫

編輯:關於PHP編程

Zabbix監控oracle數據庫



Orabbix描述 Orabbix is a plugin designed to work with Zabbix Enterprise Monitor to provide multi-tiered monitoring, performance and availability reporting and measurement for Oracle Databases, along with server performance metrics.
It provides an effective mechanism to acquire data from numerous Oracle instances, and in turn provides this information for monitoring and performance metrics to your Zabbix server. You can then utilize the reporting capabilities of Zabbix for all data collected, and provide analysis such as graphs and service level agreement metrics for stakeholders.
The current distribution contains a set of pre-defined templates which incorporate alerting and graphing capabilities from initial deployment. However these can be fine tuned to suit your needs and data/monitoring requirements.

Orabbix 為zabbix設計的多層次監控插件,可用來監控Oracle數據庫的性能、可用性,以及服務的運行指標等。 它提供了有效的機制來獲得眾多oracle實例的數據,而後將oracle實例數據和性能指標提供給zabbix服務器。zabbix收集所有數據,提供分析結果,如圖形、服務級別指標,你可以充分利用這些監控信息。 目前的發行版本中,包含了預定義的模板的集合,初始化部署時囊括了告警、圖形功能。這些能夠很好地滿足你的數據/監控需求。
監控對象

Below are some examples of what Orabbix is capable of monitoring:

  • DB Version (i.e. Validity of package)
  • Archiving (Archive log production with trend analysis)
  • Event Waits (Files I/O, single block read, multi-block read, direct path read, SQLNet Messages, Control file I/O, Log Write)
  • Hit Ratio (Hit Ratio on Triggers, Tables/Procedures, SQL Area, Body)
  • Logical I/O (Server performance on Logical I/O of: Current Read, Consistent Read, Block Change)
  • Physical I/O (Redo Writes, Datafile Writes, Datafile Reads)
  • PGA
  • SGA (In particular; Fixed Buffer, Java Pool, Large Pool, Log Buffer, Shared Poolm Buffer Cache)
  • Shared Pool (Pool Dictionary Cache, Pool Free Memory, Library Chache, SQL Area, MISC.)
  • Pin Hit Ratio (Oracle library cache pin are caused by contention with the library cache, the area used to store SQL executables for re-use)
  • Sessions / Processessize of database really used space and of Filesize)
  • Sessions (Active Sessions, Inactive Sessions, System Sessions)
  • DBSize/DBFileSize (DBSize size of database really used space and of Filesize)

Orabbix Architecture


安裝Orabbix服務端 @Zabbix Server 1、配置JAVA

tar zxf jdk-8u51-linux-x64.tar.gz

mv jdk1.8.0_51//usr/local/

export JAVA_HOME=/usr/local/jdk1.8.0_51

exportCLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$JAVA_HOME/bin:$PATH

source/etc/profile



2、下載 https://sourceforge.net/projects/orabbix/
這裡下載的版本是orabbix-1.2.3.zip
3、安裝Orabbix

su - root

# mkdir /opt/orabbix

# cp orabbix-1.2.3.zip /opt/orabbix/

# unzip orabbix-1.2.3.zip

Archive: orabbix-1.2.3.zip

creating: conf/

inflating: conf/config.props.sample

inflating: conf/log4j.properties

inflating: conf/log4j.properties.sample

inflating: conf/query.props

inflating: conf/query.props.sample

inflating: conf/query_a.props

inflating: conf/query_a_1.props

inflating: conf/query_b.props

creating: doc/

inflating: doc/CHANGELOG.txt

inflating: doc/Orabbix_Install_v0.6.pdf

inflating: doc/gpl.txt

creating: init.d/

inflating: init.d/orabbix

inflating: install.cmd

creating: lib/

inflating: lib/commons-codec-1.4.jar

inflating: lib/commons-dbcp-1.4.jar

inflating: lib/commons-lang-2.5.jar

inflating: lib/commons-logging-1.1.1.jar

inflating: lib/commons-pool-1.5.4.jar

inflating: lib/hsqldb.jar

inflating: lib/log4j-1.2.15.jar

inflating: lib/ojdbc6.jar

inflating: orabbix-1.2.3.jar

inflating: orabbix.exe

inflating: orabbixw.exe

inflating: run.bat

inflating: run.sh

creating: template/

inflating: template/Orabbix_export_full.xml

inflating: template/Orabbix_export_graphs.xml

inflating: template/Orabbix_export_items.xml

inflating: template/Orabbix_export_triggers.xml

inflating: uninstall.cmd

inflating: conf/query - Copy.props


# cp ./conf/config.props.sample conf/config.props

# cp init.d/orabbix /etc/init.d/

# chmod 755 /etc/init.d/orabbix

# chkconfig orabbix on




4、配置orabbix,注意紅色部分要匹配。

# vim ./conf/config.props

ZabbixServerList=ZabbixServer

ZabbixServer.Address=10.0.6.102

ZabbixServer.Port=10051

OrabbixDaemon.PidFile=./logs/orabbix.pid

OrabbixDaemon.Sleep=300

OrabbixDaemon.MaxThreadNumber=100

DatabaseList=PROM

DatabaseList.MaxActive=10

DatabaseList.MaxWait=100

DatabaseList.MaxIdle=1

PROM.Url=jdbc:oracle:thin:@10.1.1.84:1521:prom

PROM.User=ZABBIX

PROM.Password=zabbix

PROM.MaxActive=10

PROM.MaxWait=100

PROM.MaxIdle=1

PROM.QueryListFile=./conf/query.props


其中,jdbc連接格式如下 jdbc:oracle:thin:@::


Orabbix客戶端配置 @Oracle DB 1、創建zabbix用戶

- 1 Create User

CREATE USER ZABBIX

IDENTIFIED BY "zabbix"

DEFAULT TABLESPACE SYSTEM

TEMPORARY TABLESPACE TEMP

PROFILE DEFAULT

ACCOUNT UNLOCK;

– 2 Roles for ZABBIX

GRANT CONNECT TO ZABBIX;

GRANT RESOURCE TO ZABBIX;

ALTER USER ZABBIX DEFAULT ROLE ALL;

– 3 System Privileges for ZABBIX

GRANT SELECT ANY TABLE TO ZABBIX;

GRANT CREATE SESSION TO ZABBIX;

GRANT SELECT ANY DICTIONARY TO ZABBIX;

GRANT UNLIMITED TABLESPACE TO ZABBIX;

GRANT SELECT ANY DICTIONARY TO ZABBIX;



2、oracle 11g需要執行如下,添加acl列表

exec dbms_network_acl_admin.create_acl(acl => 'resolve.xml',description => 'resolve acl', principal =>'ZABBIX', is_grant => true, privilege => 'resolve');

exec dbms_network_acl_admin.assign_acl(acl => 'resolve.xml', host =>'*');

commit;



啟動Orabbix,並配置zabbix展示 @Zabbix Server
1、啟動orabbix

# service orabbix start


查看狀態

# service orabbix status


查看日志

# tail -f /opt/orabbix/logs/orabbix.log

2016-07-07 21:01:17,597 [main] INFO Orabbix - maxIdleTime=1800000ms

2016-07-07 21:01:17,597 [main] INFO Orabbix - poolTimeout=100

2016-07-07 21:01:17,597 [main] INFO Orabbix - timeBetweenEvictionRunsMillis=-1

2016-07-07 21:01:17,597 [main] INFO Orabbix - numTestsPerEvictionRun=3

2016-07-07 21:01:18,471 [main] INFO Orabbix - Connected as ZABBIX

2016-07-07 21:01:18,474 [main] INFO Orabbix - --------- on Database -> promotio

2016-07-07 21:01:20,679 [pool-1-thread-1] INFO Orabbix - Done with dbJob on database PROM QueryList elapsed time 2161 ms

2016-07-07 21:02:18,552 [pool-1-thread-2] INFO Orabbix - Done with dbJob on database PROM QueryList elapsed time 11 ms

2016-07-07 21:03:20,413 [pool-1-thread-3] INFO Orabbix - Done with dbJob on database PROM QueryList elapsed time 1849 ms


2、zabbix中添加監控主機
導入orabbix模板Orabbix_export_full





添加主機

注意,Host name一定要和orabbix配置文件中的DatabaseList相同。


為Host添加模板,模板名字為Template_Oracle。


而後將監控圖形加到Screens中



轉載請注明:
十字螺絲釘
http://blog.chinaunix.net/uid/23284114.html
QQ:463725310
E-MAIL:houora#gmail.com(#請自行替換為@)


  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved