Build environment: Centos6.5_x86_64, Zabbix2.4.5, epel source
Server: ##
Install the development package
yum -y groupinstall "Development Tools"
Install the required dependencies
yum -y install httpd mysql mysql-server mysql-devel php php-mysql php-common
php-mbstring php-gd php-odbc php-pear curl curl-devel net-snmp net-snmp-devel
perl-DBI php-xml ntpdate php-bcmath
Synchronize the server time, keep the time of all servers consistent to avoid unavailable monitoring data caused by time differences
ntpdate pool.ntp.org
Create users and groups required for running zabbix service
groupadd -g 201 zabbix
useradd -g zabbix -u 201 -m zabbix
Initialize the mysql server
/etc/init.d/mysqld start
Create the database and user permissions required for zabbix operation
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;
Download and unzip 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
Import the initial data of zabbix into 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
/usr/local/etc
Copy the startup scripts of zabbixserver and agent, and set execution permissions
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_*
Copy the page file of zabbix to the specified directory (the same as the apache configuration)
mkdir /var/www/html/zabbix
cp -a frontends/php/* /var/www/html/zabbix/
chown -R apache.apache /var/www/html/zabbix/
Configure the php file to adapt to the parameters required for zabbix installation
date.timezone = Asia/Shanghai #946 line
max_execution_time = 300 #440 line
max_input_time = 300 #449 line
post_max_size = 32M #729 line
memory_limit = 128M #457 line
mbstring.func_overload = 2 #1586 line, need to comment this line
ServerName 127.0.0.1
< VirtualHost *:80>
DocumentRoot "/var/www/html"
ServerName 192.168.2.100
< /VirtualHost>
DBHost=192.168.2.100 #68 line
DBName = zabbix #78 line
DBUser=zabbixuser #94 line
DBPassword=zabbixpwd #102 line
DBSocket=/var/lib/mysql/mysql.sock #104 line
StartPollers=30 #127 line, open multi-thread number, general
No more than 30
StartTrappers=20 #156 lines, number of trapper threads
StartPingers=10 #164 line, the number of fping threads
StartDiscoverers=120 #172 line
ListenIP=0.0.0.0 #277 line
MaxHousekeeperDelete=5000 #307 line
CacheSize=1024M #324 line, used to save monitoring data
The number of caches, adjusted appropriately according to the number of monitoring hosts
StartDBSyncers=8 #340 line, database synchronization time
HistoryCacheSize=1024M #349 lines
TrendCacheSize=128M #358 line, total trend cache size
HistoryTextCacheSize=512M #367 line
AlertScriptsPath=/etc/zabbix/alertscripts #425 line
LogSlowQueries=1000 #467 line
Start apache service and zabbix service
/etc/init.d/httpd start
/etc/init.d/zabbix_server start
Access the installation interface and follow the prompts to complete the installation step by step
http://192.168.2.100/zabbix/setup.php
a) Enter the installation interface and click Next
b) Ensure that all monitoring items are OK, click Next
c) Fill in the user name, password, address and other information of the zabbix database, click Test connection, OK and then click Next
d) Fill in the information of zabbix server, host name, port monitored by server program, host IP address, etc., if
Server and web can be kept on the same server as default, click Next
e) If there is no problem with the information filled in the previous sections, click Next
f) Check the config file of the web program. If there is no problem, it will display OK. Just click Finish to complete the installation (such as
If there is a problem here, it is generally a problem with the permissions of the zabbix virtual host directory file. The setting process above is generally not
There will be problems)
Go to edit the configuration file vim /var/www/html/zabbix/conf/zabbix.conf.php to manually define the relevant parameters
Just count
g) Enter the login interface and click login, the default is admin zabbix
Agent side: ##
Install the development package
yum -y groupinstall "Development Tools"
yum –y install ntpdate
Synchronize the client time to prevent inconsistencies with the server side, resulting in unavailable monitoring data
ntpdate pool.ntp.org
Create users and groups required for zabbix operation
groupadd -g 201 zabbix
useradd -g zabbix -u 201 -m zabbix
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
Scripts needed to run copy agent
cp misc/init.d/tru64/zabbix_agentd /etc/init.d/
chmod +x /etc/init.d/zabbix_agentd
Configure the agent configuration file
zabbix_agent.conf, otherwise the configuration will not take effect
Server=192.168.2.100 #81 line, fill in the IP address of Server
ServerActive=192.168.2.100:10051 #122 line, modify it to the IP of Server
Address + port number
Hostname=192.168.2.100 #133 line, fill in the machine’s
HostName, note that the Server side must be able to resolve
UnsafeUserParameters=1 #265 line, whether custom key is allowed, 1
Is allowed, 0 is not allowed
Include= /etc/zabbix/zabbix_agentd.conf.d/ #249 line, custom agentd configuration file (key)
You can write here;
Solve zabbix Chinese garbled and Chinese##
Find a font you like in windows or download a font online
Upload the font to the /var/www/html/zabbix/fonts directory. For example, I used "Chinese Songti Convention" here,
The file name of the font stsong.ttf
Modify the Chinese font settings of zabbix page management
define('ZBX_FONT_NAME','stsong'); #92 line
define('ZBX_GRAPH_FONT_NAME','stsong'); #44 line
The login page sets the default language of the corresponding user Administrator—->Users (please ensure that the user is displayed here,
Otherwise, all user groups are displayed)
Click the user name to enter the user information editing, the default language is simplified Chinese, and then click save to save
6、 refresh page
Recommended Posts