首页 > 技术文章 > ZABBIX之ORACLE监控

tankt101 2016-06-02 00:06 原文

1,安装JDK

 
2,安装orabbix
wget http://www.smartmarmot.com/downloads/orabbix-1.2.3.zip
mkdir /opt/orabbix
mv orabbix-1.2.3.zip /opt/orabbix
cd /opt/orabbix
unzip orabbix-.1.2.3.zip
 
3, 授权
chmod +x /opt/orabbix/run.sh
chmod +x /opt/orabbix/init.d/orabbix
 
cp /opt/orabbix/conf/config.props.sample config.props
 
4,配置config.props
cat /opt/orabbix/conf/config.props |grep -v "#"            这里仅取没有注释的。
ZabbixServerList=ZabbixServer          #zabbix名称
  
ZabbixServer.Address=192.168.0.119     #zabbix服务端的IP地址
ZabbixServer.Port=10051                #zabbix服务端的端口
  
  
OrabbixDaemon.PidFile=./logs/orabbix.pid
OrabbixDaemon.Sleep=300
OrabbixDaemon.MaxThreadNumber=100
  
DatabaseList=pfs-dev               #这个名称可以随便起,但是必须跟监控的主机名保持一致。
  
DatabaseList.MaxActive=10
DatabaseList.MaxWait=100
DatabaseList.MaxIdle=1
  
twstcptest.com.Url=jdbc:oracle:thin:@192.168.32.48:1521:pfstest  #这里主要是通过JDBC来连接客户端的。rdcms主要是数据库的实例名称。在客户端可以通过select instance_name from v$instance来得到实例的名称。
twstcptest.com.User=zabbix      #数据库用户
twstcptest.com.Password=zabbix  #数据库用户密码
twstcptest.com.MaxActive=10
twstcptest.com.MaxWait=100
twstcptest.com.MaxIdle=1
twstcptest.com.QueryListFile=./conf/query.props
 
5, oracle数据库权限配置
su - oracle       
export ORACLE_SID=pfstest
sqlplus / as sysdba
 
create user zabbix identified by "zabbix" default tablespace system temporary tablespace temp profile default account unlock;
grant alter session to zabbix;
grant create session to zabbix;
grant connect to zabbix;
alter user zabbix default role all;
grant select on v_$instance to zabbix;
grant select on dba_users to zabbix;
grant select on v_$log_history to zabbix;
grant select on v_$parameter to zabbix;
grant select on sys.dba_audit_session to zabbix;
grant select on v_$lock to zabbix;
grant select on dba_registry to zabbix;
grant select on v_$librarycache to zabbix;
grant select on v_$sysstat to zabbix;
grant select on v_$parameter to zabbix;
grant select on v_$latch to zabbix;
grant select on v_$pgastat to zabbix;
grant select on v_$sgastat to zabbix;
grant select on v_$librarycache to zabbix;
grant select on v_$process to zabbix;
grant select on dba_data_files to zabbix;
grant select on dba_temp_files to zabbix;
grant select on dba_free_space to zabbix;
grant select on v_$system_event to zabbix;
 
6, 启动orabbix
/opt/orabbix/run.sh
ps aux|grep orabbix
 

推荐阅读