[技术干货] ZABBIX3.0升级到3.2步骤

[复制链接]
张益达 发表于 2018-11-14 16:46:04 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
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 /var/www/html/zabbix /var/www/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.安装编译
yum install -y libssh2-devel
./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
make && make install

4.修改配置参数
cp /usr/local/zabbix.bak/etc/zabbix_agentd.conf /usr/local/zabbix/etc/zabbix_agentd.conf
cp /usr/local/zabbix.bak/etc/zabbix_server.conf /usr/local/zabbix/etc/zabbix_server.conf
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

5.修改网页参数
mkdir /var/www/html/zabbix
cp -a /root/zabbix-3.2.11/frontends/php/* /var/www/html/zabbix
chown -R zabbix.zabbix /var/www/html/zabbix/
chmod -R 755 /var/www/html/zabbix/
cp /var/www/html/zabbix.bak/conf/zabbix.conf.php /var/www/html/zabbix/conf/zabbix.conf.php


6.重建历史表
mysql -uroot -p
use zabbix;
DROP TABLE history_log;
DROP TABLE history_text;

CREATE TABLE `history_log` (
`id` BIGINT(20) UNSIGNED NOT NULL,
`itemid` BIGINT(20) UNSIGNED NOT NULL,
`clock` INT(11) NOT NULL DEFAULT '0',
`timestamp` INT(11) NOT NULL DEFAULT '0',
`source` VARCHAR(64) NOT NULL DEFAULT '' COLLATE 'utf8_bin',
`severity` INT(11) NOT NULL DEFAULT '0',
`value` TEXT NOT NULL COLLATE 'utf8_bin',
`logeventid` INT(11) NOT NULL DEFAULT '0',
`ns` INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE INDEX `history_log_2` (`itemid`, `id`),
INDEX `history_log_1` (`itemid`, `clock`)
)
COLLATE='utf8_bin'
ENGINE=InnoDB
;


CREATE TABLE `history_text` (
`id` BIGINT(20) UNSIGNED NOT NULL,
`itemid` BIGINT(20) UNSIGNED NOT NULL,
`clock` INT(11) NOT NULL DEFAULT '0',
`timestamp` INT(11) NOT NULL DEFAULT '0',
`source` VARCHAR(64) NOT NULL DEFAULT '' COLLATE 'utf8_bin',
`severity` INT(11) NOT NULL DEFAULT '0',
`value` TEXT NOT NULL COLLATE 'utf8_bin',
`logeventid` INT(11) NOT NULL DEFAULT '0',
`ns` INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE INDEX `history_text_2` (`itemid`, `id`),
INDEX `history_text_1` (`itemid`, `clock`)
)
COLLATE='utf8_bin'
ENGINE=InnoDB
;


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






上一篇:如何使用Zabbix进行IPMI监控?
下一篇:mysql5.6升级至5.7(物理方式)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝0

帖子13

发布主题
最新发布

乐维社区

微信公众号

版权所有 © 2016-2021 九一乐维丨粤ICP备17007026号