Description
Installation Environment:
Os:centos 6.6
Web environment: Apache Mysql PHP
Zabbix version: Zabbix 2.4.4
SElinux: Off
Preparatory work:
Download Zabbix Source package: Http://sourceforge.net/projects/zabbix/?source=directory
Install the lamp environment: Yum install make mysql-server httpd php mysql-devel gcc net-snmp-devel curl-devel perl-dbi php-gd php-mysql php- Bcmath php-mbstring php-xml-y
Create Zabbix User: Useradd-r Zabbix
Configure MySQL:
Service mysqld start mysqladmin-u root password root//set MySQL database administrator's account password Mysql-u root-p//Enter password, log in to MySQL
To create a Zabbix database:
Mysql> CREATE database Zabbix character set UTF8; Mysql> Grant all on zabbix.* to [e-mail protected] ' localhost ' identified by ' zabbixpass '; Authorize this machine through the account Zabbix password Zabbixpass access to the database all permissions mysql> flush privileges; Refresh MySQL Authorization information table
To import the database schema:
Tar zxvf zabbix-2.4.4//Decompression Zabbix Source Package CD zabbix-2.4.4/database/mysql///Enter unzip directory
There are three. sql files in this directory (Schema.sql, Images.sql, Data.sql)
Mysql-h localhost-uroot-proot Zabbix < schema.sql mysql-h Localhost-uroot-proot Zabbix < images.sql my Sql-h Localhost-uroot-proot Zabbix < data.sql//should use Zabbix and zabbixpass to import SQL files, because root is the administrator account, so local can be used directly to connect
(Don't mess up the order)
Compile and install Zabbix 2.4.4
CD zabbix_2.4.4/./configure--prefix=/usr/local/zabbix--with-mysql=/usr/bin/mysql_config--WITH-NET-SNMP-- With-libcurl--enable-server--enable-agent--enable-proxy make && make install
Check if the system Services file has a Zabbix port definition
Vim/etc/services Search keyword 10050 to see if there is already a definition of Zabbix service
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/44/wKioL1UEQ3agCfSMAAFqkIebMXc166.jpg "title=" 2.jpg " alt= "Wkiol1ueq3agcfsmaafqkiebmxc166.jpg"/>
I have automatically added the definition after the compilation and installation is complete.
Ln-s/usr/local/zabbix/sbin/*/usr/local/sbin///Add Zabbix executable soft connection ln-s/usr/local/zabbix/bin/*/usr/local/bin/
Configure Zabbix
cd /usr/local/zabbix/etc vi /usr/local/zabbix/etc/ zabbix_server.conf dbname=zabbix //Database name dbuser=zabbix //database user name dbpassword=zabbixpass //database password listenip= 127.0.0.1 //Database IP Address alertscriptspath=/usr/local/zabbix/share/zabbix/alertscripts //zabbix run script to store directory :x //save exit vi /usr/local/zabbix/etc/zabbix_agentd.conf include=/usr/local/zabbix/etc/zabbix_ agentd.conf.d/ unsafeuserparameters=1 //Enable custom key :x // Save Exit cp zabbix-2.4.4/misc/init.d/fedora/core/zabbix_server /etc/rc.d/init.d/zabbix_server //copy installation source directory of the server-side startup script cp zabbix-2.4.4/misc /init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/zabbix_agentd //copy installation source directory of the server-side startup script chmod +x / etc/rc.d/init.d/zabbix_server //Add script Execution Permissions chmod +x /etc/rc.d/init.d/ zabbix_agentd //Add script Execution Permissions chkconfig --add zabbix_server //add launch list chkconfig --add zabbix_agentd //add start-up chkconfig zabbix_server on //Turn on Boot chkconfig zabbix_ agentd on //Turn on startup Modify the Zabbix installation directory in the Zabbix boot script vim /etc/rc.d/init.d/zabbix_server //Edit the server-side configuration file basedir=/usr/local/zabbix/ //zabbix installation directory :x //Save exit vim /etc/rc.d/init.d/zabbix_agentd //Edit Client Profile basedir=/usr/local/zabbix/&nbsP; //zabbix installation directory :x //save exit Configure Web site cp -r zabbix-2.4.4/frontends/php/* /var/ www/html/zabbix/ chown apache:apache -r /var/www/html/zabbix/* service zabbix_server start //Start Zabbix Server service zabbix_agentd start //Start Zabbix Client chkconfig httpd on //Add httpd boot chkconfig mysqld on //add mysql boot up service httpd start service mysqld start
Check that the operating system time is correct.
Configure Apache to turn on keepalive long connections
Vim/etc/httpd/conf/httpd.conf KeepAlive on//modify to on default to OFF
Open Browser, Http://zabbixserver/zabbix
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5B/4A/wKiom1UESCWD1PNKAALfdrbfXRY600.jpg "title=" 2.jpg " alt= "Wkiom1uescwd1pnkaalfdrbfxry600.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5B/44/wKioL1UESV_SZQokAAKoymOWJUE845.jpg "title=" 1.png " alt= "Wkiol1uesv_szqokaakoymowjue845.jpg"/>
Configuration parameter Tuning
Vi/etc/php.ini//Edit modify Post_max_size =16m max_execution_time =300 max_input_time =300 date.timezone = PRC p Ost_max_size = 32m:x//Save exit Service httpd restart//restart HTTPD
Refresh the Web page to re-detect the PHP environment.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5B/4A/wKiom1UESQig7bJnAAMxMDKvjfM588.jpg "title=" A4rhndypz$[v8eksv~tr1 ' d.jpg "alt=" Wkiom1uesqig7bjnaamxmdkvjfm588.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5B/4A/wKiom1UESU3wg6UbAALDWGHVx0E152.jpg "title=" 2.png " alt= "Wkiom1uesu3wg6ubaaldwghvx0e152.jpg"/>
Configure database parameters, test pass after the next step
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/44/wKioL1UESqWjB0LzAAIpAxG7ngY999.jpg "title=" 3.png " alt= "Wkiol1uesqwjb0lzaaipaxg7ngy999.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/4A/wKiom1UESZuxEHq9AAKlgg7wLjU529.jpg "title=" 4.png " alt= "Wkiom1ueszuxehq9aaklgg7wlju529.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5B/44/wKioL1UEStzTz76WAAH9YfxunM4167.jpg "title=" 5.png " alt= "Wkiol1uestztz76waah9yfxunm4167.jpg"/>
OK configuration complete
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5B/4A/wKiom1UESe7j029FAASqqtWgEfw525.jpg "title=" 6.png " alt= "Wkiom1uese7j029faasqqtwgefw525.jpg"/>
Change to Chinese page
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/44/wKioL1UES2fjW9-7AAJIMxzux-o267.jpg "title=" 7.png " alt= "Wkiol1ues2fjw9-7aajimxzux-o267.jpg"/>
Well, to this configuration is complete.
As for the installation of Zabbix agent is very simple, the source of the installation package to the client, after decompression
Useradd-r Zabbix
1. Compile and install
./configure--with-net-snmp--with-libcurl--enable-agent--prefix=/usr/local/zabbixmake && make Installln-s/ usr/local/zabbix/sbin/*/usr/local/sbin/
2. Add Port
Vim/etc/serviceszabbix-agent 10050/tcp # Zabbix agentzabbix-agent 10050/udp # Zabbix agentzabbix-trapper 10051/tcp # Zabb IX Trapperzabbix-trapper 10051/UDP # Zabbix Trapper
3. Modify the configuration file
CP misc/init.d/fedora/core5/zabbix_agentd/etc/init.d///RHEL5 Copy core5 script, if it is RHEL6 or 7 copy core/script Chown-r Zabbix: Zabbix/etc/init.d/zabbix_*chmod 700/etc/init.d/zabbix_*su-zabbixvim/etc/init.d/zabbix_agentd Modify zabbix_bin= "/usr/ Local/sbin/zabbix_agentd "for zabbix_bin="/usr/local/zabbix/sbin/zabbix_agentd "
4. Start the service and set up boot
/etc/init.d/zabbix_agentd Startchkconfig Zabbix_agentd on
Zabbix Tutorial Getting started to proficient see attachment link at the end of the article
Special thanks to Ttlsa 's Cheng for writing!
This article from "Professor elder brother" blog, reprint please contact the author!
Zabbix tutorial on Getting Started with the new installation tutorial