【Zabbix】ZABBIX3.0升級到3.2步驟

樂維君_發表於2018-12-03
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


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31561206/viewspace-2222507/,如需轉載,請註明出處,否則將追究法律責任。

相關文章