zabbix 2.4.7代理升级到zabbix 3.2.3

电脑杂谈  发布时间:2020-03-30 05:08:31  来源:网络整理

zabbix和nagios哪个好_zabbix proxy_zabbix proxy

将zabbix服务器升级到3.2.3之后,代理还可以在Windows下使用2.4.7代理程序zabbix proxy,并且代理需要升级到3.2.3. 以下是zabbix代理从2.4.7升级到3.2.3的过程的记录.

1. 挂起zabbix代理

/etc/init.d/zabbix_proxy停止/etc/init.d/zabbix_agentd停止

zabbix proxy_zabbix proxy_zabbix和nagios哪个好

2. 备份2.4.7的配置文件

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

3. 安装zabbix 3.2.3

zabbix proxy_zabbix proxy_zabbix和nagios哪个好

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/

zabbix proxy_zabbix和nagios哪个好_zabbix proxy

5. 启动代理和代理.

启动代理后,将自动升级. 启动代理后zabbix 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

zabbix proxy_zabbix和nagios哪个好_zabbix proxy

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

日志升级完成后,可以使用代理的新版本进行监视.


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-157370-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...