Zabbix source code compilation and Installation

Source: Internet
Author: User

Zabbix source code compilation and Installation

Introduction:

Zabbix distributed monitoring system, source code compilation and installation records (not to mention the number of times)

: Http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.5/zabbix-2.4.5.tar.gz

LNMP Portal:

1. Install Zabbix

Shell> yum-y install ntpdate net-snmp-devel libcurl-devel

Shell> useradd-r-s/sbin/nologin zabbix
Shell> wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.5/zabbix-2.4.5.tar.gz
Shell> tar zxf zabbix-2.4.5.tar.gz
Shell>./configure -- prefix =/usr/local/zabbix -- enable-server -- enable-agent -- with-mysql -- with-net-snmp -- with-libcurl

# -- Prefix specifies the installation path
# -- Enable-server install Server
# -- Enable-agent install the Agent
# -- With-use mysql database
# -- With-net-snmp supports the SNMP protocol
# -- With-libcurl supports libcurl URL monitoring

Shell> make install

2. Create a database and import data

 

Shell> mysql-uroot-p123456

Mysql> create database zabbixDB character set utf8; # create zabbixDB and set the encoding to utf8

Mysql> grant all on zabbixDB. * to zabbix @ localhost identified by 'zabbix _ pass'; # create an authorized user

Mysql> flush privileges; # refresh the authorization table (although the grant operation does not need to refresh the authorization table, what should I do? )

Mysql> use zabbixDB;

Mysql> source/usr/local/src/zabbix-2.4.5/database/mysql/schema. SQL # import data
Mysql> source/usr/local/src/zabbix-2.4.5/database/mysql/images. SQL
Mysql> source/usr/local/src/zabbix-2.4.5/database/mysql/data. SQL

Mysql> quit

 

3. Configure the Zabbix Service

 

Shell> cp/usr/local/src/zabbix-2.4.5/misc/init. d/Fedora/core/zabbix_server/etc/init. d/# server startup script
Shell> cp/usr/local/src/zabbix-2.4.5/misc/init. d/fedora/core/zabbix_agentd/etc/init. d/# client Startup Script
Shell> cp-R/usr/local/src/zabbix-2.4.5/frontends/php // usr/local/nginx/html/zabbix # Web file

Shell> vim/usr/local/zabbix/etc/zabbix_server.conf # server configuration file

LogFile =/tmp/zabbix_server.log # log file storage location
DBName = zabbixDB # Database Name
DBUser = zabbix # connect to the user
DBPassword = zabbix_pass # connection password

Shell> vim/etc/init. d/zabbix_server # server startup script

BASEDIR =/usr/local/zabbix # modified position (Original:/usr/local)

Shell> vim/etc/init. d/zabbix_agentd # client Startup Script

BASEDIR =/usr/local/zabbix # modified position (Original:/usr/local)

 

4. Start the Zabbix Service

 

Shell> chkconfig -- add zabbix_server
Shell> chkconfig -- add zabbix_agentd

Shell> chkconfig -- level 35 zabbix_server on
Shell> chkconfig -- level 35 zabbix_agentd on

Shell> service zabbix_server start
Starting zabbix_server: [OK]
Shell> service zabbix_agentd start
Starting zabbix_agentd: [OK]

Shell> netstat-anpt | grep zabbix (Note: Check whether the database is successfully started because zabbix_server cannot be started when the authorized user cannot connect to the database, however, the startup process is displayed as successful)
Tcp 0 0 0.0.0.0: 10050 0.0.0.0: * LISTEN 80403/zabbix_agentd
Tcp 0 0 0.0.0.0: 10051 0.0.0.0: * LISTEN 80430/zabbix_server

 

# When a service is not started, check the log file in time for detailed reasons.

# The following error may occur:

Starting zabbix_server:/usr/local/zabbix/sbin/zabbix_server: error while loading shared libraries: libmysqlclient. so.18: cannot open shared object file: No such file or directory [FAILED]

# Solution: ln-s/usr/local/mysql/lib/libmysqlclient. so.18/usr/lib64/(first find the location of the file)

5. log onto the webpage and configure Zabbix (http: // your-domain/zabbix)

# Don't post anything that doesn't matter, just paste useful!

> The first page is the welcome page.

> Most of the second page has multiple failures, which is also the most problematic location, such

Solution:

 

Shell> vim/usr/local/php. ini

Post_max_size = 16 M
Max_execution_time= 300
Max_input_time= 300
Date. timezone = Asia/Shanghai
Always_populate_raw_post_data =-1

# Find the corresponding parameter, change it to the above value, and restart Nginx and php-fpm to solve the problem!

 

# There may also be a lack of extensions. We will separately demonstrate a solution for lack of extensions.

If the message "gettext" is in the red fail status, this indicates that the extension is missing and needs to be added dynamically!

Shell> cd/usr/local/src/php-5.6.11/ext/gettext/# Switch to the corresponding extension directory under the source directory
Shell>/usr/local/php/bin/phpize # Run this command to generate configure
Shell>./configure -- with-php-config =/usr/local/php/bin/php-config; make install # install this extension to generate the. so file

# If mysqli extension is missing, add a parameter -- with-mysqli =/usr/local/mysql/bin/mysql_config.

Shell> ln-s/usr/local/php/lib/php/extensions/no-debug-20100525/gettext. so/usr/lib64/

Shell> vim/usr/local/php. ini

Extension_dir =/usr/lib64/
Extension = gettext. so

# Find the corresponding parameter and add or modify it to the above value.

After all solutions are completed (no red Fail is displayed on the page, and all changes to OK) Click Next

> On the third page, set the database connection information. Enter the information normally and click "Test connection" to display OK. Next

> The fourth page contains information about Zabbix Server. The default page is "Next ".

> The fifth page is preview. If there is no problem, Next

> Errors occur on the sixth page. You need to download the configuration file to your local device, then, use WinSCP or some method to upload/usr/local/nginx/html/Zabbix/conf/of zabbix Server! (Maybe you are different from me, but you can follow the prompts)

> The login page is finally reached. Default User name: admin Password: zabbix

# All Zabbix installation procedures have been completed here!

Additional: (To put it simply, monitor the local machine)

1. Modify the Zabbix Agent configuration file on Zabbix Server (in fact, you do not need to modify it. Here, I just want to take a look at it)

Shell> vim/usr/local/zabbix/etc/zabbix_agentd.conf # Note: zabbix_agentd.conf is not zabbix_agent.conf

LogFile =/tmp/zabbix_agentd.log # Zabbix Agent log file
Server = 127.0.0.1 # Passive Mode
ServerActive = 127.0.0.1 # Active Mode
Hostname = Zabbix server # custom (this is another critical point. When adding a host to Zabbix Server, the Hostname value must be the same as the one defined here, otherwise it cannot be monitored)

# The active and passive modes here refer to Zabbix Agent. The default mode is passive! (The Passive mode is Zabbix Agent, and the passive mode is Zabbix Agent. The active mode is Zabbix Agent, which actively connects to Zabbix Server)

2. Change the Staus of Configuration-> Host in Zabbix Server to Enable monitoring of the local machine!

Some Zabbix Tutorials:

Compile and install Zabbix2.4.5 source code in Ubuntu 14.04

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.