System Information:Centos release 6.5 (final)
Kernel information:2.6.32-431. el6.x86 _ 64
Zabbix Server IP: 192.168.1.105
Zabbix Agent IP: 192.168.1.106
InstallZabbixserver
Install MySQL;
yum -y install mysql-server
Edit the MySQL configuration file;
vim /etc/my.cnf [mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recommendedto prevent assorted security riskssymbolic-links=0character-set-server=utf8 [mysql]default-character-set=utf8 [mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid
Restart MySQL;
/etc/init.d/mysqld restart
Set Automatic startup;
chkconfig mysqld on
Create a database;
create database zabbix;
Authorize the database;
grant all on zabbix.* to [email protected] by "123456";
Install zabbix repo;
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
Install zabbix-server in Yum;
yum install install zabbix-serverzabbix-server-mysql
Modify the configuration file of zabbix_server;
Vim/etc/zabbix/zabbix_server.conf # modify the following configuration in dbname = zabbixdbuser = zabbixdbpassword = 123456
View database tables;
Rpm-QL zabbix-server-mysql | grep SQL/usr/sbin/zabbix_server_mysql/usr/share/doc/zabbix-server-mysql-2.4.0/usr/share/doc/zabbix-server-mysql-2.4.0/create/usr/share/ DOC/zabbix-server-mysql-2.4.0/create/data. SQL # default data/usr/share/doc/zabbix-server-mysql-2.4.0/create/images. SQL # zabbix icon/usr/share/doc/zabbix-server-mysql-2.4.0/create/schema. SQL # What tables/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/ dbpatches/1.6/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/1.6/MySQL/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/1.6/MySQL/patch. SQL/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/1.8/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/1.8/MySQL/usr/share/doc/zabbix-server-mysql-2.4.0/ upgrades/dbpatches/1.8/MySQL/patch. SQL/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/1.8/MySQL/upgrade/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/2.0/usr/share/doc/ zabbix-server-mysql-2.4.0/upgrades/dbpatches/2.0/MySQL/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/2.0/MySQL/patch. SQL/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/2.0/MySQL/rc4_rc5. SQL/usr/share/doc/zabbix-server-mysql-2.4.0/upgrades/dbpatches/2.0/MySQL/upgrade
Import SQL;
mysql zabbix < /usr/share/doc/zabbix-server-mysql-2.4.0/create/schema.sqlmysql zabbix </usr/share/doc/zabbix-server-mysql-2.4.0/create/images.sqlmysql zabbix </usr/share/doc/zabbix-server-mysql-2.4.0/create/data.sql
Start zabbix-server;
/etc/init.d/zabbix-server restart
Configure auto-start upon startup;
chkconfig zabbix-server on
View the zabbix startup log;
tail -f /var/log/zabbix/zabbix_server.log 2199:20140919:023458.237 server #17 started [timer #1] 2201:20140919:023458.241 server #18 started [http poller #1] 2204:20140919:023458.248 server #20 started [history syncer #1] 2205:20140919:023458.250 server #21 started [history syncer #2] 2208:20140919:023458.253 server #22 started [history syncer #3] 2210:20140919:023458.258 server #23 started [history syncer #4] 2211:20140919:023458.259 server #24 started [escalator #1] 2212:20140919:023458.260 server #25 started [proxy poller #1] 2216:20140919:023458.265 server #26 started [self-monitoring #1] 2202:20140919:023458.671 server #19 started [discoverer #1]
Check the port;
netstat -lntp|grep 10051 tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 2172/zabbix_server tcp 0 0 :::10051
Install zabbix-web;
yum install -y zabbix-web zabbix-web-mysql
Start Apache;
/etc/init.d/httpd restart
Set Automatic startup;
chkconfig httpd on
Enter the Server IP address in the browser;
Http: // 192.168.1.105/zabbix
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4B/38/wKiom1QownLgBGCnAAJjrwTWBt4533.jpg "style =" float: none; "Title =" 1.png" alt = "wkiom1qownlgbgcnaajjrwtwbt1_3.jpg"/>
Click Next
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4B/3A/wKioL1QowpywnGqYAANC33Hhw64267.jpg "style =" float: none; "Title =" 2.png" alt = "wkiol1qowpywngqyaanc33hhw64267.jpg"/>
Here, the time zone of PHP time zone needs to be modified;
Edit Vim/etc/httpd/CONF. d/zabbix. conf
Locate the date. timezone annotation section:
<Directory"/usr/share/zabbix"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value date.timezoneAsia/Shanghai</Directory>
After the modification, reload Apache and click Retry on the page;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4B/38/wKiom1QownKSqQtyAAMf5zI5KZo380.jpg "style =" float: none; "Title =" 3.png" alt = "wkiom1qownksqqtyaamf5zi5kzow.jpg"/>
Click Next;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4B/38/wKiom1QownKA7zDdAAKYI0Sc834343.jpg "style =" float: none; "Title =" 4.png" alt = "wkiom1qownka7zddaakyi0sc834343.jpg"/>
Enter the name, user, and password of the database you created;
My database name here is zabbix
User: zabbix
Password 123456
Click test connection to test the connection. If OK is displayed, the connection is normal and you can proceed to the next step.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/4B/3A/wKioL1QowpzhFFigAAIp2Q2Myj4194.jpg "style =" float: none; "Title =" 5.png" alt = "wkiol1qowpzhffigaaip2q2myj4194.jpg"/>
Specify a name in the name. You can specify the name based on the actual situation.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/4B/38/wKiom1QownPybuRxAAKT3sI7sWg195.jpg "style =" float: none; "Title =" 6.png" alt = "wkiom1qownpyburxaakt3si7swg195.jpg"/>
The list of previously configured information is displayed here. You can confirm it and click Next.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4B/3A/wKioL1Qowp2ABKqfAAHxAQAPpj0413.jpg "style =" float: none; "Title =" 7.png" alt = "wkiol1qowp2abkqfaahxaqappj0413.jpg"/>
The configuration file has been generated. Click Finish.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4B/3A/wKioL1Qow8LzbVShAAGZuiUGMJY503.jpg "Title =" 8.png" alt = "wkiol1qow8lzbvshaagzuiugmjy503.jpg"/>
The logon page is displayed. Default User name: Admin Password: zabbix
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4B/3A/wKioL1Qowp6A7dufAAXqa-UkWik400.jpg "style =" float: none; "Title =" 9.png" alt = "wKioL1Qowp6A7dufAAXqa-UkWik400.jpg"/>
InstallZabbixagent
Configure zabbix repo first;
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
Install zabbix agent;
yum install -y zabbix-agent
Modify the agent configuration file;
vim /etc/zabbix/zabbix_agentd.conf
# Change to the IP address of the server
Server = 192.168.1.105
Start zabbix agent;
/etc/init.d/zabbix-agent start
Add auto-start upon startup;
chkconfig zabbix-agent on
View log files;
tail -f /var/log/zabbix/zabbix_agentd.log 1868:20140919:060835.219 Starting Zabbix Agent [Zabbix server].Zabbix 2.4.0 (revision 48953). 1868:20140919:060835.219 using configuration file: /etc/zabbix/zabbix_agentd.conf 1868:20140919:060835.220 agent #0 started [main process] 1869:20140919:060835.223 agent #1 started [collector] 1870:20140919:060835.228 agent #2 started [listener #1] 1871:20140919:060835.229 agent #3 started [listener #2] 1873:20140919:060835.229 agent #5 started [active checks #1] 1872:20140919:060835.230 agent #4 started [listener #3] 1873:20140919:060835.230 activecheck configuration update from [127.0.0.1:10051] started to fail (cannotconnect to [[127.0.0.1]:10051]: [111] Connection refused)
If an error is reported in the area marked above, you can edit ETC/zabbix/zabbix_agentd.conf to comment out # serveractive = 127.0.0.1 and restart zabbix agent.
This article is from the "Jerry on the road" blog, please be sure to keep this source http://jerry0117.blog.51cto.com/1664014/1559280
Centos zabbix Server Installation