专栏首页Laoqi's Linux运维专列zabbix 2.4.7 proxy代理端升级到zabbix 3.2.3

zabbix 2.4.7 proxy代理端升级到zabbix 3.2.3

zabbix server端升级到3.2.3以后,windows下agent端还可以使用2.4.7的agent程序,proxy端需要升级到3.2.3。下面是记录zabbix proxy端从2.4.7升级到3.2.3的过程。

1、暂停zabbix proxy

/etc/init.d/zabbix_proxy stop /etc/init.d/zabbix_agentd stop

2、备份2.4.7的配置文件

mv /usr/local/zabbix /usr/local/zabbix-2.4.7bak

3、安装zabbix 3.2.3

tar zxvf zabbix-3.2.3.tar.gz
cd zabbix-3.2.3
ln -s /usr/local/curl/bin/curl* /usr/local/bin #方便--with-libcurl使用
groupadd zabbix
useradd -g zabbix zabbix -s /sbin/nologin
./configure --prefix=/usr/local/zabbix --enable-agent --enable-proxy \
--sysconfdir=/etc/zabbix \
--with-mysql=/usr/local/mysql/bin/mysql_config \
--with-net-snmp --with-libcurl --with-libxml2
make && make install

4、修改下配置文件:

egrep -v "^#|^$" /etc/zabbix/zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
Server=zabbix server IP
ServerActive=zabbix server IP
Hostname=HKproxy #定义Proxy的名字,Server端直接填写名字即可
 RefreshActiveChecks=60
Include=/etc/zabbix/zabbix_agentd.conf.d/
 UnsafeUserParameters=1

# egrep -v "^#|^$" /etc/zabbix/zabbix_proxy.conf
Server=zabbix server IP
Hostname=HKproxy #定义Proxy的名字,Server端直接填写名字即可
LogFile=/tmp/zabbix_proxy.log
 PidFile=/tmp/zabbix_proxy.pid
DBName=zabbix
DBUser=zabbix
 DBPassword=password
 ProxyLocalBuffer=24
 ProxyOfflineBuffer=24
 HeartbeatFrequency=60
 ConfigFrequency=100
 DataSenderFrequency=1
 StartPollers=25
 StartIPMIPollers=10
 StartPollersUnreachable=2
 StartTrappers=10
 StartPingers=20
 StartDiscoverers=20
 StartHTTPPollers=20
 StartVMwareCollectors=10
 VMwareCacheSize=20M
 CacheSize=100M
 HistoryCacheSize=100M
 HistoryIndexCacheSize=200M
Timeout=4
 FpingLocation=/usr/sbin/fping
LogSlowQueries=3000
 Include=/etc/zabbix/zabbix_proxy.conf.d/

5、启动agentd和proxy就行。

启动proxy时会自动升级数据库。启动proxy以后可以看到以下日志:

tail -f zabbix_proxy.log
25873:20170130:202334.716 required mandatory version: 03020000
 25873:20170130:202334.716 starting automatic database upgrade
 25873:20170130:202334.737 completed 0% of database upgrade
 25873:20170130:202334.739 completed 1% of database upgrade
 25873:20170130:202338.428 slow query: 3.688917 sec, "alter table proxy_history add lastlogsize bigint unsigned default '0' not null"
 25873:20170130:202342.190 slow query: 3.754072 sec, "alter table proxy_history add mtime integer default '0' not null"
 25873:20170130:202342.192 completed 2% of database upgrade
 25873:20170130:202345.832 slow query: 3.640205 sec, "alter table proxy_history add meta integer default '0' not null"
 25873:20170130:202345.851 completed 3% of database upgrade
 25873:20170130:202345.938 completed 4% of database upgrade
 25873:20170130:202346.060 completed 5% of database upgrade
 25873:20170130:202346.127 completed 6% of database upgrade
 25873:20170130:202346.140 completed 7% of database upgrade
 25873:20170130:202346.146 completed 8% of database upgrade
 25873:20170130:202346.249 completed 9% of database upgrade
......
......
......
 25873:20170130:202352.547 completed 98% of database upgrade
 25873:20170130:202352.594 completed 99% of database upgrade
 25873:20170130:202352.596 completed 100% of database upgrade
 25873:20170130:202352.596 database upgrade fully completed

6、zabbix_proxy启动脚本:

#!/bin/sh
# chkconfig: 345 95 95
# desctription: Zabbix Proxy
# Zabbix
# Copyright (C) 2001-2013 Zabbix SIA
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Start/Stop the Zabbix agent daemon.
# Place a startup script. in /sbin/init.d, and link to it from /sbin/rc[023].d
SERVICE="Zabbix proxy"
DAEMON=/usr/local/zabbix/sbin/zabbix_proxy
PIDFILE=/tmp/zabbix_agentd.pid
BASEDIR=/usr/local/zabbix/
ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_proxy
case $1 in
'start')
if [ -x ${DAEMON} ]
then
$DAEMON
# Error checking here would be good...
echo "${SERVICE} started."
else
echo "Can't find file ${DAEMON}."
echo "${SERVICE} NOT started."
fi
;;
'stop')
if [ -s ${PIDFILE} ]
then
if kill `cat ${PIDFILE}` >/dev/null 2>&1
then
echo "${SERVICE} terminated."
rm -f ${PIDFILE}
fi
fi
;;
'restart')
$0 stop
sleep 10
$0 start
;;
*)
echo "Usage: $0 start|stop|restart"
;;
esac

查看日志数据库升级完成以后就可以使用新版本的代理来进行监控了。

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • 如何通过命令行来监控zabbix

    老七Linux
  • 配置zabbix架构

    老七Linux
  • 集群架构の のzabbix 监控

    老七Linux
  • zabbix 配置自动发现与自动注册

    注:本文基于:https://blog.51cto.com/14227204/2474670

    小手冰凉
  • Zabbix监控客户端及实现邮件、微信报警

    zabbix服务端部署可参考:https://blog.51cto.com/14227204/2474670 注:本文是基于上述链接

    小手冰凉
  • zabbix agentd客户端插件Shell一键自动安装脚本

    这次生产环境上线了多台 Linux 服务器,需要全部纳入 Zabbix 监控范畴,一台一台的去装 Zabbix Agentd 插件那就太苦逼了,所幸 Zabbi...

    张戈
  • CentOS 6.7 安装zabbix-agent

    版权声明:本文为木偶人shaon原创文章,转载请注明原文地址,非常感谢。 https://b...

    shaonbean
  • zabbix yum源安装笔记

    按下列步骤安装企业yum源,再修改yum源配置文件:/etc/yum.repos.d/remi.repo,开启源remi-php56

    拓荒者
  • zabbix agent 部署

    cat /usr/local/zabbix-agent/etc/zabbix_agentd.conf

    晴天Online
  • ansible-playbook调用zabbix-api自动添加主机

    版权声明:本文为木偶人shaon原创文章,转载请注明原文地址,非常感谢。 https://b...

    shaonbean

扫码关注云+社区

领取腾讯云代金券