Installation Preparation Environment
1 System Environment
[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.0.1406 (Core)
[root@localhost ~]# uname -r
3.10.0-123.el7.x86_64
2 Turn off the firewall and selinux
[root@localhost bin]# systemctl status iptables
iptables.service – IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)
Active: inactive (dead) since Fri 2015-07-17 10:58:54 EDT; 16s ago
[root@localhost bin]# systemctl status firewalld
firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled)
Active: inactive (dead)
[root@localhost bin]# getenforce
Permissive
3 runtime environment
Source Package Preparation:
Source install mysql:
[root@localhost bin]# ./mysql –version
./mysql Ver 14.14 Distrib 5.6.16, for Linux (x86_64) using EditLine wrapper
yum install http php:
[root@localhost bin]# apachectl -v
Server version: Apache/2.4.6 (CentOS)
Server built: Mar 12 2015 15:07:19
[root@localhost bin]# php -v
PHP 5.4.16 (cli) (built: Jun 23 2015 21:17:27)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
http php mysql installation methods related components (requires installation before installing php epel, reference phpMyAdmin installation documentation):
[root@localhost bin]# yum install gcc gcc-c++ curl-devel autoconf httpd httpd-manual mod_ssl mod_perl mod_auth_mysql
[root@localhost bin]# yum install php php-mysqlnd(php-mysql) php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath
[root@localhost bin]# yum install mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel
Configuration 4 related environmental
php environment
[root@localhost bin]# vi /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
post_max_size = 32M
max_input_time = 300
memory_limit = 128M
mbstring.func_overload = 2
5 http mysql open
[root@localhost bin]# systemctl start httpd
[root@localhost bin]# systemctl enable httpd
[root@localhost bin]# /etc/init.d/mysql start
[root@localhost bin]# chkconfig mysql on
Zabbix source installation and configuration
6 Install
[root@localhost zabbix-2.0.3]# tar zxvf /root/7.17/zabbix-2.0.3.tar.gz
[root@localhost zabbix-2.0.3]# cd zabbix-2.0.3/
[root@localhost local]# ./configure –prefix=/usr/local/zabbix –enable-server –enable-proxy –enable-agent –with-mysql=/usr/bin/mysql_config –with-net-snmp –with-libcurl
[root@localhost local]# make
[root@localhost local]# make install
7 Add zabbix to system services file
[root@localhost local]# 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
8 Import zabbix database
[root@localhost local]# /usr/local/mysql/bin/mysql -uroot -p
Enter password:
mysql> create database zabbix character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.* to “zabbix”@”localhost” identified by”zabbix”;
Query OK, 0 rows affected (0.02 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@localhost zabbix]# cd /usr/local/zabbix-2.0.3/
[root@localhost zabbix-2.0.3]# /usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < ./database/mysql/schema.sql
Warning: Using a password on the command line interface can be insecure.
[root@localhost zabbix-2.0.3]# /usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < ./database/mysql/images.sql
Warning: Using a password on the command line interface can be insecure.
[root@localhost zabbix-2.0.3]# /usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < ./database/mysql/data.sql
Warning: Using a password on the command line interface can be insecure.
9 Create a profile and execute files zabbix soft link
[root@localhost zabbix-2.0.3]# ln -s /usr/local/zabbix/etc /etc/zabbix
[root@localhost zabbix-2.0.3]# mkdir /var/log/zabbix
[root@localhost zabbix-2.0.3]# chown zabbix.zabbix /var/log/zabbix/
[root@localhost zabbix-2.0.3]# ln -s /usr/local/zabbix/bin/* /usr/bin/
[root@localhost zabbix-2.0.3]# ln -s /usr/local/zabbix/sbin/* /usr/sbin/
[root@localhost zabbix-2.0.3]# vi /etc/init.d/zabbix_server
BASEDIR=/usr/local/zabbix
[root@localhost zabbix-2.0.3]# vi /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix
10 Modify zabbix_server.conf file
[root@localhost zabbix-2.0.3]# vi /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
11 Configuring monitored hosts file (due to zabbix-server also belong to the scope of the monitoring, somodify this file)
[root @ localhost zabbix-2.0.3] # vi /etc/zabbix/zabbix_agentd.conf
Server = 127.0.0.1 # passive mode connections zabbix-server
ServerActive = 127.0.0.1: 20051 # active mode zabbix-server and port number of the connection
LogFile = / tmp / zabbix_agentd.log
UnsafeUserParameters = 1 # Enable custom scripts, custom key when you need to open, with the definition of the profile since, after which appends the variables:
Include = / etc / zabbix / filename.conf
12 Copy the page file
[root@localhost zabbix-2.0.3]# cp -r frontends/php/ /var/www/html/zabbix
[root@localhost zabbix-2.0.3]# chown -R apache.apache /var/www/html/zabbix
13 Open Service
[root@localhost zabbix-2.0.3]# chkconfig zabbix_server on
[root@localhost zabbix-2.0.3]# chkconfig zabbix_agentd on
[root@localhost zabbix-2.0.3]# /etc/init.d/zabbix_server start
Starting zabbix_server (via systemctl): [ OK ]
[root@localhost zabbix-2.0.3]# /etc/init.d/zabbix_agentd start
Starting zabbix_agentd (via systemctl): [ OK ]
Under web interface configuration zabbix
14 Login
In the browser address bar enter IP / zabbix
15 account login
Account: admin Password: zabbix
Thus zabbix installation is complete, detailed configuration and optimization of the production will soon, so stay tuned! THX!
Leave a Reply