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 条评论
登录 后参与评论

相关文章

来自专栏蓝天

Hive 0.12.0安装指南

本文的安装参照了官方的文档:GettingStarted,将Hive 0.12.0安装在Hadoop 2.4.0上。本文将Hive配置成Server模式,并...

693
来自专栏JAVA技术站

Spring整合Rabbitmq

没有找到一篇完整的文章介绍Spring如何整合Rabbitmq应用,琢磨一天搞出的一个入门的demo与伙伴们分享.

662
来自专栏Kubernetes

Kubernetes Nginx Ingress Controller源码分析

main controllers/nginx/pkg/cmd/controller/main.go:29 func main() { // start a ...

52110
来自专栏JavaEE

ssm整合案例(超级详细)spring+springmvc+mybatis整合案例

44710
来自专栏码神联盟

重磅来袭,抱歉,来晚啦

来一波 、基本概念 1.1、spring Spring 是一个开源框架, Spring 是于 2003 年兴起的一个轻量级的 Java 开发框架,由 Ro...

35711
来自专栏帘卷西风的专栏

Cmake在windows支持预编译头文件(stdafx.h)

      最近一直在研究cmake构建项目,之前接触cmake的时候就感觉不太喜欢cmake,觉得它太乱了,产生了太多的中间文件,产生的项目文件也不是特别友好...

2675
来自专栏微服务那些事儿

Spring Cloud 系列-事件监听

强推一波:https://segmentfault.com/ls/1650000011386794

2274
来自专栏帘卷西风的专栏

Cmake在windows支持预编译头文件(stdafx.h)

      最近一直在研究cmake构建项目,之前接触cmake的时候就感觉不太喜欢cmake,觉得它太乱了,产生了太多的中间文件,产生的项目文件也不是特别友好...

1242
来自专栏个人分享

spark单机模式简单搭建

待安装列表 hadoop hive scala spark 一.环境变量配置: ~/.bash_profile PATH=$PATH:$HOME/bin

4741
来自专栏乐沙弥的世界

重新配置与卸载 11gR2 Grid Infrastructure

      Oracle 11g R2 Grid Infrastructure 的安装与配置较之前的版本提供了更多的灵活性。在Grid Infrastructu...

941

扫码关注云+社区

领取腾讯云代金券