First, the Environment preparation
1. Host and software preparation
Os:centos 6.7 x86_64
Zabbix version: Zabbix-2.4.3.tar
MySQL version: MariaDB10.0.21
Apache Version: Nginx-1.4.7.tar
PHP Version: Php-5.6.1.tar
Host Planning:
Host ip:192.168.4.251
Start deployment:
Deploy server-side:
2. Create users and groups for the Zabbix process
[Email protected] ~]# groupadd Zabbix [[email protected] ~]# useradd-g zabbix-s/sbin/nologin-m Zabbix
Unzip the uploaded Zabbix file
[Email protected] data]# tar zxvf zabbix-2.4.3.tar.gz [[email protected] data]# CD zabbix-2.4.3
3. Install the required components
# yum-y Install Curl Curl-devel net-snmp SNMP net-snmp-devel
4. Create the Zabbix database and import the Zabbix database data (server)
mysql -u root -p enter password 123456 (Your password); mysql > create database zabbix character set utf8; mysql > grant all privileges on zabbix.* to [email protected] identified by ' 123456 '; mysql >flush privileges; mysql >use zabbix mysql> source /mnt/ tmp/zabbix-2.4.3/database/mysql/schema.sql mysql> Source /mnt/tmp/zabbix-2.4.3/database/mysql/data.sql mysql > source /mnt/tmp/Zabbix-2.4.3/database/mysql/images.sql
Here you can see whether the following table has been created successfully;
Second, Zabbix compiled installation and service open:
1. Software compilation installation (--enable-agent)
[Email protected] zabbix-2.4.3]#/configure--prefix=/usr/local/zabbix--enable-server--enable-agent--with-mysq L--WITH-NET-SNMP--with-libcurl--with-libxml2--with-ssh2
650) this.width=650; "title=" Zabbix.png "alt=" Wkiol1acy0ajncrwaaav45onx1i043.png "src=" http://s4.51cto.com/wyfs02/ M01/79/d4/wkiol1acy0ajncrwaaav45onx1i043.png "/>
If the results are displayed after the compilation is complete, you can perform the make && do install
[[email protected] zabbix-2.4.3]# make && make install
At this point, the compilation installation is complete.
2. Service Startup and configuration:
Copy the INIT.D boot script provided to the system.
[email protected] zabbix-2.4.3]# CP misc/init.d/fedora/core/*/etc/init.d/
Edit the startup script to suit your installation environment.
[Email protected] zabbix-2.4.3]# Vi/etc/init.d/zabbix_server
Replace basedir=/usr/local/with Basedir=/usr/local/zabbix (where the above step is compiled)
[Email protected] zabbix-2.4.3]# VI/ETC/INIT.D/ZABBIX_AGENTD
Replace basedir=/usr/local/with Basedir=/usr/local/zabbix (where the above step is compiled)
Execute the open server process and client process
[[email protected] zabbix-2.4.3]#/etc/init.d/zabbix_server start
If error:
650) this.width=650; "title=" Zabbixerror1.png "alt=" Wkiom1acy56yvxrnaaakv95quia491.png "src=" http://s2.51cto.com/ Wyfs02/m02/79/d5/wkiom1acy56yvxrnaaakv95quia491.png "width=" 1117 "height=" "/>
Workaround: At this time it is possible to report mysqlclient link library error, the workaround:
#ln-S/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib64/libmysqlclient.so.18
Turn on the service again.
650) this.width=650; "title=" Zabbixerror2.png "alt=" Wkiol1aczc7sdvzhaaajafkwpqm152.png "src=" http://s5.51cto.com/ Wyfs02/m00/79/d4/wkiol1aczc7sdvzhaaajafkwpqm152.png "/>
Status Confirmation:
#/etc/init.d/zabbix_server status
650) this.width=650; "title=" Zabbixerror3.png "alt=" Wkiom1aczc2ym92waaa8a4qsutq255.png "src=" http://s5.51cto.com/ Wyfs02/m00/79/d5/wkiom1aczc2ym92waaa8a4qsutq255.png "/>
[[Email protected] zabbix-2.4.3]# service ZABBIX_AGENTD start
Add Boot start Service
[[email protected] Moxiaokai zabbix-2.4.3] #chkconfig--add zabbix_server [[email protected] Moxiaokai zabbix-2.4.3] #chkconfig--level zabbix_server on [[email protected] Moxiaokai zabbix-2.4.3] #chkconfig--add zabbix_agentd [[email protected] Moxiaokai zabbix-2.4.3] #chkconfig--level zabbix_agentd on
3. Edit the Zabbix_server configuration file (/usr/local/zabbix/etc/zabbix_server.conf)
[[email protected] zabbix-2.4.3]# cd /usr/local/zabbix/etc [[email protected] etc]# cp zabbix_server.conf zabbix_server.conf.bak [[email protected] etc]# vi zabbix_server.conf
dbname= zabbix # Database name used by Zabbix DBUser=zabbix #zabbix数据库连接用户名 DBPassword=123456 dbport=23306 logfile=/var/ log/zabbix/zabbix_server.log #日志存放路径设置 logfilesize= 10 #日志大小限制 # #没有特殊需求配置到这里就OK了 StartPollers=30 #开启多线程数, generally not more than 30 StartTrappers=20 #trapper线程数 StartPingers=10 #fping线程数 StartDiscoverers=120 MaxHousekeeperDelete=5000 CacheSize=1024M #用来保存监控数据的缓存数, Properly adjusted to the number of monitoring hosts StartDBSyncers=8 #数据库同步时间 historycachesize=1024m TrendCacheSize=128M #总趋势缓存大小 HistoryTextCacheSize=512M logslowqueries=1000
4. Add the Zabbix service corresponding port:
[[email protected] moxiakai etc]# vi /etc/services zabbix_ agent 10050/tcp # zabbix agent zabbix_agent 10050/udp # zabbix agent zabbix_trapper 10051/tcp # zabbix trapper zabbix_trapper 10051/udp # zabbix trapper
5. Zabbix.log Directory Creation and authorization
[[email protected] Moxiakai etc] #mkdir/var/log/zabbix [[email protected] Moxiakai etc] #chown Zabbix:zabbix/var/lo G/zabbix [[email protected] Moxiakai etc]# chmod-r 775/var/log/zabbix/
6. Verifying the zabbix_server.conf configuration
[[email protected] Moxiakai etc] #service zabbix_server Restart shutting down zabbix_server: [OK] Starting Zabbix_server: [OK]
7. Check the availability of services:
Check the Zabbix_server service:
[Email protected] Moxiakai etc]# service zabbix_server statuszabbix_server (PID 14425) is running ...
[Email protected] Moxiakai etc]# service zabbix_agentd statuszabbix_agentd (PID 6245 6244 6243 6242 6241 6239) is running ...
Third, the Web File replication and installation
1.WEB file copy
[Email protected]]# cd/mnt/tmp/zabbix-2.4.3 [email protected]]# mkdir-p/var/www/zabbix [email protecte D]] # \CP-RFP frontends/php/*/var/www/zabbix/-R
2. Configure Nginx:
[[email protected]] # vi/usr/local/nginx/conf/nginx.conf
vi /usr/local/nginx/conf/nginx.conf server { listen 8190; server_name vstar.com; root /var/www/zabbix; index index.html index.htm index.php; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ \. php$ { try_files $uri =404; include fastcgi.conf; fastcgi_pass 127.0.0.1:9010; }} [[email protected]] #service nginx restart
3. Execute setup.php Start Installation
In the browser input: http://192.168.4.251
650) this.width=650; "title=" Zabbix.png "alt=" Wkiol1aciv6hrhfeaalb5g4n4zw095.png "src=" http://s3.51cto.com/wyfs02/ M00/79/d5/wkiol1aciv6hrhfeaalb5g4n4zw095.png "width=" 1175 "height=" 662 "/>
Then "Next" next, the default php.ini for this step is generally error:
Modify/usr/local/php56/etc/php.ini To resolve:
Post_max_size = 16M Max_execution_time = Max_input_time = Date.timezone = "Asia/shanghai"
Always_populate_raw_post_data =-1
Modify 3 at Mysql.default_socket
Mysql.default_socket =/data/mydata/mariadb.sock Pdo_mysql.default_socket=/data/mydata/mariadb.sock mysqli.d Efault_socket =/data/mydata/mariadb.sock
Modified php.ini only need to restart PHP-FPM
/ETC/INIT.D/PHP-FPM56 restart
Click Retry, everything OK:
650) this.width=650; "title=" Zabbix1.png "alt=" Wkiol1aciwvtveokaafptqxlelc197.png "src=" Http://s3.51cto.com/wyfs02 /m00/79/d5/wkiol1aciwvtveokaafptqxlelc197.png "/>
Enter the user and passwd for the database, test it, and then next:
650) this.width=650; "title=" Zabbix2.png "alt=" Wkiol1acrktzc5omaahhbnrcr74382.png "src=" Http://s2.51cto.com/wyfs02 /m00/79/d8/wkiol1acrktzc5omaahhbnrcr74382.png "/>
It is recommended to enter the host's IP Address:
650) this.width=650; "title=" Zabbix3.png "alt=" Wkiom1acrhuq7nuxaagk5rhllmy336.png "src=" Http://s1.51cto.com/wyfs02 /m01/79/d9/wkiom1acrhuq7nuxaagk5rhllmy336.png "/>
Direct Next:
650) this.width=650; "title=" Zabbix4.png "alt=" Wkiom1acrquhjsdcaahj-eyjwow436.png "src=" Http://s3.51cto.com/wyfs02 /m01/79/d9/wkiom1acrquhjsdcaahj-eyjwow436.png "/>
Direct Next:
650) this.width=650; "title=" Zabbix6.png "alt=" Wkiol1acr7nj9kruaad0dh1fsp0049.png "src=" Http://s4.51cto.com/wyfs02 /m02/79/d8/wkiol1acr7nj9kruaad0dh1fsp0049.png "/>
If this step error: Download zabbix.conf.php to the machine and then upload it, retry:
650) this.width=650; "title=" Zabbix5.png "alt=" Wkiol1acr0gjc0ilaahojktw-7i727.png "src=" Http://s2.51cto.com/wyfs02 /m00/79/d8/wkiol1acr0gjc0ilaahojktw-7i727.png "/>
And then it's finish!
The default login account is: Admin Password: Zabbix
650) this.width=650; "title=" Zabbix7.png "alt=" Wkiol1acsabtb1mwaajbrcdkllm079.png "src=" Http://s4.51cto.com/wyfs02 /m02/79/d8/wkiol1acsabtb1mwaajbrcdkllm079.png "/>
zabbix-2.4.3 compiled installation to this end, the latter will be introduced Zabbix and monitoring the use of articles, welcome to the attention ~ ~ ~
This article is from the "Little Mo Growth Road" blog, please be sure to keep this source http://309173854.blog.51cto.com/7370240/1736263
Zabbix Compile and install (zabbix-2.4.3 server_install)