Orabbix插件的安装与配置
2012-04-17 14:31
357 查看
1. Orabbix插件的安装与配置
1.1 Orabbix介绍
Orabbix 是一个用来监控 Oracle 数据库实例的 Zabbix 插件。1.2 Orabbix插件的下载
http://www.smartmarmot.com/product/orabbix/download/1.3 Orabbix插件的安装与配置
1) 先通过yum来安装JAVA:yuminstall java;
2) 在/opt目录下新建一个orabbix目录:/opt/orabbix
3) 将下载好的Orabbix插件解压后上传至Zabbix
Server的/opt/orabbix目录:
4) 上传完成后,给orabbix目录中的所有文件设定权限:[root@zabbix
opt]# chmod -R a+x orabbix/
5) 通过/opt/orabbix/conf/config.props.sample文件创建一个config.props文件:
[root@zabbix opt]#cp/opt/orabbix/conf/config.props.sample /opt/orabbix/conf/config.props
6) 编辑刚刚生成的config.props文件:
ZabbixServerList=zabbix
ZabbixServer1.Address=192.168.1.50
ZabbixServer1.Port=10051
7) 将orabbix中的执行文件Copy到系统服务目录中:
[root@zabbix ~]#
cp /opt/orabbix/init.d/orabbix/etc/init.d/orabbix
8) 编辑orabbix配置文件,把不需要的行用“#”号来注释掉:
[root@zabbix conf]#vi config.props
#comma separed list of Zabbix servers
ZabbixServerList=ZabbixServer1
注:以上等号后的名字必须与下行中等号前名字保持一样。
ZabbixServer1.Address=192.168.1.50
ZabbixServer1.Port=10051
注:以上端口号为与Zabbix Server通讯的端口,我这里是将Orabbix与Zabbix装在同一台机器上的,如果不在同一台机器,那装Orabbix的机器需要先装Zabbix
Agent,否则数据将无法传送到Zabbix Server。
#ZabbixServer2.Address=IP_ADDRESS_OF_ZABBIX_SERVER
#ZabbixServer2.Port=PORT_OF_ZABBIX_SERVER
注:以上本来行首是没有#号的,但我们这里没有第二个Zabbix
Server,所以这里将它注销了。
#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=ASM-ORCL
注:
1. 以上等号后的名字可以自己任意取名,但在Zabbix中添加Oracle
Host时,必须用你在此设定的名字,否则无法监测。
2. 以上等号后面的值修改后,在下面的数据库连接定义=处,也需要修改相应的名字;
3. 这里建议使用Server Name-DBSID的方式来命名。
#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
ASM-ORCL.Url=jdbc:oracle:thin:@192.168.153.123:1521:ORCL
注:
1. 以上行开始的那个值,需要与之前DatabaseList后面的值保持一样。
2. 192.168.153.123为Oracle服务器的地址,1521为TNS
Port,ORCL为DB SID。
ASM-ORCL.User=system
ASM-ORCL.Password=oracle
注:以上为访问数据库的用户名和密码,因为我这里是测试环境,所以为了图方便,使用了SYSTEM帐号,建议在生产环境中为orabbix新建一个帐号,可以参考官方的文档,地址如下:
http://www.smartmarmot.com/wiki/index.php/Orabbix
我这里跟据官网列出了我测试环境中添加的帐号,如下:
CREATE USER ZABBIX
IDENTIFIEDBY
zabbix <Password>
DEFAULTTABLESPACE SYSTEM
TEMPORARYTABLESPACE TEMP
PROFILEDEFAULT
ACCOUNTUNLOCK;
GRANT CONNECT TO ZABBIX;
GRANTRESOURCE TO ZABBIX;
ALTERUSER ZABBIX DEFAULT ROLE ALL;
GRANT SELECT ANY TABLE TO ZABBIX;
GRANT CREATE SESSION TO ZABBIX;
GRANTSELECT ANY DICTIONARY TO ZABBIX;
GRANTUNLIMITED TABLESPACE TO ZABBIX;
GRANTSELECT ANY DICTIONARY TO ZABBIX;。
因为我使用的是Oracle 11g,所以还需要添加以下命令:
execdbms_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;
#Those values are optionals if not specified Orabbix is going to use thegeneral values.
ASM-ORCL.MaxActive=10
ASM-ORCL.MaxWait=100
ASM-ORCL.MaxIdle=1
ASM-ORCL.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
9) 保存以上配置后,使用/etc/init.d/orabbix start来启动Orabbix服务
注意:如果以上的config.props文件没有配置,或是配置了,但无法通过配置的信息正确连进Oracle数据库的话,执行以上命令,可是run.sh会出现如下的错误提示:
[root@zabbix orabbix]# /etc/init.d/orabbix start
cat: /opt/orabbix/conf/config.props: No such file ordirectory
Starting Orabbix service:
[root@zabbix orabbix]# Stopping
java.lang.Exception: ERROR on main - Connections is empty
atcom.smartmarmot.orabbix.Orabbixmon.run(Orabbixmon.java:101)
atcom.smartmarmot.orabbix.bootstrap.main(bootstrap.java:50)
[root@zabbix orabbix]# ./run.sh
[root@zabbix orabbix]# Stopping
java.lang.Exception: ERROR on main - Connections is empty
atcom.smartmarmot.orabbix.Orabbixmon.run(Orabbixmon.java:101)
at com.smartmarmot.orabbix.bootstrap.main(bootstrap.java:50)。
10) 将Orabbix服务加入随系统启动:
chkconfig --add orabbix
chkconfig --level 345orabbix on
11) OK,按以上的步骤,这样的话,Orabbix服务器端就配置完成啦~~现在去zabbix的WEB页面去导入ORACLE的监测模板吧,在orabbix目录的template内,只要在configurationàTemplatesàImport
Template,然后选中orabbix/template/Orabbix_export_full.xml就OK啦~~
12) 在configurationàTemplatesàHosts中添加Oracle主机吧!记得Name要等于你在config.props中设的名字哦,另外,要将此机器加入到Template
Oracle中,这样就OK啦~~如下图:
13) 接下来,去MonitoringàGraphs和Latest
data中去看你的Oracle监测数据吧~~
相关文章推荐
- Orabbix插件的安装与配置
- eclipse maven 插件的安装和配置
- Eclipse安装Gradle插件及配置
- vim配置及插件安装管理(超级详细)
- Eclipse插件的安装与配置
- 百度编辑器的YII插件的安装配置
- eclipse maven 插件安装配置
- Mac配置Maven & Eclipse安装M2eclipse插件
- cacti安装插件weathermap无法添加配置文件
- eclipse maven plugin 插件 安装 和 配置
- Sublime插件安装与配置
- Ubuntu16.04下安装sublime text3并配置anaconda插件
- WIN7下vim安装配置整理(插件齐全)
- eclipse maven plugin 插件 安装 和 配置
- gvim配置及相关插件安装(过程详细,附图)
- hadoop —— eclipse插件安装配置
- Eclipse开发环境配置,打磨Eclipse,安装插件(适用3.4,3.5,3.6,3.7)
- 针对Java开发环境的VIM 配置 ---安装 javacomplete插件
- [IDE工具配置]myeclipse 2014 专业版 安装 svn插件
- Mac Sublime Text 3 配置Python环境及安装插件