【Zabbix】ZABBIX3.2升級3.4

樂維君_發表於2018-12-03

1.停止zabbix服務

service zabbix_server stop
service zabbix_agentd stop
/usr/local/zabbix/sbin/zabbix_java/shutdown.sh



2.儲存配置檔案

mv /usr/local/zabbix /usr/local/zabbix.bak
mv /usr/local/nginx/html/zabbix /usr/local/nginx/html/zabbix.bak
cp /etc/init.d/zabbix_server /etc/init.d/zabbix_server_bak
cp /etc/init.d/zabbix_agentd /etc/init.d/zabbix_agentd_bak



3.更新libevent


tar -zxfv libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure
make && make install
ln -s /usr/local/lib/libevent-2.1.so.6 /usr/lib64/


4.編譯安裝zabbix3.4
tar -zxfv zabbix-3.4.7.tar.gz
cd zabbix-3.4.7
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 -with-unixodbc --with-ssh2 --with-openipmi --enable-ipv6 --enable-java
./configure
make && make install

5.修改配置引數

cp /usr/local/zabbix.bak/etc/zabbix_agentd.conf /usr/local/zabbix/etc/zabbix_agentd.conf
mv /usr/local/zabbix.bak/scripts  /usr/local/zabbix/
mv /usr/local/zabbix.bak/etc/zabbix_agentd.conf.d   /usr/local/zabbix/etc/
mv /usr/local/zabbix.bak/sbin/zabbix_java /usr/local/zabbix/sbin/
vi /usr/local/zabbix.bak/etc/zabbix_server.conf

     #3.4和3.2相比配置引數增加了,需要手動配置或者用已做好的3.4配置檔案替換,修改IP即可

mkdir -p /usr/local/zabbix/logs
chown -R zabbix:zabbix /usr/local/zabbix
mv /etc/init.d/zabbix_server_bak /etc/init.d/zabbix_server
mv /etc/init.d/zabbix_agentd_bak /etc/init.d/zabbix_agentd



6.修改網頁引數

mkdir /usr/local/nginx/html/zabbix
cp -a /root/zabbix-3.4.7/frontends/php/* /usr/local/nginx/html/zabbix
cp /usr/local/nginx/html/zabbix/conf/zabbix.conf.php.example /usr/local/nginx/html/zabbix/conf/zabbix.conf.php
vi  /usr/local/nginx/html/zabbix/conf/zabbix.conf.php

     #3.4和3.2相比配置引數增加了,需要手動配置或者用已做好的3.4配置檔案替換,修改IP即可

chown -R zabbix.zabbix /usr/local/nginx/html/zabbix/
chmod -R 755 /usr/local/nginx/html/zabbix/




7.啟動zabbix

chkconfig --add zabbix_server
chkconfig --add zabbix_agentd
chkconfig --level 35 zabbix_agentd on
chkconfig --level 35 zabbix_server on
service snmpd restart
service mysqld restart
service httpd restart
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start
/usr/local/zabbix/sbin/zabbix_java/startup.sh



8觀察日誌
vi /usr/local/zabbix/logs/zabbix_server.log

29303:20181012:202522.157 Starting Zabbix Server. Zabbix 3.4.7 (revision 77720).
29303:20181012:202522.157 ****** Enabled features ******
29303:20181012:202522.157 SNMP monitoring:           YES
29303:20181012:202522.157 IPMI monitoring:           YES
29303:20181012:202522.157 Web monitoring:            YES
29303:20181012:202522.157 VMware monitoring:         YES
29303:20181012:202522.157 SMTP authentication:        NO
29303:20181012:202522.157 Jabber notifications:       NO
29303:20181012:202522.157 Ez Texting notifications:  YES
29303:20181012:202522.157 ODBC:                      YES
29303:20181012:202522.157 SSH2 support:              YES
29303:20181012:202522.157 IPv6 support:              YES
29303:20181012:202522.157 TLS support:                NO
29303:20181012:202522.157 ******************************
29303:20181012:202522.157 using configuration file: /usr/local/zabbix/etc/zabbix_server.conf
29303:20181012:202522.224 current database version (mandatory/optional): 03020000/03020000
29303:20181012:202522.224 required mandatory version: 03040000
29303:20181012:202522.224 optional patches were found
29303:20181012:202522.224 starting automatic database upgrade
29303:20181012:202522.251 completed 0% of database upgrade
29303:20181012:202522.759 completed 1% of database upgrade
....................略
29303:20181012:202529.444 completed 100% of database upgrade
29303:20181012:202529.444 database upgrade fully completed

        #資料庫自動升級成功



# 再次重啟zabbix可以看到資料庫已經成3.4的了
service zabbix_server restart
vi /usr/local/zabbix/logs/zabbix_server.log

29428:20181012:202928.286 Starting Zabbix Server. Zabbix 3.4.7 (revision 77720).
29428:20181012:202928.288 ****** Enabled features ******
29428:20181012:202928.288 SNMP monitoring:           YES
29428:20181012:202928.288 IPMI monitoring:           YES
29428:20181012:202928.288 Web monitoring:            YES
29428:20181012:202928.289 VMware monitoring:         YES
29428:20181012:202928.289 SMTP authentication:        NO
29428:20181012:202928.289 Jabber notifications:       NO
29428:20181012:202928.289 Ez Texting notifications:  YES
29428:20181012:202928.289 ODBC:                      YES
29428:20181012:202928.292 SSH2 support:              YES
29428:20181012:202928.292 IPv6 support:              YES
29428:20181012:202928.292 TLS support:                NO
29428:20181012:202928.292 ******************************
29428:20181012:202928.292 using configuration file: /usr/local/zabbix/etc/zabbix_server.conf
29428:20181012:202928.368 current database version (mandatory/optional): 03040000/03040006
29428:20181012:202928.368 required mandatory version: 03040000


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31561206/viewspace-2222509/,如需轉載,請註明出處,否則將追究法律責任。

相關文章