zabbix通过pyora监控oracle数据库
如何使用Zabbix进行服务器监控

如何使用Zabbix进行服务器监控服务器是现代网络应用的核心组件,它需要提供稳定、高效、安全的服务。
但是,服务器在运行过程中可能会出现各种问题。
例如,服务器可能会暂停服务,可能会出现磁盘空间不足的情况,可能会出现 CPU 使用率过高的情况等等。
这时,我们需要一种工具来监控服务器的运行情况,以便及时发现并解决问题。
Zabbix就是这样一种工具。
本文将介绍如何使用Zabbix 进行服务器监控。
一、安装 Zabbix安装 Zabbix 的过程有点复杂,这里不再详细说明,读者可以参考 Zabbix 的官方文档进行安装。
在安装完成之后,需要进行以下配置:1. 启动 Zabbix Server 和 Zabbix Agent。
在启动之前,需要检查Zabbix 的配置文件是否正确。
例如,检查 Zabbix Server 是否配置了正确的数据库信息,检查 Zabbix Agent 是否配置了正确的Server。
2. 配置监控主机。
在 Zabbix 中,需要通过监控主机来监控服务器。
每个监控主机都有一个唯一的Hostname。
在配置监控主机时,需要注意:a. 首先,需要在监控主机上安装 Zabbix Agent,并配置Agent 的 Server 变量。
b. 其次,需要在Zabbix Server 上配置监控主机的Hostname。
3. 配置监控项。
监控项是用来监控服务器指标的,例如 CPU使用率、磁盘空间等等。
每个监控项都有一个唯一的名称和一个采集间隔。
在配置监控项时,需要注意:a. 需要选择正确的监控项类型。
例如,CPU 使用率的监控项类型是 "Zabbix Agent (Active)",而磁盘空间的监控项类型是"Zabbix Agent (Passive)"。
b. 需要配置正确的监控项参数。
例如,CPU 使用率的监控项需要设置 CPU 核数,而磁盘空间的监控项需要设置磁盘挂载点。
oracle数据库监控指标

oracle数据库监控指标Oracle数据库监控是确保数据库正常运行和性能优化的重要任务之一。
下面是一些常见的Oracle数据库监控指标:1. CPU利用率,监控数据库服务器的CPU利用率,以确保系统资源足够支持数据库的正常运行。
高CPU利用率可能表示系统负载过重或者存在性能问题。
2. 内存利用率,监控数据库服务器的内存利用率,包括SGA (System Global Area)和PGA(Program Global Area)的利用情况。
内存不足可能导致数据库性能下降或者出现内存溢出错误。
3. 磁盘空间利用率,监控数据库服务器上的磁盘空间利用率,包括数据文件、日志文件和临时文件等。
磁盘空间不足可能导致数据库无法正常写入数据或者执行其他操作。
4. 数据库连接数,监控数据库的并发连接数,以确保数据库能够处理足够的请求。
高连接数可能导致性能下降或者资源竞争。
5. 数据库会话,监控活动会话和等待事件的情况,以及锁定和死锁等问题。
会话的长时间等待可能表示性能问题或者资源争用。
6. 数据库响应时间,监控数据库的响应时间,包括查询响应时间、事务处理时间等。
高响应时间可能表示数据库性能问题或者缓慢的查询语句。
7. 数据库日志,监控数据库的日志文件,包括错误日志、警告日志和审计日志等。
日志中的错误和警告信息可以帮助识别和解决潜在的问题。
8. 数据库备份和恢复,监控数据库的备份和恢复情况,包括备份的完成时间、备份文件的完整性等。
及时的备份和恢复可以保护数据库的数据安全。
9. 数据库性能指标,监控数据库的性能指标,如平均响应时间、平均等待时间、IO吞吐量等。
这些指标可以帮助评估数据库的性能,并进行性能调优。
10. 数据库版本和补丁,监控数据库的版本和已安装的补丁情况,以确保数据库的安全性和稳定性。
及时应用数据库的补丁可以修复已知的安全漏洞和错误。
以上是一些常见的Oracle数据库监控指标,通过监控这些指标可以及时发现和解决数据库的性能问题,确保数据库的正常运行和高效性能。
Zabbix ODBC 监控 Oracle 和 MySQL

Bash# 配置odbcinst.ini 主要是配置安装的ODBC 数据库驱动,如MySQL,oracle, [MySQL] # 驱动名称,在数据库⽂件中需要 Description = ODBC for MySQL Driver = /usr/lib/libmyodbc5.so Setup = /usr/lib/libodbcmyS.so Driver64 = /usr/lib64/libmyodbc5.so Setup64 = /usr/lib64/libodbcmyS.so FileUsage = 112345678配置MySQL ODBC 连接b.修改odbc.ini ⽂件,每次新增加⼀个MySQL 数据库,需要在odbc.ini ⽂件中新增这⼀段内容。
PowerShell# odbc.ini 主要是配置数据源连接信息 [zabbix ] # 数据源名称,在这个⽂件中保持唯⼀ Description = MySQL test database # 数据源描述,⾃定义即可 Driver = MySQL # 对应驱动⽂件odbcinst.ini 中定义的名称 Server = 127.0.0.1 # 数据库服务器地址 User = zabbix # 数据库账号 Password = password # 数据库密码 Port = 3306 # 数据库端⼝ Database = zabbix # 数据库名称123456789数据库连接测试,返回 Connected 标明连接成功PowerShell[root @demo zabbix ]# isql zabbix -v +---------------------------------------+ | Connected! | | | | sql -statement | | help [tablename ] | | quit | | | +---------------------------------------+ SQL> quit12345678910 配置 Oracle ODBC 连接3.安装Oracle 驱动a.在Zabbix Server 上安装,只需要安装⼀次,后续新增数据库不需要再安装CSS# 下载驱动,百度搜索“Oracle Instant Client Downloads ”,在官⽹下载如下两个rpm 包:oracle-instantclient19.13-odbc-19.13.0.0.0-1.x86_64.rpm oracle-instantclient19.13-basic-19.13.0.0.0-1.x86_64.rpm # 安装驱动yum localinstall oracle-instantclient19.13-basic-19.13.0.0.0-1.x86_64.rpm oracle-instantclient19.13-odbc-19.13.0.0.0-1.x86_64.rpm12345在Zabbix Server 上配置,只需要配置⼀次,后续新增数据库不需要再修改修改驱动配置⽂件:/etc/odbcinst.ini :Makefile[root@bsmzabbix tmp]# more /etc/odbcinst.ini # Example driver definitions [Oracle12]Description = Oracle ODBC driver for Oracle 12Driver = /usr/lib/oracle/19.13/client64/lib/libsqora.so.19.1Setup =FileUsage =CPTimeout =CPReuse =123456789配置Oracle ODBC 连接b.在Zabbix Server 上配置,每次新增加⼀个 Oracle 数据库,需要在odbc.ini ⽂件中定义这⼀段内容 修改odbc.ini ⽂件:Makefile[root@bsmzabbix tmp]# more /etc/odbc.ini [ORATEST] # ODBC 数据源名称,整个⽂件中保持唯⼀ Driver = Oracle12 # 驱动名称,对应odbcinst.ini 中定义的名称 Trace = yes TraceFile = /tmp/odbc_oracle.log Database = drpdb # 数据库名称 UserID = system # 数据库⽤⼾名 Password = kboradb2013 # 数据库密码 Port = 1521 # 数据库端⼝ ServerName = 10.10.33.11:1521/drpdb # 数据库连接12345678910 连接测试,如果返回 Connected 表明连接测试成功。
用SiteScope监控Oracle RAC数据库

Configuring SiteScope for Oracle RAC.Prepared by:Anthony LyskiSeptember 09, 2008Oracle RAC:Oracle Real Application Cluster (RAC) is a component of the Oracle database that allows a database to be installed over multiple servers. Companies are beginning to utilize this technology in their production environment due to its administrative advantages. Oracle RAC allows for increased scalability because servers can be added or removed to meet the current needs. If one server fails, the additional servers can absorb the workload. Traditionally to monitor the Oracle Database in SiteScope, a connection would be made to the individual Oracle Database Machine using a JDBC Connection. Since Oracle RAC is installed over multiple severs, you cannot point SiteScope to a singular IP address. This causes many issues when trying to monitor the database.Configuring SiteScope:1. Ensure that the Oracle Client is installed on SiteScope Server. It may requireassistance from the Database Administrators to install the current version of Oracle Client on the SiteScope Server.2. Copy the Oracle driver file classes12.zip from within the Oracle Client folder to<sitescope>\java\lib\ext sub directory. Do not unzip the files.3. After copying the Oracle Client Drivers, stop and restart the SiteScope Service.This is extremely important. If this is not completed first, SiteScope will not recognize the driver.4. In SiteScope, add a new monitor.5. Select Oracle database as the monitor Type.The Oracle Database monitor setup screen in SiteScope should look like this:6. Enter a Name for the monitor.7. Enter the desired Frequency of the Monitor.8. Enter the Database Connect URL in the following format:jdbc:oracle:thin:@<Oracle RAC JDBC Connection String>Use the Oracle RAC JDBC Connection String (which may require assistance from the Oracle Database Administrator).Example:To connect to an Oracle RAC database on two servers named server1 and server 2 using port 1521 you would use a JDBC Database Connection URL string of:jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)( HOST=Server1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=Server2)(PORT= 1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)))9. Enter the Oracle Database Username.10. Enter the Oracle Database Password.11. Add the desired Counters.Possible Errors:HP has compiled a list of the possible errors that you may encounter. These have been provided in this document to assist with common issues that may be encountered:1. "error, connect error, No suitable driver" Check "Database Connection URL" for syntaxerrors such as dots instead of colons.2. "error, connect error, Io exception: TheNetwork Adapter could not establish theconnection" In "Database Connection URL", checkjdbc:oracle:thin:@206.168.191.19:1521:ORCL.3. "error, connect error, Io exception: Invalidconnection string format, a valid format is: "host:port:sid" In "Database Connection URL," checkjdbc:oracle:thin:@206.168.191.19:1521:ORCL.4. "error, connect error, Invalid Oracle URLspecified: OracleDriver.connect" In "Database Connection URL," check for a colon before the "@" -jdbc:oracle:thin:@206.168.191.19:1521:ORCL.5. "Refused:OR=(CODE=12505)(EMFI=4))))" In "Database Connection URL," the databaseSID is probably incorrect (ORCL part). Thiserror can also occur when the TCP address orTCP port is incorrect. If this is the case, verifythe TCP port and check with the databaseadministrator to verify the proper SID.6. "String Index out of range: -1" In "Database Connection URL," check for thedatabase server address, port, and thedatabase SID.7. "Database error 1, connect, ..., Protocolviolation, 0, null" The JDBC driver is incompatible with Oracle Database or is corrupt.8. "error, driver connect error,oracle.jdbc.driver.OracleDriver"Check the syntax in the "Database Driver" field.9. "error, driver connect error,oracle.jdbc.driver.OracleDriver" Verify that the driver is loaded in the correct place.10. "error, connect error, No suitable driver" Check the driver specified in "Database Driver"field; make sure there are no trailing spaces.11. "error, connect error, No suitable driver" Check "Database Connection URL" for syntaxerrors such as dots instead of colons.12. "error, id ORA-00942: table or view doesnot exist" Check "User/Password" and the SID (database) to ensure that appropriate permission and access to the system tables has been granted to see these counters.13. "error,driver connect error,oracle/jdbc/driver/OracleDriver" Check driver specified in field "Database Driver", and make sure there are no trailing spaces.About Loadtester IncorporatedLoadtester is a leading provider of services around application performance testing and creating Performance Centers of Excellence. We teach companies how to engineer performance into the software development lifecycle. As a HP Business Partner with HP Certified Consultants on staff, we have the qualifications to implement HP products into your organization. We are also an authorized HP reseller. Visit to find out more information about our services and offerings.。
使用zabbix监控oracle数据库的方法详解

使⽤zabbix监控oracle数据库的⽅法详解⼀、概述zabbix是⼀款⾮常强⼤,同时也是应⽤最为⼴泛的开源监控软件,本⽂将给⼤家介绍如何利⽤zabbix+python监控oracle数据库。
⼆、环境介绍以下是我安装的环境,实际部署时并不需要跟我的环境⼀样。
1. 监控机 Redhat Linux 6.5 + Zabbix server 3.4.10 + Python2.6.6 (操作系统⾃带) + Oracle Client 11.2 (x86_64)2. 被监控机 Oracle 11.2.0.4三、选择监控⽅式zabbix监控的⽅式主要有以下三种类型Zabbix agent在被监控机上⾯安装zabbix agent,zabbix agent将被监控机采集到的数据发送给zabbix server。
这种⽅式最常⽤,⼀般⽤来采集服务器的cpu、内存等信息。
SNMP⼀些⽹络设备如交换机,上⾯⽆法安装zabbix agent,所以只能通过snmp的⽅式收集监控数据如端⼝状态,流量等。
External check在zabbix server上⾯运⾏查询脚本,直接查询被监控机上的数据。
此种⽅式在被监控机上⾯不需要做任何部署,所有查询全部从zabbix server上⾯发出,所以对zabbix server的性能要求较⾼,官⽅不推荐⼤量使⽤该⽅式。
对于少量的oracle数据库服务器,可以采⽤该⽅式。
本⽂介绍的就是使⽤external check⽅式去监控oracle数据库。
四、规划监控项监控数据库的⽬的是为了保障数据库稳定运⾏,⼀旦出现故障,dba能够及时发现并介⼊处理,监控项分为以下两类1. 数据库空间不⾜或数据库发⽣故障,DBA需要⽴即处理。
监控项包括表空间、⽤户状态、实例状态、锁、⼤量等待事件、闪回区使⽤率等。
此类监控项需要给其设置触发器,⼀旦出现异常,及时告警。
2. 数据库运⾏状态的⼀些统计信息,为DBA定位数据库性能问题发⽣的时间和类别提供参考。
oracle监控方案

电力营销系统oracle监控方案oracle监控也有多种方案,例如通过OEM监控管理本机数据库、GRID CONTROL监控管理同一网络里的数据库、通过SNMP协议监控实时性能信息(HP OPENVIEW)。
但都有其缺点,例如OEM界面只能管理本机、GC和SNMP需要在被管机上安装AGENT代理,它们的操作界面也不直观,配置不够灵活。
而HP OPENVIEW是综合监控软件,其费用过高,也不适合。
综合考虑,决定采用QUEST公司的SPOTLIGHT ON ORACLE软件来监控ORACLE 数据库,其优点是实时准确、界面直观、操作配置简单灵活、性能消耗可以限定在一个小范围内、不需要在被监控设备部署AGENT代理。
且是破解版,没有监控数量上的限制。
其原理是通过设定的频率查询ORACLE内部开放的性能视图,主要是CPU上的性能消耗,需要创建新的DBA角色的用户用于监控,所以可以在限定此用户CPU消耗的限定值内(也可以降低查询频率)使用SPOTLIGHT达到实时监控的目的。
其CPU消耗经QUEST 公司严格测试是比较小的,所以不用担心其CPU消耗给生产带来的影响。
1、监控总图很直观的展示系统整体运行的实时情况,如SESSION、HOST、服务进程、SGA、后台进程、DISK等,哪部分出现问题将会红色闪烁展示,如下图示:2、SESSION监控2.1、TOP SE SSION信息从图中可以看到,SID为1042,用户名为AMBER的SESSION其当前日志读为每秒386.64个块数,排名最前,说明这个SESSION当前运行繁忙,结合下面的信息可以查看到具体正执行的SQL。
2.2、SESSION等待事件从SESSION WAITS中可以查看到当前SESSION正在等待的事件及其详细信息。
2.3、SE SSION正在执行的SQL从SESSION SQL中可以查看到SESSION正在执行的SQL语句以及所有打开未关闭的SQL 信息。
Linux利用Zabbix监控数据库系统的步骤

Linux利用Zabbix监控数据库系统的步骤导读:在Linux系统中Zabbix就是用来进行网络监控和系统监控的工具,但是Zabbix不能直接监控数据库。
如果想要用Zabbix来监控数据库,就要进行相关的设置。
下面就为大家来介绍一下:利用Zabbix监控数据库系统的方法。
说明:如果要使用zabbix监控mysql,默认的模板是无法工作的,因为没有key的存在,所以要自己写脚本、自己定义key。
脚本可以用任意语言实现,但在linux 下还是shell方便。
不像php需要安装php环境,python需要安装python-MySQL 库,perl也是一样。
大概:zabbix监控mysql大概有以下步骤:mysql添加zabbix用户,允许zabbix查看mysql状态zabbix agent添加mysql_status脚本,用于获取mysql status值;zabbix agend添加mysql_status.conf配置文件,定义key值。
配置文件ok后重启zabbix agentd;zabbix server上的web界面添加对应主机mysql模板(自带)具体:1. mysql添加zabbix用户,设置usage权限后zabbix只能查看mysql status 等,无法查看其它库》grant usage on *.* to zabbix@‘zabbix agentd的内网ip’ identified by ‘zabbix’;》flush privileges2. mysql_status脚本# cat /usr/local/zabbix/bin/mysql_status#!/bin/bash#use zabbix to monitor mysql statusmysql=/usr/local/mysql/bin/mysqlvar=$1MYSQL_USER=$2MYSQL_PASSWORD=$3MYSQL_Host=$4[“${MYSQL_USER}” = ‘’ ]&& MYSQL_USER=zabbix #mysql的zabbix用户[“${MYSQL_PASSWORD}” = ‘’ ]&& MYSQL_PASSWORD=zabbix #mysql的zabbix密码[“${MYSQL_Host}” = ‘’ ]&& MYSQL_Host=10.10.10.10 #zabbix agentd的内网ip[“${var}” = ‘’ ]&& echo “”||${mysql} -h${MYSQL_Host} -u${MYSQL_USER} -p${MYSQL_PASSWORD}-e ‘show status’|grep -v Variable_name|grep “\b${var}\b”|awk ‘{print $2}’# chmod +x /usr/local/zabbix/bin/mysql_status3. 查看zabbix agentd客户端的配置,确认是否有开启自定义key、扩展配置目录# egrep -v “(^#|^$)” /etc/zabbix/zabbix_agentd.confLogFile=/tmp/zabbix_agentd.logServer=127.0.0.1,10.10.10.9 #添加本机及zabbix server的ipServerActive=127.0.0.1,10.10.10.9 #添加本机及zabbix server的ipHostname=agent1 #agent名Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/ #扩展配置目录UnsafeUserParameters=1 #允许自定义key4. 自定义key# cat /usr/local/zabbix/zabbix_agentd.conf.d/mysql_status.confUserParameter=mysql.status[*],/usr/local/zabbix/bin/mysql_status $1UserParameter=mysql.ping,/usr/local/mysql/bin/mysqladmin ping -h“mysql IP” -uzabbix-pzabbix|grep alive|wc -lUserParameter=mysql.version,/usr/local/mysql/bin/mysql -h“mysql IP” -uzabbix -pzabbix-e “select version();”|awk ‘END {print}’。
zabbix oracle表空间自动发现规则

Zabbix是一种流行的企业级监控系统,它可以帮助用户实时监视各种IT设备和应用程序的性能,以及系统内部的各种指标。
在使用Zabbix 进行监控的过程中,自动发现规则是一个非常重要的功能,它可以帮助用户自动识别和监控新添加的设备和应用程序,大大减轻了管理员手动添加监控项的工作量。
本文将介绍Zabbix中如何使用自动发现规则来监控Oracle数据库表空间的使用情况。
1. 什么是Oracle表空间Oracle数据库中的表空间是用来存储数据库对象的逻辑容器,它可以包含一个或多个物理数据文件。
表空间是数据库管理员用来管理存储空间的重要工具,它可以帮助管理员对数据库中的数据进行有效的组织和分配存储空间。
2. 为什么需要监控Oracle表空间合理的表空间使用是数据库运行稳定的重要保证,过小的表空间可能导致数据库性能下降,甚至宕机,而过大的表空间则会浪费宝贵的存储资源。
对Oracle数据库的表空间进行实时监控是非常必要的,它可以帮助管理员及时发现并解决存储空间不足的问题,保障数据库的稳定运行。
3. 使用Zabbix自动发现规则监控Oracle表空间在Zabbix中,可以使用自动发现规则来自动识别并监控Oracle数据库中的表空间。
要实现这一功能,需要进行以下步骤:a) 创建自动发现规则进入Zabbix的管理界面,在“配置”-“自动发现”中创建一个新的自动发现规则,设置好规则的名称、条件以及相关参数。
b) 配置发现动作在创建好自动发现规则后,需要创建一个发现动作,用来在发现到新的表空间时自动添加监控项。
c) 设置监控项原型通过自动发现规则,可以在Zabbix中自动创建并管理数据库中所有的表空间监控项原型,这些监控项原型可以根据数据库的实际情况自动添加和删除。
4. 监控Oracle表空间的指标在使用Zabbix监控Oracle表空间的过程中,可以关注一些重要的性能指标,例如表空间使用率、表空间的大小、表空间中数据文件的数量等。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Zabbix 通过pyora监控oracle
1.oracle客户端的安装
从oracle官方网站上下载客户端,devel和sqlplus程序或者从以下网址下载/s/1mgx8Fsk
以root用户安装
rpm –ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
rpm –ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
rpm –ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
vim /root/.bashrc添加
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
export TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
设置好环境变量之后执行
source /root/.bashrc
创建文件/etc/ld.so.conf.d/oracle.conf添加
/usr/lib/oracle/11.2/client64/lib
执行命令ldconfig
创建连接文件
在ORACLE_HOME目录下创建以下目录network/admin,并创建文件tnsnames.ora,内容如下:
vim /usr/lib/oracle/11.2/client64/network/admin/tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
测试
执行
[root@Monitor ~]# sqlplus system/admin@orcl
SQL*Plus: Release 11.2.0.4.0 Production on Thu May 8 14:25:07 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
测试成功!
注:
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
说明环境变量没有生效!
SQL> conn system/oracle@depdb1
ERROR:
ORA-21561: OID generation failed
检查自己的/etc/hosts文件,修改/etc/hosts
127.0.0.1 localhost localhost.localdomain
192.168.0.10 orcl orcl
192.168.0.110 Monitor Monitor
2. python库cx_Oracle的安装
下载/project/cx-oracle/5.1.1/cx_Oracle-5.1.1-1.src.rpm 或者从/s/1gdeLYEJ
[root@devel ~]# rpm -ivh cx_Oracle-5.1.1-1.src.rpm
1:cx_Oracle
########################################### [100%]
[root@devel ~]# cd ~/rpmbuild/SPECS
[root@devel ~]# ORACLE_HOME=/usr/lib/oracle/11.2/client64/ rpmbuild -ba cx_Oracle.spec
[root@devel ~]# cd ../RPMS/x86_64
[root@devel ~]# rpm -ivh cx_Oracle-5.1.1-1.x86_64.rpm
Preparing...
########################################### [100%] 1:cx_Oracle
########################################### [100%]
注:
因为我的系统的python版本是2.6 所以要将Oracle.spec中的python2.4改为python2.6
3.pyora下载安装
利用pyora监控oracle数据库需要用到cx_Oracle和oracle客户端,安装pyora 之前请确保前两个软件安装完毕
下载pyora
[root@Monitor ~]# cd /tmp/
[root@Monitor tmp]#git clone https:///bicofino/Pyora.git
Cloning into 'Pyora'...
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 17 (delta 2), reused 16 (delta 1)
Unpacking objects: 100% (17/17), done.
然后在/etc/zabbix_agentd.conf 中添加
UserParameter=pyora[*],/home/zabbix/scripts/pyora.py --username $1 --password $2 --address $3 --database $4 $5 $6 $7 $8
我是通过zabbix-server端的zabbix-agent监控其他机器的oracle数据库,导入模板zabbix-template/Pyora.xml到你的主机
{$ADDRESS} 192.168.0.1
{$DATABASE} MY_ORACLE_DATABASE
{$USERNAME} zabbix
{$PASSWORD} zabbix
{$ARCHIVE} VGDATA
{$HIGH} 90。