zabbix 2.03 源碼編譯及安裝配置

來源:互聯網
上載者:User

一、首先在官網上下載zabbix 2.0.3源碼包:

http://www.zabbix.com/download.php

二、在ubuntu_server_12.04上配置安裝基礎環境:
#apt-get update
#apt-get install apache2 mysql-server mysql-client php5 php5-gd php5-mysql libapache2-mod-php5 libcurl4-openssl-dev libsnmp-dev

   設定資料庫:
# mysql -u<username> -p<password>
mysql> create database zabbix character set utf8;
mysql> quit;
//把源碼包中database/mysql下的資料庫表匯入資料庫。
# mysql -u<username> -p<password> zabbix < database/mysql/schema.sql
# mysql -u<username> -p<password> zabbix < database/mysql/images.sql
# mysql -u<username> -p<password> zabbix < database/mysql/data.sql

三、安裝編譯環境:
#apt-get make gcc

四、編譯server端源碼(參數可自由選擇):
配置參數說明:
--enable-server 安裝 Zabbix Server
--enable-proxy 安裝 Zabbix Proxy
--enable-agent 安裝 Zabbix Agent
--with-mysql 使用 mysql 做資料庫伺服器
--with-net-snmp 支援 SNMP
--with-libcurl 支援 curl,用於 web 監控

#./configure --prefix=/usr/local --enable-server --enable-agent --with-mysql  --with-net-snmp --with-libcurl

五、配置server:
1、在/etc/services下查看是否配置zabbix-trapper 10051/tcp和zabbix-trapper 10051/udp兩項,如果沒有配置,添加上;
2、修改設定檔:
#vi /usr/local/etc/zabbix_server.conf
ListenPort=10051
LogFile=/tmp/zabbix_server.log
PidFile=/tmp/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=root
DBPassword=Jovaunn1
DBSocket=/var/run/mysqld/mysqld.sock
DBPort=3306
3、拷貝zabbix-agent到/etc/init.d下:
#cp zabbix-2.0.3/misc/init.d/debian/zabbix-server /etc/init.d
並修改zabbix-server中DAEMON和DESC兩項分別為:
NAME=zabbix_server
DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix server daemon"
PID=/tmp/$NAME.pid
4、重啟server服務:
#service zabbix-server restart

六、配置Web服務:
1、複製 Web Interface 到 web 目錄:
#sudo mkdir /var/www/zabbix 
#sudo chown -R zabbix.zabbix /var/www/zabbix
#cp -r frontends/php/*  /var/www/zabbix
2、編輯php.ini檔案:    
#sudo vi /etc/php5/apache2/php.ini
max_execution_time = 600 
max_input_time = 600
memory_limit = 256M 
post_max_size =32M 
upload_max_filesize = 16M
;date.timezone = ==>去掉注釋在=後添加 Asia/Shanghai
#sudo vi /etc/apache2/apache2.conf 
加入下列一行 ServerName 127.0.0.1
3、重啟apache服務並以http://server_ip/zabbix訪問,根據提示進行初始化配置。

七、配置用戶端:
1、編譯用戶端(用戶端可以在本機或別的伺服器上安裝配置)
./configure --enable-agent --prifix=/usr/local
2、在/etc/services下查看是否配置zabbix-agent 10050/tcp和zabbix-agent 10050/udp兩項,如果沒有配置,添加上;
3、修改配置:
#vi /usr/local/etc/zabbix_agent.conf
Server=server_ip
4、拷貝zabbix-agent到/etc/init.d下:
#cp zabbix-2.0.3/misc/init.d/debian/zabbix-agent /etc/init.d
並修改zabbix-server中DAEMON和DESC兩項分別為:
NAME=zabbix_agentd
DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix agent daemon"
PID=/tmp/$NAME.pid
5、重啟agent服務:

#service zabbix-agent restart



web登入,管理員身份:

帳號:admin

密碼:zabbix


參考:http://www.zabbix.com/documentation/2.0/manual/installation/install

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.