Install zabbix2.2.3

Source: Internet
Author: User
Tags ldap php mysql snmp import database openldap

System Version: centos 6.3 _ x86_64

Zabbix: zabbix-2.2.3

Zabbix Server IP Address: 172.16.10.72

 

1. Install the lamp environment in yum

# yum -y install gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstringphp-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel OpenIPMI-devel ja va-devel

2. Configure the lamp Environment

Edit the/etc/PHP. ini file and modify the following content:

date.timezone = Asia/Shanghaimax_execution_time = 300post_max_size = 32Mmax_input_time = 300memory_limit = 128Mmbstring.func_overload = 2

Start httpd and mysqld services

# chkconfig mysqld on# chkconfig httpd on # service mysqld start# service httpd start

3. Download and install zabbix Server

Download Page: http://www.zabbix.com/download.php

# wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.3/zabbix-2.2.3.tar.gz

Create zabbix user

# groupadd zabbix# useradd zabbix -g zabbix

Install zabbix

# tar xf zabbix-2.2.3.tar.gz# cd zabbix-2.2.3# ./configure --prefix=/usr --sysconfdir=/etc/zabbix --enable-server --enable-proxy --enable-agent --enable-ipv6 --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl --with-openipmi --with-unixodbc --with-ldap --with-ssh2 --enable-java

The following error is reported:
Checking for SSH2 support... no
Configure: Error: SSH2 library not found

Solution:
Yum-y install libssh2-devel

The preceding error is fixed. Continue./configure and the following error occurs:
Checking for LDAP support... no
Configure: Error: Invalid LDAP directory-unable to find LDAP. h

Solution:
Yum-y install OpenLDAP openldap-devel

# make# make install

4. Add zabbix to the system service file

# Vi/etc/services (in the RHEL/centos series, you do not need to add the following service parameters, which are already available by default) zabbix-Agent 10050/tcp # zabbix agentzabbix-Agent 10050/udp # zabbix agentzabbix-Trapper 10051/tcp # zabbix trapperzabbix-Trapper 10051/udp # zabbix trapper

5. Import zabbix Database

[[email protected] zabbix-2.2.3]# mysqladmin -uroot password ‘abc123,‘ [[email protected] zabbix-2.2.3]# mysqladmin -uroot password ‘abc123,‘   [[email protected] zabbix-2.2.3]# mysql -uroot -pmysql> create database zabbix character set utf8;mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;mysql> flush privileges;

Test whether the connection is normal

[[email protected] zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbixWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql> 

Import database files

[[email protected] zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/schema.sql[[email protected] zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/images.sql[[email protected] zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/data.sql

6. Create the zabbix log directory

# mkdir /var/log/zabbix# chown zabbix.zabbix /var/log/zabbix

7. Set the zabbix Startup Script

[[email protected] zabbix-2.2.3]# cp misc/init.d/fedora/core/zabbix_* /etc/init.d/[[email protected] zabbix-2.2.3]# chmod 755 /etc/init.d/zabbix_*[[email protected] zabbix-2.2.3]# sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/#" /etc/init.d/zabbix_server[[email protected] zabbix-2.2.3]# sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/#" /etc/init.d/zabbix_agentd

8. Edit the/etc/zabbix/zabbix_server.conf file and modify the following parameters:

Logfile =/var/log/zabbix/zabbix_server.logdbhost = localhostdbname = zabbixdbuser = zabbixdbpassword = zabbixdbsocket =/var/lib/MySQL. sockdbport = 3306 startpollers = 160 (test environment default value) starttrappers = 20 (test environment default value) startpingers = 100 (test environment default value) startdiscoverers = 120 (test environment default value) maxhousekeeperdelete = 5000 (test environment default value) cachesize = 1024 M (test environment default value) startdbsyncers = 16 (test environment default value) historycachesize = 1024 M (test environment default value) trendcachesize = 1024 M (test environment default value) historytextcachesize = 512 M (test environment default value) alertscriptspath =/etc/zabbix/alertscriptslogslowqueries = 1000

After the modification is complete, run the following command to view the information:
Grep-EV "(# | ^ $)"/etc/zabbix/zabbix_server.conf

9. Edit the/etc/zabbix/zabbix_agentd.conf file and modify the following parameters:

Logfile =/var/log/zabbix/zabbix_agentd.logenableremotecommands = 0 Server = 127.0.0.1, 172.16.10.72 # zabbix server ipstartagents = 8 serveractive = 172.16.10.72: 10051 hostname = zabbix servertimeout = 30 include =/etc/zabbix/zabbix_agentd.conf.d/unsafeuserparameters = 1

After the modification is complete, run the following command to view the information:
Grep-EV "(# | ^ $)"/etc/zabbix/zabbix_agentd.conf

10. Copy the zabbix webpage file to the Apache directory.

[[email protected] zabbix-2.2.3]# cp -r ./frontends/php/ /var/www/html/zabbix[[email protected] zabbix-2.2.3]# chown -R apache.apache /var/www/html/zabbix

11. Enable the zabbix Service

[Email protected] zabbix-2.2.3] # chkconfig zabbix_server on [[email protected] zabbix-2.2.3] # chkconfig zabbix_agentd on [[email protected] zabbix-2.2.3] # service zabbix_server startstartstarting zabbix_server: [OK] [[email protected] zabbix-2.2.3] # service zabbix_agentd startstarting zabbix_agentd: [OK] # Check whether zabbix service starts [[email protected] zabbix-2.2.3] # netstat-antpl | grep zabbixtcp 0 0 0.0.0.0: 10050 0.0.0.0: * Listen 22542/zabbix_agentd TCP 0 0 0.0.0.0: 10051 0.0.0.0: * Listen 22473/zabbix_server TCP 0: 10050: * Listen 22542/zabbix_agentd TCP 0: 10051: * Listen 22473/zabbix_server

12. Configure zabbix on the web page

# Service iptables stop # temporarily disable Firewall

Open your browser and access: http: // 172.16.10.72/zabbix. The following page appears.

Click Next to go to the next step.

After the web page is configured, the logon page is displayed. The default Logon account of zabbix is admin and the password is zabbix.

After logon, an error is displayed: zabbbix server is not running: the information displayed may not be current.

After investigation, it was found that SELinux had caused the fault

Solution: Disable SELinux.

Setenforce 0

Refresh the page to see if it is normal.

Zabbix 2.2.3 installation ends.

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.