Zabbix利用Orabbix监控Oracle(2)

oracle主机上操作(这步可以省略,只要知道数据库实例,账号,密码)
下面是oracle 11g的(12c 语法不一样)授权语句如下,创用户,授权,这些操作,我都是在oracle数据库的sqlplus下执行的

[oracle@oracle ~]$ sqlplus / as sysdba
 
SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 7 18:01:54 2016
 
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
 
Connected to:
 
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
 
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL>
 
CREATE USER ZABBIX IDENTIFIED BY zabbix DEFAULT TABLESPACE SYSTEM TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK;
 
GRANT CONNECT TO ZABBIX;
 
GRANT RESOURCE TO ZABBIX;
 
ALTER USER ZABBIX DEFAULT ROLE ALL;
 
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;
 
GRANT SELECT ON V_$SESSION TO ZABBIX;
 
GRANT SELECT ON V_$SYSTEM_EVENT TO ZABBIX;
 
GRANT SELECT ON V_$EVENT_NAME TO ZABBIX;
 
GRANT SELECT ON V_$RECOVERY_FILE_DEST TO ZABBIX;

启动orabbix

[root@zabbix orabbix]# cp init.d/orabbix /etc/init.d/

[root@zabbix orabbix]# ll /etc/init.d/orabbix

-rwxr-xr-x 1 root root 1693 Sep 14 21:40 /etc/init.d/orabbix

[root@zabbix orabbix]# /etc/init.d/orabbix start

Starting Orabbix service:

报错的话,检查配置文件,数据库地址,端口,实例名,账号,密码是否正确,需要验证对于不懂oracle的怎么办,搜命令呗,我也是一路过来,各种坑~~~~~

然后里面看日志

[root@zabbix orabbix]# tailf /opt/orabbix/logs/orabbix.log

[main] INFO  Orabbix - --------- on Database -> orcl

[pool-1-thread-1] WARN  Orabbix - Error while executing ->dbversion- on database ->172.20.10.183-oracle- Exception received ORA-24247: network access denied by access control list (ACL)

ORA-06512: at "SYS.UTL_INADDR", line 4

ORA-06512: at "SYS.UTL_INADDR", line 35

ORA-06512: at line 1

出现这些日志,不影响后面的操作,如果你是完美主义者,满足你

在oracle数据库的sqlplus下执行下面三条命令

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;

到此,安装配置完成,则通过web页面访问监控界面直接导入模板即可

模版放置在/opt/orabbix/template下
Orabbix_export_full.xml          #只需要导入这个一个模板就好

Zabbix利用Orabbix监控Oracle

添加主机

Zabbix利用Orabbix监控Oracle

然后链接oracle的模板

Zabbix利用Orabbix监控Oracle

添加完成之后的效果

查看最新数据

Zabbix利用Orabbix监控Oracle

这时候图也有了

Zabbix利用Orabbix监控Oracle

常见错误

[root@zabbix orabbix]# tailf /opt/orabbix/logs/orabbix.log

[main] ERROR Orabbix - Error on Configurator for database 172.20.10.183 oracle -->ORA-01017: invalid username/password; logon denied

config.props配置文件中,数据库账号密码不对,或者在oracle数据库没授权这个用户

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/5388f722ed393db257a88b07980fcc6e.html