zabbix service arrangement (the script)

First, the server configuration

 

# / bin / bash!
#clsn

# Set analytic Note: when network conditions are good, you can not self yum source
# echo '10 .0.0.1 mirrors.aliyuncs.com mirrors.aliyun.com repo.zabbix.com ' >> / etc / the hosts
# reference https://www.cnblogs.com/clsn/p/7885990.html#auto_id_16
# zabbix installation source, aliyun YUM source
curl -o /etc/yum.repos.d/CentOS-Base.repo http : //mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# RPM http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm -ivh
RPM -ivh http://repo.zabbix.com/zabbix/ 4.0 / RHEL /. 7 / the x86_64 / ZABBIX-Release-4.0-1.el7.noarch.rpm

# mounted ZABBIX
yum the install ZABBIX-Web-Server-ZABBIX MySQL MySQL ZABBIX-Agent--Y

# installation startup database mariadb
-y install MariaDB Server-yum
systemctl Start mariadb.service
systemctl enable mariadb.service

# create a database
MySQL -e 'the Create Database Character zabbix the SET utf8 COLLATE utf8_bin;'
. MySQL -e 'Grant All privileges ON * zabbix to zabbix @ localhost IDENTIFIED by "ZABBIX"; '

# import data
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | MySQL -uzabbix -pzabbix ZABBIX

# zabbixserver connection configuration MySQL
Sed -i.ori' = 115a DBPassword ZABBIX '/etc/zabbix/zabbix_server.conf

# zone when adding
Sed -i.ori' php_value to the date.timezone Asia 18a / of Shanghai '/etc/httpd/conf.d/zabbix.conf

# solve Chinese distortion
yum -y install wqy- Fonts-microhei
\ /usr/share/fonts/wqy-microhei/wqy-microhei.ttc cp / usr / report this content share / Fonts / dejavu / DejaVuSans.ttf

# Start Service
systemctl restart zabbix-Server Agent zabbix-httpd
systemctl enable zabbix-httpd Server Agent zabbix-

# output
echo "browser to visit http: //` hostname -I | awk '{print $ 1}' `/ zabbix"

 

Second, the client configuration

#! / bin / bash
#clsn

# Sets the parse
# zabbix installation source, aliyu nYUM source
rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1. el7.noarch.rpm

# zabbix client installation
yum the install zabbix Agent -Y-
Sed -i.ori 'S # = 127.0.0.1 Server Server # # = 192.168.100.210' /etc/zabbix/zabbix_agentd.conf
systemctl Start zabbix- agent.service

# write boot from the start
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service

Guess you like

Origin www.cnblogs.com/lixaingyang/p/12133960.html