Install ZABBIX service with source code

Source: Internet
Author: User

Install ZABBIX service with source code

Before installing the ZABBIX service, we first set up the LAMP environment or LNMP environment. Here, the environment I set up is the LAMP environment. How to set up the LAMP environment is mentioned in my previous articles, check the LAMP environment and install ZABBIX.

Zabbix Service Installation

After the LAMP environment is installed, configure the php. ini file. After LAMP is installed, the Directory of the php. ini file is/usr/local/php/etc/php. ini.
Modify some of the parameters as follows:
Max_execution_time= 300
Memory_limit = 128 M
Post_max_size = 16 M
Upload_max_filesize = 2 M
Max_input_time= 300
Date. timezone = PRC

You must also install the snmp plug-in (to compile zabbix, an error is reported to install the plug-in)
Yum-y install net-snmp-devel

Install zabbix
Download zabbix
All versions: http://www.zabbix.com/download.php
The downloaded version 2.2.2 is uploaded to the root directory through ftp.
Tar-xzvf zabbix-2.2.2.tar.gz
Cd zabbix-2.2.2
../Configure -- prefix =/usr/local/zabbix-2.2.2/-- enable-server \
-- Enable-agent -- with-mysql -- with-net-snmp -- with-libcurl -- with-libxml2

(This error occurs: configure: error: Invalid NET-SNMP directory-unable to find net-snmp-config

When zabbix is compiled and installed, the preceding error is reported, resulting in system environment failure detection. The prompt "unableto find net-snmp-config" indicates that related dependencies are missing.
This is because in linux, most software is open-source and can be used freely. Therefore, when other software packages can be used during development, we can use them directly. We don't need to write them again, which leads to the so-called dependency.
So how can we solve this problem?
Solution 1:
Find out which software package net-snmp-config belongs, and then install it.
Yum search net-snmp-config. It is found that net-snmp-config belongs to the net-snmp-devel software package. yum installs the software package to solve this problem.
Solution 2:
We added the -- with-net-snmp option during configuration, so we need to check whether the software package is supported in the system environment. Therefore, the following error configure: error: Invalid NET-SNMP directory-unable to find net-snmp-config is not reported when the -- with-net-snmp option is not added during configuration .)

(Configure: error: Curl library not found appears.
Use yum-y install * curl * to install the SDK and then recompile it.
)

Make
Make install

Create user
For the sake of security, zabbix only runs as a common user. If your current user is asd, then you run it as an asd. However, if you run zabbix in the root environment, zabbix will take the initiative to run zabbix. However, if your system does not have a user named zabbix, you need to create a user, as shown below:
# Groupadd zabbix
# Useradd-g zabbix

Initialize Database
Zabbix server and proxy require databases, and angent does not. In particular, the proxy only needs to import one SQL file, and the server needs to import three SQL files in total. When I set up a proxy, I imported three SQL statements, resulting in an error. It was later discovered that the proxy only needs to import a table structure.

Assume that you have installed MySQL with the username root and password xxxxxx.
# Mysql-uroot-pxxxxxx
Mysql> create database zabbix default charset utf8;
Mysql> quit;
Run the command in the root directory after zabbix Decompression
# Mysql-uroot-pxxxxxx zabbix <database/mysql/schema. SQL
# Mysql-uroot-pxxxxxx zabbix <database/mysql/images. SQL
# Mysql-uroot-pxxxxxx zabbix <database/mysql/data. SQL

Configure zabbix
Configure the zabbix_server configuration file, under the zabbix source code directory
# Cd/usr/local/zabbix-2.2.2/etc
# Vim zabbix_server.conf
DBName = zabbix
DBUser = root
DBPassword = wdlinux.cn
DBPort = 3306
# Mkdir/etc/zabbix
# Cp zabbix_server.conf/etc/zabbix/

Start zabbix
/Usr/local/zabbix-2.2.2/sbin/zabbix_server
/Usr/local/zabbix-2.2.2/sbin/zabbix_agentd

Set Automatic startup
You can use echo-e "/usr/local/zabbix-2.2.2/sbin/zabbix_server \ n/usr/local/zabbix-2.2.2/sbin/zabbix_agentd">/etc/rc. local

Copy front-end files
# Mkdir/usr/local/apache2/htdocs/zabbix/
# Cp-a/usr/local/src/zabbix-2.2.2/frontends/php/*/usr/local/apache2/htdocs/zabbix/

Start web configuration
Http: // 192.168.1.100/zabbix/

Check all the way and there will be no problem at the end. login account/password: admin/zabbix

Some Zabbix Tutorials:

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy Zabbix in CentOS 6.3

Zabbix distributed monitoring system practice

Under CentOS 6.3, Zabbix monitors apache server-status

Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3

Install Zabbix 2.0.6 in 64-bit CentOS 6.2

ZABBIX details: click here
ZABBIX: click here

This article permanently updates the link address:

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.