Source compiler installation zabbix server and agent terminal end

[root@localhost ~]# yum -y install net-snmp net-snmp-devel libxml2 libxml2-devel libcurl-devel libevent libevent libevent-devel curl curl-devel mysql-devel snmp perl-DBI php-xml php-bcmath php-mbstring php-ldap php-xmlrpc httpd php php-mysql php-common php-gd php-odbc php-pear gcc* net-snmp libssh2 libssh2-devel mariadb-server mariadb mariadb-devel ntpdate	##安装依赖

[root@localhost ~]# ntpdate ntp1.aliyun.com		##配置时间同步

[root@localhost ~]# echo "ntpdate ntp1.aliyun.com" >> /etc/rc.local

[root@localhost ~]# tar -xf zabbix-3.4.2.tar.gz

[root@localhost ~]# cd zabbix-3.4.2

[root @ localhost zabbix-3.4.2] # ./configure --prefix = / usr / local / zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net- snmp --with-libcurl --with-libxml2 --enable -java ## if there is an error "error: Unable to use libevent ( libevent check failed)" 
this is because libevent-devel is not installed because the package source is not local yum we can use the source Ali installation; if error "error: Unable to find" appears javac "executable in path" devel-install the Java, 

[root @ localhost ~] # CAT /etc/yum.repos.d/aliyun.repo Ali source ## arranged 
[aliyun] 
name = aliyun 
BaseURL = HTTPS: //mirrors.aliyun.com/centos/7/os/x86_64/ 
Enabled. 1 = 
gpgcheck. 1 = 
gpgkey = HTTPS: //mirrors.aliyun.com/centos /. 7 / OS / the x86_64 / the RPM-the GPG-KEY. 7-the CentOS- 
keepcache = ##. 1 yum rpm package installation will be downloaded locally. save path / var / cache / yum / x86_64 / 7 / aliyun / packages /

[root@localhost ~]# yum install java-devel libevent-devel

[root@localhost zabbix-3.4.2]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --enable-java		##重新配置

[root@localhost zabbix-3.4.2]# make && make install		##编译安装

[root@localhost ~]# systemctl start mariadb && systemctl enable mariadb

[root@localhost ~]# systemctl start httpd && systemctl enable httpd

[root@localhost ~]# mysqladmin password root		##修改mysql密码

[root@localhost ~]# mysql -uroot -proot

MariaDB [(none)]> create database if not exists zabbix default character set utf8 collate utf8_general_ci;

MariaDB [(none)]> use zabbix;

MariaDB [ZABBIX]> Source /root/zabbix-3.4.2/database/mysql/schema.sql; 

MariaDB [ZABBIX]> Source /root/zabbix-3.4.2/database/mysql/images.sql; 

MariaDB [ZABBIX] > source /root/zabbix-3.4.2/database/mysql/data.sql; ## zabbix script to create the database 

MariaDB [zabbix]> grant all on zabbix * to zabbix@'192.168.0.101 'identified by' zabbix '.; ## zabbix create a database user password zabbix have on this address 192.168.0.101 zabbix database for all permissions 

MariaDB [zabbix]> flush privileges; ## refresh, save the changes 

MariaDB [zabbix]> show grants for zabbix@'192.168.0.101 ' ; ## permission to view 

[root @ localhost ~] # mkdir / usr / local / zabbix / logs ## zabbix create log directory 

[root @ localhost ~] # chown zabbix: zabbix / usr / local / zabbix / logs / -R # # Empowering

[root @ localhost ~] # sed -i 's / LogFile = \ / tmp \ /zabbix_server.log/LogFile = \ / usr \ / local \ / zabbix \ / logs \ /zabbix_server.log/g' / usr / local /zabbix/etc/zabbix_server.conf ## zabbix modified log file directory 

[root @ localhost ~] # sed -i 's / # PidFile = \ / tmp \ /zabbix_server.pid/PidFile = \ / tmp \ / zabbix_server. pid / g '/usr/local/zabbix/etc/zabbix_server.conf ## zabbix_server pid open annotation file 

[root @ localhost ~] # sed -i' s / # DBHost = localhost / DBHost = 192.168.0.101 / g ' IP address configuration database /usr/local/zabbix/etc/zabbix_server.conf ## 

[root @ localhost ~] # sed -i 's / # DBPassword = / DBPassword = zabbix / g' / usr / local / zabbix / etc /zabbix_server.conf ## zabbix configuration database user password 

[root @ localhost ~] # sed -i 's / # DBSocket = \ / tmp \ /mysql.sock/DBSocket = \ / var \ / lib \ / mysql \ / mysql.sock / g '/ usr / local / zabbix / etc / zabbix_server.conf ## configuration database user's password zabbix

[root @ localhost ~] # sed -i 's / # Include = \ / usr \ / local \ / etc \ /zabbix_server.conf.d \ / \ *. conf / Include = \ / usr \ / local \ / zabbix \ / etc \ /zabbix_server.conf.d \ / \ *. conf / g '/usr/local/zabbix/etc/zabbix_server.conf ## arranged zabbix path and all the auxiliary profiles format 

[root @ localhost ~] # sed -i 's / # PidFile = \ / tmp \ /zabbix_agentd.pid/PidFile = \ / tmp \ /zabbix_agentd.pid/g' /usr/local/zabbix/etc/zabbix_agentd.conf ## open file zabbix_agentd pid Note 

[root @ localhost ~] # cp /usr/local/zabbix/etc/zabbix_agentd.conf{,_$(date +% F)} ## to the current date format file backup zabbix_agentd.conf 

[root @ localhost ~] << the END CAT #> /usr/local/zabbix/etc/zabbix_agentd.conf		 
the PidFile = / tmp / zabbix_agentd.pid 
Server = 127.0.0.1,192.168.100.101 
ServerActive = 192.168.100.101 
the Hostname = server.zabbix.com 
the Timeout = 30
= LogFile / usr / local / zabbix / logs / zabbix_agentd.log 
the Include = / usr / local / zabbix / etc / zabbix_agentd.conf.d / *. Conf 
END 
## rewrite zabbix_agetd.conf file 

[root @ localhost ~] # / usr / local / zabbix / sbin / zabbix_server ## open zabbix server 

[root @ localhost ~] # netstat -utpln | grep 10051 ## to see whether the port is listening 
tcp 0 0 0.0.0.0:10051 0.0.0.0:* lISTEN 51360 / zabbix_server 

[root @ localhost ~] # / usr / local / zabbix / sbin / zabbix_agentd ## open zabbix client 

[root @ localhost ~] # netstat -utpln | grep 10050 ## to see whether the port is listening 
tcp 0 0 0.0.0.0 : 51427 10050 0.0.0.0:* the LISTEN / zabbix_agentd 

[the root @ localhost ~] # Music Videos /root/zabbix-3.4.2/frontends/php/ / var / WWW / HTML / ## replication package ZABBIX

[root @ localhost ~] # chown -R apache: apache / var / www / html / zabbix / ## Empowerment 

[root @ server ~] # vi /etc/php.ini ## modify some of the parameters about php 
  878 date = Asia .timezone / of Shanghai 
  384 the max_execution_time 300 = 
  394 = 300 max_input_time directives in 
  672 post_max_size = 32M 
  405 128M the memory_limit = 
  854 = bcmath.so Extension 
: WQ 

[root @ localhost ~] # systemctl httpd service restart the restart httpd ## 

[root @ localhost ~ ] Music Videos /var/www/html/zabbix/fonts/DejaVuSans.ttf{,_$(date + #% F.)} 
[the root @ localhost ~] # Music Videos simkai.ttf / var / WWW / HTML / ZABBIX / Fonts / DejaVuSans.ttf ## set of pictures on the page zabbix web Chinese characters

  The browser then visit, http: // IP / zabbix default administrator account password: admin / zabbix

  Finally, configure host monitoring items in the chart

Guess you like

Origin www.cnblogs.com/kjjmj/p/11280520.html