Zabbix是许多企业的运维工作人员日常使用的一款开源监控软件,然后面对zabbix小版本的更新迭代,小编这里整理出了一些便捷方式和注意事项。Zabbix是开源监控的集大成者之一,Zabbix还可以监控服务器、操作系统、数据库等绝大多数系统资源,本文介绍一下如何快速升级zabbix版本,更多Zabbix监控技术可关注乐维zabbix技术分享(https://www.lwops.cn/index.php/anl/10962)。

第一步:zabbix源码包下载地址:
https://cdn.zabbix.com/zabbix/sources/stable/5.0/
第二步:停zabbix_server服务
service zabbix_server stop
第三步:停zabbix_agentd服务
service zabbix_agentd stop
第四步:停zabbix_java服务
sh /itops/zabbix/sbin/zabbix_java/shutdown.sh
第四步:拷贝原zabbix文件
mv /itops/zabbix /itops/zabbix.back
第五步:上传新版本zabbix源码包到/root目录
sz zabbix-5.0.25.tar.gz
第五步:解压zabbix源码包
tar -xvf /root/zabbix-5.0.25.tar.gz && cd /root/zabbix-5.0.25
第六步:安装gcc
yum install -y gcc
编译源码包
编译安装
./configure --prefix=/itops/zabbix --enable-server --enable-agent --with-postgresql=/itops/postgresql/bin/pg_config --with-net-snmp=/itops/net-snmp/bin/net-snmp-config --with-libcurl --with-libxml2 --with-unixodbc --with-openipmi --enable-ipv6 --enable-java --with-openssl --with-ssh2 --with-iconv --with-iconv-include --with-iconv-lib --with-libpcre --with-libpcre-include --with-libpcre-lib --with-libevent --with-libevent-include --with-zlib --with-zlib-include --with-zlib-lib --with-libpthread --with-libpthread-include --with-libpthread-lib --with-libevent-lib --with-ldap
=======================================================================================
免编译安装
yum -y install java-devel unixODBC* zlib libpthread pcre* ipmitool curl-devel gnutls libcurl-devel perl-DBI libdbi-dbd-mysql gcc gcc++ make libxml2 libxml2-devel unixODBC* libssh2-devel freetds telnet nmap mysql-connector-odbc libevent-devel
./configure --prefix=/itops/zabbix --enable-server --enable-agent --with-postgresql=/itops/postgresql/bin/pg_config --with-net-snmp=/itops/net-snmp/bin/net-snmp-config --with-libcurl --with-libxml2 --with-unixodbc --with-openipmi --enable-ipv6 --enable-java --with-openssl --with-ssh2 --with-iconv --with-iconv-include --with-iconv-lib --with-libpcre --with-libpcre-include --with-libpcre-lib --with-libevent --with-libevent-include --with-zlib --with-zlib-include --with-zlib-lib --with-libpthread --with-libpthread-include --with-libpthread-lib --with-libevent-lib --with-ldap
注意: 如果环境是免编译安装,在编译过程中少了一些包直接用YUM安装
编译并安装
make && make install
将原来的配置文件复制回目录
cp -rf /itops/zabbix.back/etc/* /itops/zabbix/etc/
cp -rf /itops/zabbix.back/scripts /itops/zabbix/
cp -rf /itops/zabbix.back/share/* /itops/zabbix/share/
mkdir /itops/zabbix/logs
chown -R itops: /itops/zabbix
前端UI替换
mv /itops/nginx/html/zabbix /itops/nginx/html/zabbix.back
cp -rf /root/zabbix-5.0.24/ui /itops/nginx/html/zabbix
chown -R itops: /itops/nginx/html/zabbix
第七步:重启zabbix_java服务
sh /itops/zabbix/sbin/zabbix_java/startup.sh
第八步:重启zabbix_server服务
service zabbix_server restart
第九步:重启zabbix_agentd服务
service zabbix_agentd restart
最后:前端页面访问:
http://192.168.200.180/z/
