2010年11月9日 星期二

網管工具 - Zabbix

OS:CentOS 5.5


Requirments:
httpd
php  php-gd  php-bcmath  php-xml  php-mbstring  php-mysql
mysql  mysql-devel
OpenIPMI  
openssh
net-snmp  net-snmp-devel

curl  curl-devel
gcc
zabbix-1.8.3

1.安裝相依套件
        yum  install  httpd  php  php-gd  php-bcmath  php-xml  php-mbstring  php-mysql  mysql  mysql-devel  OpenIPMI  openssh  net-snmp  net-snmp-devel  curl  curl-devel  gcc

2.下載Zabbix Source Code,解壓縮
        tar  -zxvf  zabbix-1.8.3.tar.gz

3.起動相關服務
        service  httpd  start; service  mysqld  start
        chkconfig  httpd  on; chkconfig  mysqld  on

4.設定Zabbix使用資料庫
        mysqladmin  -u  root  password  '管理者密碼'
        mysql  -u  root  -p
        create  database  zabbix  character  set  utf8;
        quit

5.建立Zabbix資料庫內容
        cd  zabbix-1.8.3/create/schema
        mysql  -u  root  -p  zabbix  <  mysql.sql
        cd  ../data
        mysql  -u  root  -p  zabbix  <  data.sql
        mysql  -u  root  -p  zabbix  <  images_mysql.sql

6.編譯Zabbix Source Code
        cd  /root/zabbix-1.8.3
        ./configure  --enable-server  --enable-agent  --with-mysql  --with-net-snmp  -with-libcurl
        make; make  install

7.著名Zabbix服務站用port
        vi  /etc/service
zabbix-agent     10050/tcp   Zabbix Agent
zabbix-agent     10050/udp  Zabbix Agent
zabbix-trapper  10051/tcp    Zabbix Trapper
zabbix-trapper  10051/udp   Zabbix Trapper 

8.修改組態檔
        mkdir  /etc/zabbix
        cp  /root/zabbix-1.8.3/misc/conf/zabbix_agent.conf  /etc/zabbix
vi  /etc/zabbix/zabbix_agent.conf
Server=Zabbix Server IP
        cp  /root/zabbix-1.8.3/misc/conf/zabbix_agentd.conf  /etc/zabbix
vi  /etc/zabbix/zabbix_agentd.conf
LogFile="Zabbix Agentd Log 位置"
Server="Zabbix Server IP"
Hostname="Zabbix Agent Hostname"

        cp  /root/zabbix-1.8.3/misc/conf/zabbix_server.conf  /etc/zabbix
        vi  /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=root
DBPassword=daniel
Timeout=3

9.設定Zabbix開機啟動
        mkdir  /usr/local/zabbix
        cp  /usr/local/sbin/zabbix_agentd  /usr/local/zabbix/bin
        cp  /usr/local/sbin/zabbix_server  /usr/local/zabbix/bin


        cd  /root/zabbix-1.8.3/misc/init.d/redhat/8.0
cp  zabbix_agentd  /etc/init.d/
cp  zabbix_server  /etc/init.d/
        service  zabbix_server  start; service zabbix_agentd start
        chkconfig  zabbix_server  on; chkconfig zabbix_agentd on

10.複製Zabbix網站檔案至網頁根目錄
        mkdir  /var/www/html/zabbix
        cp  /root/zabbix-1.8.3/frontends/php/*  /var/www/html/zabbix

11.安裝Zabbix Web GUI
        http://localhost/zabbix
        依照指示操作(圖形介面)

12.完成,登入(帳號:admin,密碼:zabbix)

參考文章:
http://www.zabbix.com/documentation/1.8/complete#installation

沒有留言:

張貼留言