CentOS Zabbix installation and deployment and localization, centoszabbix

Source: Internet
Author: User
Tags snmp tru64

CentOS Zabbix installation and deployment and localization, centoszabbix

Build Environment: Centos6.5 _ x86_64, Zabbix2.4.5, 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-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/zab
Bix-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.
/Usr/local/etc


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. Multiple Threads are enabled. Generally
No more than 30
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 Monitoring Data
Cache quantity, which can be 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 the zabbix server information, host name, server program listening port, Host IP address, etc. If
Server and web can be kept by default on one server. 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 no problem occurs, OK is displayed. Click finish to complete the installation (for example
If there is a problem here, it is generally due to the permission of the zabbix virtual host directory file. The above setting process is generally not
Problems may occur)
# If a wrong password or user name is entered due to a wrong hand, an error will always be reported later. We can manually
Edit the configuration file vim/var/www/html/zabbix/conf/zabbix. conf. php to manually define relevant parameters.
Count
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 it here
Zabbix_agent.conf; 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 IP address of the Server
Address + port number
Hostname = 192.168.2.100 # Line 133, enter the local
HostName, 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/# Row 249, custom agentd configuration file (key)
It 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. If "文" is used here ",
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, 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, it still has English.

 

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.