据悉Oracle安装Zabbix

安装Oracle 12.1.0.2

安装和创办数据库进程略,数据库字符集注意早晚若是UTF八或AL3二UTF八。

编译Zabbix

创办表结构

进去zabbix解压缩目录下的database/oracle目录,以zabbix用户身份登录数据库,运转贰个sql脚本,创设表结构及元数据:

[oracle@rhelvm1 oracle]$ id

uid=500(oracle) gid=501(dba) groups=501(dba)

[oracle@rhelvm1 oracle]$ pwd

/u01/stage/zabbix-3.2.1/database/oracle

[oracle@rhelvm1 oracle]$ sqlplus zabbix/welcome1

SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 10 11:20:43 2016

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Last Successful login time: Thu Nov 10 2016 11:19:12 -08:00

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit
Production

With the Partitioning, OLAP, Advanced Analytics and Real Application
Testing options

SQL>

schema.sql供给修改,将里面nvarchar二(204捌)都改成nvarchar贰(3000),那是12c的限量,最大只好2000了。

SQL>@schema.sql

images.sql须要修改,第三行的目录指向zabbix解压目录下的misc/images目录,小编那里是/u01/stage/zabbix-3.二.1/misc/images

SQL>@images.sql

插入元数据:

SQL>@data.sql

 

安装PHP应用

设置进度正是将PHP文件复制到apache http server对应的目录中:

#cd /var/www/html

#mkdir zabbix

# cd /u01/stage/zabbix-3.2.1/frontends/php

# cp -a . /var/www/html/zabbix

创办数据库schema
编写翻译安装

#su – zabbix

$cd /u01/stage/zabbix-

$./configure –prefix=/home/zabbix –enable-server –enable-agent
–with-oracle=/u01/app/oracle/product/12.1.0/dbhome_1 –with-net-snmp
–with-libcurl –with-libxml2 –with-ssh2

$make install

进行上述命令后,Zabbix会棉被服装置在/home/zabbix目录下,运转命令运营server和本机agentd:

(在起步此前要修改etc/zabbix_server.conf文件,修改dbname,dbuser,dbpassword多少个参数)

$cd

$sbin/zabbix_server

$sbin/zabbix_agentd

设置任何正视包

从OL7的mp四中设置下列包,保险zabbix的编写翻译能过够成功。

  • –with-net-snmp

#rpm -Uvh net-snmp-devel-5.7.2-20.el7.x86_64.rpm
elfutils-devel-0.160-1.el7.x86_64.rpm
elfutils-libelf-devel-0.160-1.el7.x86_64.rpm
lm_sensors-devel-3.3.4-11.el7.x86_64.rpm
net-snmp-agent-libs-5.7.2-20.el7.x86_64.rpm
openssl-devel-1.0.1e-42.el7.x86_64.rpm
perl-devel-5.16.3-285.el7.x86_64.rpm
rpm-devel-4.11.1-25.el7.x86_64.rpm
tcp_wrappers-devel-7.6-77.el7.x86_64.rpm
krb5-devel-1.12.2-14.el7.x86_64.rpm gdbm-devel-1.10-8.el7.x86_64.rpm
libdb-devel-5.3.21-17.el7_0.1.x86_64.rpm
systemtap-sdt-devel-2.6-8.0.1.el7.x86_64.rpm
popt-devel-1.13-16.el7.x86_64.rpm
libselinux-devel-2.2.2-6.el7.x86_64.rpm
libverto-devel-0.2.5-4.el7.x86_64.rpm pyparsing-1.5.6-9.el7.noarch.rpm
libcom_err-devel-1.42.9-7.el7.x86_64.rpm
keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm
libsepol-devel-2.1.9-3.el7.x86_64.rpm
perl-ExtUtils-Install-1.58-285.el7.noarch.rpm
perl-ExtUtils-MakeMaker-6.68-3.el7.noarch.rpm
perl-ExtUtils-ParseXS-3.18-2.el7.noarch.rpm
perl-ExtUtils-Manifest-1.61-244.el7.noarch.rpm

  • –with-libxml2

#rpm -Uvh libxml2-devel-2.9.1-5.0.1.el7_0.1.x86_64.rpm

  • –with-libcurl

#rpm -Uvh libcurl-devel-7.29.0-19.el7.x86_64.rpm

  • –with-libssh2

#rpm -Uvh libssh2-devel-1.4.3-8.el7.x86_64.rpm

ftp://bo.mirror.garr.it/1/slc/centos/7.1.1503/os/x86_64/Packages/libssh2-devel-1.4.3-8.el7.x86_64.rpm

创建OS用户

groupadd zabbix

useradd -g zabbix zabbix

为了确定保障运营zabbix程序时能够正常引用Oracle库文件,供给设置ORACLE_HOME等环境变量,修改zabbix的.bash_profile设置,添加以下行:

ORACLE_BASE=/u01/app/oracle

export ORACLE_BASE

ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1

export ORACLE_HOME

ORACLE_SID=orcl

export ORACLE_SID

PATH=$ORACLE_HOME/bin:$PATH

export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH

配置Zabbix

开拓浏览器,访问http://<server\_ip\_or\_name>/zabbix

图片 1

管教全部pre-requisites都是OK的:

图片 2

图片 3

图片 4

末端会提示闯将陈设文件失败,小编想是因为大家利用OS自带的HTTPD的原委,运营httpd的用户并未有相应的目录访问权限,能够遵照提示将配备文件另存,并手工业复制到钦赐地点。

安排实现后直接转入登录页面。缺省用户和口令是Admin/zabbix

图片 5

曲突徙薪干活

PHP 及别的扩大

的相关包的有血有肉须求,参见:https://www.zabbix.com/documentation/3.2/manual/installation/requirements

只顾PHP一定要5.四以上的,因为OL⑦.一自带的PHP已经是5.四了,所以省去了PHP安装的历程。

实际安装的软件包:

#rpm -Uvh php-5.4.16-23.el7_0.3.x86_64.rpm
php-cli-5.4.16-23.el7_0.3.x86_64.rpm
php-common-5.4.16-23.el7_0.3.x86_64.rpm
libzip-0.10.1-8.el7.x86_64.rpm

#rpm -Uvh php-gd-5.4.16-23.el7_0.3.x86_64.rpm
t1lib-5.1.2-14.el7.x86_64.rpm

#rpm -Uvh libxml2-2.9.1-5.0.1.el7_0.1.x86_64.rpm

#rpm –Uvh libxml2-devel-2.9.1-5.0.1.el7_0.1.x86_64.rpm
xz-devel-5.1.2-9alpha.el7.x86_64.rpm
zlib-devel-1.2.7-13.el7.x86_64.rpm

#rpm -Uvh php-xml-5.4.16-23.el7_0.3.x86_64.rpm

#rpm -Uvh php-xmlrpc-5.4.16-23.el7_0.3.x86_64.rpm

(ftp://bo.mirror.garr.it/1/slc/centos/7.0.1406/updates/x86_64/Packages/php-mbstring-5.4.16-23.el7_0.3.x86_64.rpm)

# rpm -Uvh php-mbstring-5.4.16-23.el7_0.3.x86_64.rpm

(ftp://bo.mirror.garr.it/1/slc/centos/7.0.1406/updates/x86_64/Packages/php-bcmath-5.4.16-23.el7_0.3.x86_64.rpm)

# rpm -Uvh php-bcmath-5.4.16-23.el7_0.3.x86_64.rpm

桑土绸缪必要的软件
修改别的PHP参数

修改/etc/php.ini文件中的下列参数:

post_max_size = 16M

max_execution_time = 300

max_input_time = 300

date.timezone = Asia/Shanghai

测试

#service httpd start

将下列脚本存成ocitest.php,放在/var/www/html 目录下,保险可实施权限:

<?php

error_reporting(E_ALL);

ini_set(‘display_errors’, ‘On’);

$conn = oci_connect(‘system’, ‘welcome’, ‘localhost/orcl’);

$stid = oci_parse($conn, ‘select table_name from user_tables’);

oci_execute($stid);

echo “<table>\n”;

while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS))
!= false) {

echo “<tr>\n”;

foreach ($row as $item) {

echo ” <td>”.($item !== null ? htmlspecialchars($item,
ENT_QUOTES) : ” “).”</td>\n”;

}

echo “</tr>\n”;

}

echo “</table>\n”;

?>

访问http://&lt;hostname&gt;:&lt;port&gt;/ocitest.php,正常应该在页面上返回system用户的所有表。

Apache

Zabbix的frontend供给apache
,我们选择OL七.1自带的http服务,应该是apache二.四

建数据库用户

SQL> create tablespace zabbix datafile
‘/u01/app/oracle/oradata/orcl/zabbix01.dbf’ size 500M;

Tablespace created.

SQL> create user zabbix identified by welcome1 default tablespace
zabbix;

User created.

SQL> grant connect,resource,unlimited tablespace to zabbix;

Grant succeeded.

SQL> grant create any directory to zabbix;

Grant succeeded.

SQL> grant drop any directory to zabbix;

Grant succeeded.

上传软件

我们选取Zabbix 3.2.1

解压路径为/u01/stage/zabbix-叁.二.1

OCI8扩展

为了安装OCI8,还须要先安装下列包:

autoconf-2.69-11.el7.noarch.rpm

automake-1.13.4-3.el7.noarch.rpm

pcre-devel-8.32-14.el7.x86_64.rpm

php-devel-5.4.16-23.el7_0.3.x86_6四.rpm (OS安装mp3中从未,下载地址:

http://rpm.pbone.net/index.php3/stat/4/idpl/27829696/dir/centos_7/com/php-devel-5.4.16-23.el7_0.3.x86_64.rpm.html,这几个单肩包含phpize)

OCI八 2.0 下载地址:

http://pecl.php.net/package/oci8

PHP 5.四 应该用二.0.X版本的oci八,更新版本是和PHP 七 搭配使用的

# tar -xzf oci8-2.0.11.tgz

# cd oci8-2.0.11

# phpize

# ./configure –with-oci8=/u01/app/oracle/product/12.1.0/dbhome_1

# make install

修改/etc/php.ini

在文书最终添加一行:

extension=oci8.so

在/etc/ld.so.conf中添加oci八.so所在的途径,例如:

include ld.so.conf.d/*.conf

/root/oci8-2.0.11/modules

在/etc/sysconfig/httpd文件中添加必要的环境变量(不要加export):

ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

NLS_LANG=AMERICAN_AMERICA.AL32UTF8

软件版本

Oracle Enterprise Linux 7.1 64bit

Oracle Enterprise Edition 12.1.0.2 64bit

Zabbix 3.2.1

相关文章