Zabbix installation and deployment and localization in CentOS6.5

Source: Internet
Author: User
Tags tru64

Zabbix installation and deployment and localization in CentOS6.5

Build Environment: Centos6.5 _ x86_64, Zabbix2.4.5 (Latest Version), epel Source

Server:

1. Install the development software package

Yum-y groupinstall "Development Tools"

2. Install the required dependency package

Yum-y install httpd mysql-server mysql-devel php-mysql php-common php-mbstring php-gd php-odbc php-pear curl-devel net-snmp net- snmp-devel perl-DBI php-xml ntpdate php-bcmath

3. Synchronize the time on the server to ensure that all servers have the same time to avoid unavailable monitoring data due to different times.

Ntpdate pool.ntp.org

4. Create users and groups required for zabbix Service Running

Groupadd-g 201 zabbix

Useradd-g zabbix-u 201-m zabbix

5. initialize the mysql server

/Etc/init. d/mysqld start

6. Create the database and user permissions required to run zabbix

Mysqladmin-uroot-h127.0.0.1 password "chengshan"

Mysql-uroot-p

Mysql> create database zabbix character set utf8;

Mysql> grant all privileges on zabbix. * to zabbixuser @ '%' identified by 'zabbixpwd ';

Mysql> flush privileges;

7. Download and decompress zabbix

Wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.4.5/zabbix-2.4.5.tar.gz/download

Tar xf zabbix-2.4.5.tar.gz

8. Import the initial data of zabbix to the database.

Cd zabbix-2.4.5

Mysql-uzabbixuser-h192.168.2.100-p zabbix <database/mysql/schema. SQL

Mysql-uzabbixuser-h192.168.2.100-p zabbix <database/mysql/images. SQL

Mysql-uzabbixuser-h192.168.2.100-p zabbix <database/mysql/data. SQL

# Log on to the database and check whether all the tables in the table are successfully created.

9. Compile and install zabbix

./Configure-sysconfdir =/etc/zabbix/-enable-server-enable-agent-with-net-snmp-with-libcurl-with-mysql-with-ssh2 -- enable-java

After executing the preceding command, the following error is reported:

Configure: error: Not found mysqlclient library

Solution:

Ln-s/usr/lib64/mysql/libmysqlclient. so.16.0.0/usr/lib64/mysql/libmysqlclient. so

Ln-s/usr/lib64/mysql/libmysqlclient_r.so.16.0.0/usr/lib64/mysql/libmysqlclient_r.so

Ln-s/usr/lib64/libmysqlclient. so.16.0.0/usr/lib64/libmysqlclient. so

Ln-s/usr/lib64/libmysqlclient_r.so.16.0.0/usr/lib64/libmysqlclient_r.so

Then execute the preceding./configure command again.

Then execute the compilation and Installation

Make & make install

# Specify the path of the sysconfdir configuration file in the/etc/zabbix/directory.

10. Copy the startup script of zabbixserver and agent and set the execution permission.

Cp misc/init. d/tru64/zabbix_agentd/etc/init. d/

Cp misc/init. d/tru64/zabbix_server/etc/init. d/

Chmod + x/etc/init. d/zabbix _*

11. copy the zabbix page file to the specified directory (same as apache configuration)

Mkdir/var/www/html/zabbix

Cp-a frontends/php/*/var/www/html/zabbix/

Chown-R apache. apache/var/www/html/zabbix/

12. Configure the PHP file to adapt to the parameters required for zabbix Installation

# Vim/etc/php. ini

Date. timezone = Asia/Shanghai # Row 946

Max_execution_time = 300 #440 rows

Max_input_time = 300 #449 rows

Post_max_size = 32 M #729 rows

Memory_limit = 128 M #457 rows

Mbstring. func_overload = 2 #1586 line, need to comment this line

13. Configure the apache file to define the virtual host for zabbix Installation

# Vim/etc/httpd/conf/httpd. conf

ServerName 127.0.0.1

<VirtualHost *: 80>

DocumentRoot "/var/www/html"

ServerName 192.168.2.100

</VirtualHost>

14. Configure the zabbix server File to define the database IP address, user name, and password.

# Vim/etc/zabbix/zabbix_server.conf

DBHost = 192.168.2.100 #68 rows

DBName = zabbix #78 rows

DBUser = zabbixuser #94 rows

DBPassword = zabbixpwd #102 rows

DBSocket =/var/lib/mysql. sock # Row 104

StartPollers = 30 #127 rows, with no more than 30 threads Enabled

StartTrappers = 20 #156 rows, number of trapper threads

StartPingers = 10 #164 rows, number of fping threads

StartDiscoverers = 120 #172 rows

ListenIP = 0.0.0.0 #277 rows

MaxHousekeeperDelete = 5000 #307 rows

CacheSize = 1024 M #324 rows, used to save the number of metric data caches, adjusted according to the number of monitored hosts

StartDBSyncers = 8 # Row 340, Database Synchronization time

HistoryCacheSize = 1024 M #349 rows

TrendCacheSize = 128 M #358 rows, total trend cache size

HistoryTextCacheSize = 512 M #367 rows

AlertScriptsPath =/etc/zabbix/alertscripts #425 rows

LogSlowQueries = 1000 #467 rows

15. Start the apache service and zabbix Service

/Etc/init. d/httpd start

/Etc/init. d/zabbix_server start

16. Visit the installation page and follow the prompts to complete the installation step by step.

Http: // 192.168.2.100/zabbix/setup. php

A) Go to the installation page and click Next.

B) Make sure all monitoring items are OK. click Next.

C) Fill in the username, password, address, and other information of the zabbix database, click Test connection, OK, and click Next

D) fill in information about the zabbix server, host name, port listened by the server program, Host IP address, etc. If the server and web server are on the same server by default, click Next

E) If you have confirmed that the information entered in the previous sections is correct, click Next.

F) Check the config file of the web program. If there is no problem, it will show OK. Click finish to complete the installation. (if there is a problem, the permission of the zabbix virtual host directory file is usually incorrect, the process with the above settings is generally normal)

# If the incorrect password or user name is entered due to a hand error, an error will always be reported later, you can manually edit the configuration file vim/var/www/html/zabbix/conf/zabbix. conf. php manually defines related parameters.

G) Go to the logon page and click logon. The default logon is admin zabbix.

# So far, server installation is complete

Agent:

1. Install the development software package

Yum-y groupinstall "Development Tools"

Yum-y install ntpdate

2. Synchronize the client time to prevent unavailability of monitoring data due to inconsistency with the server.

Ntpdate pool.ntp.org

3. Create users and groups required for zabbix operation

Groupadd-g 201 zabbix

Useradd-g zabbix-u 201-m zabbix

4. Unzip and install zabbixagent.

Tar xf zabbix-2.4.5.tar.gz

Cd zabbix-2.4.5

./Configure-sysconfdir =/etc/zabbix-enable-agent

Make & make install

5. copy the script required for running the agent.

Cp misc/init. d/tru64/zabbix_agentd/etc/init. d/

Chmod + x/etc/init. d/zabbix_agentd

6. Configure the agent configuration file

# Vim/etc/zabbix/zabbix_agentd.conf # Do not write zabbix_agent.conf here. Otherwise, the configuration does not take effect.

Line 81: Server = 192.168.2.100 # enter the IP address of the Server.

ServerActive = 192.168.2.100: 10051 # line 122, changed to the Server IP address + port number

Hostname = 192.168.2.100 # Line 2: Enter the Host Name of the Local Machine. Note that the Server must be able to parse

UnsafeUserParameters = 1 # Row 265, whether to allow custom key, 1 is allowed, 0 is not allowed

Include =/etc/zabbix/zabbix_agentd.conf.d/# Line 2. The custom agentd configuration file (key) can be written here;

7. Start zabbix agent

/Etc/init. d/zabbix_agentd start

Zabbix Chinese garbled and Chinese

1. Find a favorite font in windows or download a font from the Internet.

2. Upload the font to the/var/www/html/zabbix/fonts directory. For example, if "文" is used here, the font file name stsong. ttf

3. Modify the Chinese font settings of zabbix Page Management

# Vim/var/www/html/zabbix/include/defines. inc. php # modify the following two lines:

Define ('zbx _ FONT_NAME ', 'stsong'); #92 rows

Define ('zbx _ GRAPH_FONT_NAME ', 'stsong'); #44 rows

4. Set the corresponding user's default language Administrator --> Users on the login page (ensure that the user is displayed here; otherwise, all user groups are displayed)

5. Click the user name to edit the user information. The default language is simplified Chinese, and then click save to save.

6. Refresh the page

# It has already become a Chinese character. In some places, there will still be English, but zabbix's Localization has done a great job compared to other open-source software !!!

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.