Cloud computing platform (Monitoring)-zabbix Server

Source: Internet
Author: User
I. Prepare the server environment

Zabbix server must run on Linux. centos is used as the deployment environment.

The root user installs the required packages. We recommend that you configure Yum and install the following packages through the yum color TV to solve the dependency between the packages.

Lamp Environment

# Yum-y install mysql-Server httpd PHP

Other packages:

# Yum install mysql-Server

# Yum-YInstall mysql-devel GCC net-snmp-devel curl-devel Perl-dbi php-Gd PHP-mysql PHP-bcmath PHP-mbstring PHP-XML

Download the latest zabbix installation package (Official Website: http://www.zabbix.com) (currently the latest on the official web is 1.9.4) to local, unzip

# Tar zxvf zabbix-1.8.5.tar.gz

Add zabbix users and groups

# Groupadd zabbix

# Useradd-G zabbix-M zabbix

2. Database preparation

Start MySQL database:

# Service mysqld start

Modify the MySQL Root User Password (the default password is blank)

# Mysqladmin-u root-P password Root

Test whether the database can be logged on normally

# Mysql-uroot-proot

Create a zabbix Database

Mysql> Create Database zabbix Character Set utf8;

Import Database SQL scripts

# Cd zabbix-1.8.5

# Mysql-u root-P zabbix <database/MySQL/Schema. SQL

# Mysql-u root-P zabbix <database/MySQL/data. SQL

# Mysql-u root-P zabbix <database/MySQL/images_mysql. SQL

Iii. Compilation and Installation

Configure compilation. prefix is the program directory after installation.

#./Configure -- With-mysql -- With-net-snmp -- With-libcurl -- enable-server -- enable-agent -- enable-proxy -- prefix =/usr/local/zabbix

# Make

# Make install

Iv. configuration file and Web Front-end File Modification

Add a service port as follows:

# Grep zabbix/etc/services

Zabbix-Agent 10050/tcp # zabbix agent

Zabbix-Agent 10050/udp # zabbix agent

Zabbix-Trapper 10051/tcp # zabbix trapper

Zabbix-Trapper 10051/udp # zabbix trapper

Add configuration file

# Mkdir-P/etc/zabbix

# Cp./MISC/CONF/*/etc/zabbix

# Chown-r zabbix: zabbix/etc/zabbix

Modify the server configuration file

You do not need to modify it. Use the default configuration. You only need to modify dbpassword = password.

# Vi/etc/zabbix/zabbix_server.conf

Modify the agentd configuration file and change the host name to the hostname of the local machine.

# Vi/etc/zabbix/zabbix_agentd.conf

Add a Web Front-end PHP File

# Cd frontends/

# Cp-rf php/var/www/html/

# Cd/var/www/html

# Mv PHP zabbix

# Chown-r zabbix: zabbix

V. Web Front-end installation Configuration

Modify PHP Parameters

# Vi/etc/PHP. ini: Find the following items and change them to the following values. There is a; number to be deleted.

Max_execution_time= 300

Max_input_time= 300

Date. timezone = Asia/Shanghai

Post_max_size = 32 m

Memory_limit = 128 m

Mbstring. func_overload = 2

Restart Apache

# Service httpd restart

Access the zabbis serve address in the local browser to start Web Front-end configuration, http: // serverip/zabbix

Step by step as prompted, where step 3 check of pre-requisites must be all items OK before configuration can continue, if any prompt is fail, go to the server and check whether the package is installed or whether the configuration is changed as described above.

Step 4 fill in the user and password for zabbix server to log on to MySQL

Step 7 download the configuration file to/var/www/html/zabbix/conf of the server as prompted. The name must be zabbix. conf. PHP, the permission may be insufficient during modification, chmod 777 zabbix. conf. PHP.

Step 8 access the Web management interface may cause zabbix server no running.

First check getsebool-A | grep httpd, whether httpd_can_network_connect is off. If it is off, you need to change it to on. The modification method is as follows:

/Usr/sbin/setsebool-P httpd_can_network_connect = 1

/Usr/sbin/getsebool-A | grep httpd_can_network_connect

After the modification, refresh the page.

Vi. zabbix Agent installation and deployment

Compared with the installation and configuration on the server, the agent is much more convenient. I have to find a script on the Internet and modify it. Basically, one-click installation is supported. The script is as follows:

CD/tmp

Groupadd zabbix

Useradd-G zabbix

Wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.0.3/zabbix-2.0.3.tar.gz

Tar vxzf zabbix-2.0.3.tar.gz

Rm-F zabbix-2.0.3.tar.gz

CD zabbix-2.0.3

./Configure -- enable-agent

Make install

Zabbix_agentd

Cp misc/init. d/Fedora/CORE/zabbix_agentd/etc/init. d/

Chkconfig zabbix_agentd on

Sed-I "s/hostname = zabbix server/hostname = centos196/"/usr/local/etc/zabbix_agentd.conf

Sed-I "s/Server = 127.0.0.1/Server = 168.160.200.193/"/usr/local/etc/zabbix_agentd.conf

Sed-I "s/# listenport = 10050/listenport = 10050/"/usr/local/etc/zabbix_agentd.conf

Sed-I "s/# listenip = 0.0.0.0/listenip = 168.160.200.196/"/usr/local/etc/zabbix_agentd.conf

/Etc/init. d/zabbix_agentd restart

Note the three marked Methods

Setp1 hostname the hostname here is the same as the hostname in zabbix management.

Setp2 server is the IP address of zabbix server.

Setp3 listenip is the local IP Address

After configuring the zabbix server and client, you can use netstat-an | grep 10050 or 10051 to view port 10051 monitored by the server and port 10050 monitored by the agent respectively.

VII. zabbix Interface Management

Setp1 discovery Configuration

Discovery is used to automatically discover the agent node. After the agent is started, the zabbix management node can use the discovery to define the discovery node.

Configuration-> discovery-> Create discovery rlue

 

Set the attributes such as name, IPaddress, time, and type.

Setp2 create hosts

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.