zabbix 監控windows下Oracle


zabbix 監控windows下Oracle

  1. 創建用戶

    運行以下腳本,創建一個用戶,讓orabbix來連接數據庫

    CREATE USER ZABBIX
    IDENTIFIED BY <REPLACE WITH PASSWORD>
    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;
    – 5 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;

    如果是oracle 11g的話,還需要運行下面的語句:

     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;
  2. 安裝orabbix

    zabbix 監控Oracle是使用一個插件orabbix,首先下載orabbix,並且解壓到一個文件夾。首先打開conf中的conf.props,做如下修改


    #comma separed list of Zabbix servers

    ZabbixServerList=ZabbixServer1

    ZabbixServer1.Address=120.26.36.24
    ZabbixServer1.Port=10051




    #pidFile

    OrabbixDaemon.PidFile=./logs/orabbix.pid

    #frequency of item's refresh

    OrabbixDaemon.Sleep=300

    #MaxThreadNumber should be >= than the number of your databases

    OrabbixDaemon.MaxThreadNumber=100


    #put here your databases in a comma separated list

    DatabaseList=oracle1


    #Configuration of Connection pool


    #if not specified Orabbis is going to use default values (hardcoded)


    #Maximum number of active connection inside pool

    DatabaseList.MaxActive=10

    #The maximum number of milliseconds that the pool will wait


    #(when there are no available connections) for a connection to be returned


    #before throwing an exception, or <= 0 to wait indefinitely.

    DatabaseList.MaxWait=100
    DatabaseList.MaxIdle=1


    #define here your connection string for each database

    oracle1.Url=jdbc:oracle:thin:@127.0.0.1:1521:ORCL
    oracle1.User=zabbix
    oracle1.Password=zabbix

    #Those values are optionals if not specified Orabbix is going to use the general values

    oracle1.MaxActive=10
    oracle1.MaxWait=100
    oracle1.MaxIdle=1
    oracle1.QueryListFile=./conf/query.props


    #DB2.Url=jdbc:oracle:thin:@server2.domain.example.com:<LISTENER_PORT>:DB2


    #DB2.User=zabbix


    #DB2.Password=zabbix_password


    #DB2.QueryListFile=./conf/query.props



    #DB3.Url=jdbc:oracle:thin:@server3.domain.example.com:<LISTENER_PORT>:DB3


    #DB3.User=zabbix


    #DB3.Password=zabbix_password


    #DB3.QueryListFile=./conf/query.props
    • ZabbixServerList代表服務列表,一般我們就設置一個

    • ZabbixServer1.Address=服務的ip,前綴一定要和ZabbixServerList中的一樣

    • ZabbixServer1.Port=服務的端口,前綴一定要和ZabbixServerList中的一樣
    • oracle1.Url=數據庫的連接信息
    • oracle1.User=數據庫用戶名
    • oracle1.Password=數據庫密碼
  3. 運行run.bat,啟動orabbix,沒有打印東西,說明啟動成功。
  4. 導入模板

    導入以下模板:
    “`


注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2021 ITdaan.com