代码改变世界

zabbix利用orabbix监控oracle

  abce  阅读(1142)  评论(0编辑  收藏  举报

下载、压缩orabbix软件包

# mkdir -p /opt/orabix
# unzip orabbix-1.2.3.zip  -d /opt/orabbix/
# chmod -R a+x /opt/orabbix
# cp conf/config.props.sample conf/config.props
# cp init.d/orabbix /etc/init.d/
# chmod 755 /etc/init.d/orabbix 
# chkconfig orabbix on

编辑orabbix的配置文件

复制代码
# vim conf/config.props
以下为修改的内容:
#comma separed list of Zabbix servers
ZabbixServerList=ZabbixServer
ZabbixServer.Address=192.168.56.180
ZabbixServer.Port=10051
DatabaseList=192.168.56.70   # 名称与该机在 zabbix 中监控的主机名称保持一致
#define here your connection string foreach database
192.168.56.70.Url=jdbc:oracle:thin:@192.168.56.70:1543:sdb # 需要 jdk 环境,因为这里是通过 JDBC 连接的,sdb 为数据库实例名称
192.168.56.70.User=ZABBIX # 用来监控 oracle 数据库的用户名和密码,需要在 oracle 中创建并赋予一定的权限
192.168.56.70.Password=ZABBIX
#Those values are optionals
if notspecified Orabbix is going to use the general values
192.168.56.70.MaxActive=10 192.168.56.70.MaxWait=100 192.168.56.70.MaxIdle=1 192.168.56.70.QueryListFile=./conf/query.props
复制代码

关于 jdbc:

 Oracle        =       jdbc:oracle:thin:@<host>:<LISTENER_PORT>:<instance>
 PostgreSQL    =       jdbc:postgresql://<host>:<port>/<database>
 MS Sql Server =       jdbc:jtds:sqlserver://<host>:<port>/<instancename>
 MySQL Server  =       jdbc:mysql://[host:port],[host:port].../[database]
 DB2           =       jdbc:db2://<servername>:<port>/<installatio

创建数据库表空间

create tablespace zabbix datafile 
  '+data' size 200m autoextend on next 30m maxsize 1g;

创建数据库用户

复制代码
create user zabbix
 identified by zabbix
 default tablespace zabbix
 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;
复制代码

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;

启动Orabbix服务

# /etc/init.d/orabbix start
Starting Orabbix service:

 

现在去zabbix的WEB页面导入ORACLE的监测模板
在orabbix目录的template内,只要在configuration-->host-->Import-->Template,然后选择Orabbix_export_full.xml文件,目录为解压目录下的 orabbix/template/Orabbix_export_full.xml
 
添加oracle主机
在configuration-->Templates-->Hosts中添加Oracle主机,Name要等于在config.props中设的名字,另外,要将此机器加入到Template Oracle中

编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示