zabbix通过orabbix监控oracle数据库
十二月 04, 2019
本文记录通过zabbix以及orabbix插件对oracle数据库进行监控。
orabbix简介
orabbix是开源的zabbix监控oracle插件,通过orabbix你可以从任何你想监控的数据库实例中获取数据并在zabbix中展现报表和收集数据,对于每一个发现的麻烦和性能问题都可以设置触发器发送邮件报警。官方网站是http://www.smartmarmot.com/product/orabbix
orabbix架构图

orabbix监控项:
- DBVersion 数据库版本(and relative validity of package)
- Archive 归档文件( archive log production with relative trend)
- EventWaits 等待事件(monitor Files I/O,single block read, multiblock read, direct path read,SQLNet messages, Controlfile I/O,LogWrite)
- HitRatio (monitor Hit Ratio on Trigger, Tables/Procedures, SQLArea,Body)
- Logical I/O 逻辑IO (monitor Logical I/O values of : Current Read, Consistent Read, Block Change)
- PGA
- SGA (in particolar: Fixed Buffer, Java Pool, Large Pool, Log Buffer,Shared Pool,Buffer Cache)
- Physical I/O 物理IO(Redo Writes,Datafiles Writes,Datafiles Read)
- SharedPool (Pool Dictionary Cache, Pool Free Memory, Library Cache,Sql Area ,Misc.)
- Pin Hit Ratio (monitor Hit Ratio on Trigger, Tables/Procedures, SQLArea,Body)
- Session/Processes (monitor Sessions and processes)
- Session (Active Session, Inactive Sessions, System Session)
orabbix监控配置
orabbix部署
基础环境
1 | ubuntu==18.04.1 LTS |
这里zabbix server我是部署在ubuntu系统中,orabbix安装在zabbix server服务器,orabbix是通过JDBC去链接oracle数据库,所以还需要安装jdk环境。
jdk安装
1 | #jdk下载地址https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html |
orabbix安装
1 | #orabbix下载地址http://www.smartmarmot.com/product/orabbix/download/ |
orabbix配置
1 | #修改orabbix配置文件/opt/orabbix/conf/config.props |
被监控数据库端添加用户及授权
1 | CREATE USER ZABBIX IDENTIFIED BY zabbix DEFAULT TABLESPACE SYSTEM TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK; |
orabbix启动及日志查看
1 | #启动命令 |

至此orabbix部署完成。
zabbix配置
导入模板(模板在/opt/orabbix/template/Orabbix_export_full.xml)

添加数据库监控,新建主机,主机名称要和orabbix配置文件相对应

设置模板链接

查看效果图

orabbix自定义监控项
- 在/orabbix/conf/query.props中添加监控项
- QueryList添加key如:QueryList=k1,k2,k3
- 添加key对应的值,实际上是sql语句无需加分号如:k1=sql1
- 在zabbix界面添加监控项常规步骤,键值要对应
查看评论