centos7 install and deploy monitoring zabbix

A: experimental environment

server.zabbix.com-------------------- 192.168.200.11

agent.zabbix.com------------------------192.168.200.12     

Two: Configure the host name to modify host files

[root@localhost ~]# hostname server.zabbix.com

[root@server ~]# vim /etc/hosts
server.zabbix.com  192.168.200.11
agent.zabbix.com   192.168.200.12

[root@server ~]# scp /etc/hosts 192.168.200.12:/etc/

III: mounting a respective dependencies

[root@localhost ~]# yum -y install httpd mariadb mariadb-devel mariadb-server php php-mbstring php-mysql php-bcmath php-gd php-xmlrpc php-ldap php-xml libevent libevent-devel net-snmp net-snmp-devel libxml2 libxml2-devel curl-devel ntpdate

[Root @ localhost ~] #ntpdate s1a.time.edu.cn # sync Tsinghua time

Four: Start Services

[root @ server ~] # systemctl start mariadb # open MySQL
[root @ Server ~] # systemctl enable MariaDB # Set the boot from Kai
[root @ Server ~] # systemctl Start httpd
[root @ Server ~] # systemctl enable httpd
[root @server ~] # mysqladmin -uroot password 123123 # MySQL password settings

Five: Install the JDK

[root@server ~]# ls
anaconda-ks.cfg  jdk-8u191-linux-x64.tar.gz

[root@server ~]# rm -rf /usr/bin/java
[root@server ~]# tar xf jdk-8u191-linux-x64.tar.gz
[root@server ~]# mv jdk1.8.0_191 /usr/local/java
[root@server ~]# vim /etc/profile

export JAVA_HOME=/usr/local/java
export PATH=$PATH:$JAVA_HOME/bin
                                   
[root@server ~]# source /etc/profile
[root@server ~]# java -version
java version "1.8.0_191"
Six: build zabbix
[root@server ~]# ls
anaconda-ks.cfg  jdk-8u191-linux-x64.tar.gz  zabbix-3.4.11.tar.gz
[root@server ~]# tar xf zabbix-3.4.11.tar.gz -C /usr/src/
[root@server ~]# cd /usr/src/zabbix-3.4.11/
[root@server zabbix-3.4.11]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --enable-java && make && make install
Seven: the authorization database zabbix
[root@server ~]# mysql -uroot -p123123
MariaDB [(none)]> create database zabbix character set utf8;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> grant all on zabbix.* to [email protected] identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Eight: Data Import zabbix needed
[root@server ~]# mysql -uzabbix -p'zabbix'  zabbix < /usr/src/zabbix-3.4.11/database/mysql/schema.sql
[root@server ~]# mysql -uzabbix -pzabbix zabbix < /usr/src/zabbix-3.4.11/database/mysql/images.sql
[root@server ~]# mysql -uzabbix -pzabbix zabbix < /usr/src/zabbix-3.4.11/database/mysql/data.sql
# View
[root @ server ~] # mysql -uzabbix -pzabbix
MariaDB [(none)]> use zabbix
MariaDB [zabbix]> show tables;
Nine: configuration of zabbix
[root@server ~]# useradd -M -s /sbin/nologin zabbix
[root@server ~]# cd /usr/local/
[root@server local]# chown -R zabbix:zabbix zabbix/
[root@server local]# cd zabbix/
# Create a log logs directory
[root @ Server zabbix] # mkdir logs
[root @ Server zabbix] # chown zabbix: zabbix logs
#备份配置文件
[root@server zabbix]# cd /usr/local/zabbix/etc/
[root@server etc]# cp zabbix_server.conf zabbix_server.conf.bak
[root@server etc]# cp zabbix_agentd.conf zabbix_agentd.conf.bak
#修改配置文件
[root@server etc]# vim zabbix_server.conf
LogFile=/usr/local/zabbix/logs/zabbix_server.log
PidFile=/tmp/zabbix_server.pid
DBHost=192.168.200.11
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
Include=/usr/local/zabbix/etc/zabbix_server.conf.d/*.conf
# Add a soft link
[root @ server etc] # LN -s / usr / local / zabbix / sbin / * / usr / local / bin /
# start the server-side service
 [root @ server ~] # zabbix_server
# start agentd end service
[Server the root @ ~] # zabbix_agentd
# zabbix configuration web page
[the root Server @ ~] # Music Videos /usr/src/zabbix-3.4.11/frontends/php/ / var / WWW / HTML / zabbix
[the root @ ~ Server ] # chown -R & lt Apache: Apache / var / WWW / HTML / ZABBIX /
# PHP configuration modified to be compatible ZABBIX
Vim /etc/php.ini
384 max_execution_time = 300 # request receiving data in the time mode
394 max_input_time = 300 # time program data for upload files
672 post_max_size = 32M #post mode request maximum size of the data allowed
405 memory_limit = 128M # PHP's memory limit set
878 date.timezone = asia / Shanghai # timezone
add expansion modules 854 extension = bcmath.so # manually load the program requires zabbix
X: start the service - see the port -web installation

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 XI: Set Chinese

 

 

 

 

Modify the fonts they want to use

[root@server ~]# cd /var/www/html/zabbix/fonts/
[root@server fonts]# ls
DejaVuSans.ttf
[root@server fonts]# rz                             #上传字体
[root@server fonts]# mv simkai.ttf DejaVuSans.ttf
mv:是否覆盖"DejaVuSans.ttf"? yes
刷新页面

 

 

Guess you like

Origin www.cnblogs.com/ZCQ123456/p/11801570.html