首先停止服務(wù)
# 停止zabbix server和agent
service zabbix-server stop
service?zabbix-agent?stop
service?httpd?stop
yum卸載看這篇:http://www.cnblogs.com/liaojie970/p/6138075.html
手動(dòng)安裝就是個(gè)坑
1、因?yàn)榘惭b了zabbix2.2,但是centos6有沒有zabbix3.0的源秒拔,試了好幾種方式都不行聊训,所以串塑,只好采用手工安裝了战转,去官網(wǎng)下載zabbix3.0.11的穩(wěn)定版躬审,解壓縮
2枉证、然后是./configure--prefix=/usr/local/zabbix--enable-server--enable-agent--with-mysql--enable-ipv6--with-net-snmp--with-libcurl--with-libxml2
3矮男、接著,make && make install
4室谚、簡(jiǎn)歷軟連接
ln-s /usr/local/zabbix/sbin/*/usr/local/sbin/ #添加系統(tǒng)軟連接
ln-s /usr/local/zabbix/bin/*/usr/local/bin/ #添加系統(tǒng)軟連接
5毡鉴、配置服務(wù),這一步因?yàn)橹坝邪惭b過(guò)舞萄,檢查一下發(fā)現(xiàn)不用改
vi /etc/services #編輯眨补,在最后添加以下代碼
# Zabbix
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
zabbix-trapper 10051/udp # Zabbix Trapper
6、zabbix配置文件
修改zabbix配置文件倒脓,配置zabbix_server
cd /usr/local/zabbix/etc
vi /usr/local/zabbix/etc/zabbix_server.conf
DBName=zabbix #數(shù)據(jù)庫(kù)名稱
DBUser=zabbix #數(shù)據(jù)庫(kù)用戶名
DBPassword=123456 #數(shù)據(jù)庫(kù)密碼
ListenIP=localhost #數(shù)據(jù)庫(kù)ip地址
AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts #zabbix運(yùn)行腳本存放目錄
7撑螺、agent的配置
vi /usr/local/zabbix/etc/zabbix_agentd.conf
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1 #啟用自定義key
8、添加服務(wù)
cp /home/zabbix/zabbix-3.0.11/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server #服務(wù)端
cp /home/zabbix/zabbix-3.0.11/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd #客戶端
9崎弃、數(shù)據(jù)庫(kù)重新創(chuàng)建
cd /home/zabbix/zabbix-3.0.11/database/mysql
mysql-u root-p #輸入密碼甘晤,進(jìn)入MySQL控制臺(tái)
create database zabbix character set utf8;#創(chuàng)建數(shù)據(jù)庫(kù)zabbix,并且數(shù)據(jù)庫(kù)編碼使用utf8
GRANT USAGE ON*.*TO'user01'@'localhost'IDENTIFIED BY'123456'WITH GRANTOPTION;#新建賬戶zabbix饲做,密碼123456
flush privileges;#再次刷新系統(tǒng)授權(quán)表
grant all on zabbix.*to'zabbix'@'localhost'identified by'123456'with grantoption;#允許賬戶zabbix能從本機(jī)連接到數(shù)據(jù)庫(kù)zabbix
flush privileges;#再次刷新系統(tǒng)授權(quán)表
use zabbix #進(jìn)入數(shù)據(jù)庫(kù),并刷新數(shù)據(jù)庫(kù)线婚,一定要按照sql文件順序
mysql -u root -p zabbix < schema.sql
mysql -u root -p zabbix < images.sql
mysql -u root -p zabbix < data.sql
10、拷貝文件
cd /home/zabbix/zabbix-3.0.11/frontends
cp-rf php /var/www/html/zabbix
11盆均、啟動(dòng)服務(wù)
service httpd start
service zabbix_server start
service zabbix_agent start
這篇文章參考價(jià)值比較大:http://blog.csdn.net/qq_14821541/article/details/51726485
12塞弊、客戶端手動(dòng)添加
【參見這篇文章】http://blog.csdn.net/csolo/article/details/53106141