Zabbix source code compilation and installation, and zabbix source code compilation

Source: Internet
Author: User

Zabbix source code compilation and installation, and zabbix source code compilation


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 transfer door: http://www.cnblogs.com/wangxiaoqiangs/p/5336180.html

1. Install Zabbix

shell > yum -y install ntpdate net-snmp net-snmp-devel libcurl-develshell > useradd -r -s /sbin/nologin zabbixshell > wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.5/zabbix-2.4.5.tar.gzshell > tar zxf zabbix-2.4.5.tar.gzshell > ./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-p123456mysql> create database zabbixDB character set utf8; # create zabbixDB and set the encoding to utf8mysql> 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, but what then? ) 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. sqlmysql> source/usr/local/src/zabbix-2.4.5/database/mysql/data. sqlmysql> 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/logs # log file storage location DBName = zabbixDB # Database Name DBUser = zabbix # connection user DBPassword = zabbix_pass # connection password shell> vim/etc/init. d/zabbix_server # server startup script BASEDIR =/usr/local/zabbix # modified location (Original:/usr/local) shell> vim/etc/init. d/zabbix_agentd # client STARTUP script BASEDIR =/usr/local/zabbix # location after modification (Original:/usr/local)

4. Start the Zabbix Service

Shell> chkconfig -- add zabbix_servershell> chkconfig -- add partition> chkconfig -- level 35 zabbix_server onshell> chkconfig -- level 35 zabbix_agentd onshell> service zabbix_server startStarting zabbix_server: [OK] shell> service zabbix_agentd startStarting zabbix_agentd: [OK] shell> netstat-anpt | grep zabbix (Note: Check whether the startup is successful, because zabbix_server cannot be started when the authorized user cannot connect to the database, but the startup process is displayed as successful.) tcp 0 0 0.0.0.0: 10050 0.0.0.0: * LISTEN 80403/zabbix_agentdtcp 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. inipost_max_size = 16Mmax_execution_time = 300max_input_time = 300date. timezone = Asia/Shanghaialways_populate_raw_post_data =-1 # Find the corresponding parameter, change it to The value above, and restart Nginx and php-fpm!

# 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, generate configureshell>. /configure -- with-php-config =/usr/local/php/bin/php-config; make install # install this extension to generate. 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/php.iniextension_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: it must be that zabbix_agentd.conf is not character =/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 a key point, when adding a host to Zabbix Server, the Hostname value must be the same as that 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!

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.