Oracle-based installation Zabbix

Source: Internet
Author: User
Tags create database schema dba install php snmp

Software version

Oracle Enterprise Linux 7.1 64bit

Oracle Enterprise Edition 12.1.0.2 64bit

Zabbix 3.2.1

Ready to work upload software

We choose Zabbix 3.2.1

Decompression path is/u01/stage/zabbix-3.2.1

Prepare the required software to install Oracle 12.1.0.2

Install and create database procedures slightly, the database character set attention must be UTF8 or Al32utf8.

Apache

Zabbix frontend needs Apache, we use OL7.1 's own HTTP service, it should be apache2.4

PHP and other extensions

Specific requirements for the relevant packages, see: Https://www.zabbix.com/documentation/3.2/manual/installation/requirements

Note PHP must be more than 5.4, because the OL7.1 comes with PHP is 5.4, so save the process of PHP installation.

Specifically installed packages:

#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

OCI8 extension

In order to install OCI8, you will need to install the following packages first:

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_64.RPM (not in OS Installation DVD,:

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, this package contains phpize)

OCI8 2.0:

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

PHP 5.4 should be used with the 2.0.X version of Oci8, and the updated version is used in conjunction with PHP 7

# 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

Modify/etc/php.ini

Add a line at the end of the file:

Extension=oci8.so

Add the path where oci8.so is located in/etc/ld.so.conf, for example:

Include ld.so.conf.d/*.conf

/root/oci8-2.0.11/modules

Add the necessary environment variables (do not add export) to the/ETC/SYSCONFIG/HTTPD file:

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

Test

#service httpd Start

Save the following script as ocitest.php, and place it in the/var/www/html directory to ensure executable permissions:

<?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): "&nbsp;"). " </td>\n ";

}

echo "</tr>\n";

}

echo "</table>\n";

?>

Access to http://

Modify other PHP parameters

Modify the following parameters in the/etc/php.ini file:

Post_max_size = 16M

Max_execution_time = 300

Max_input_time = 300

Date.timezone = Asia/shanghai

Create DATABASE schema database user

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.

CREATE TABLE structure

Enter the Database/oracle directory under the Zabbix directory to log in to the database as a Zabbix user, run 3 SQL scripts, and create the table structure and metadata:

[[email protected] oracle]$ ID

uid=500 (Oracle) gid=501 (DBA) groups=501 (DBA)

[Email protected] oracle]$ pwd

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

[Email protected] oracle]$ Sqlplus zabbix/welcome1

Sql*plus:release 12.1.0.2.0 Production on Thu Nov 10 11:20:43 2016

Copyright (c) 1982, 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 needs to be modified, the NVARCHAR2 (2048) is changed to Nvarchar2 (2000), which is the limit of 12c, the maximum can only 2000.

sql> @schema. sql

Images.sql need to modify, the first line of the directory point to the Zabbix extract directory Misc/images directory, I here is/u01/stage/zabbix-3.2.1/misc/images

sql> @images. sql

Insert Meta Data:

sql> @data. sql

Create an OS user

Groupadd Zabbix

Useradd-g Zabbix Zabbix

In order to ensure that the Oracle library file can be referenced normally when running the Zabbix program, you need to set environment variables such as Oracle_home, modify the Zabbix. Bash_profile settings, and add the following lines:

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

Compiling Zabbix to install other dependent packages

Install the following package from the OL7 DVD to ensure that the Zabbix compilation is successful enough.

    • --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)

Compiling the installation

#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

After executing the above command, Zabbix will be installed in the/home/zabbix directory and run the command to start the server and native Agentd:

(To modify the etc/zabbix_server.conf file before starting, modify the Dbname,dbuser,dbpassword several parameters)

$cd

$sbin/zabbix_server

$sbin/zabbix_agentd

Install PHP applications

The installation process is to copy the PHP files to the corresponding directory in Apache HTTP server:

#cd/var/www/html

#mkdir Zabbix

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

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

Configure Zabbix

Open Browser, Access Http://<server_ip_or_name>/zabbix

Make sure all the pre-requisites are OK:

The following will prompt the Pathbreaker configuration file failed, I think because we use the OS comes with the httpd reason, the user running httpd does not have the corresponding directory access, you can follow the prompts to save the configuration file, and manually copied to the specified location.

After the configuration is complete, go directly to the login page. The default user and password are Admin/zabbix

Oracle-based installation Zabbix

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.