自己寫的,詳細的zabbix安裝文件!

www.zabbix.com
http://www.zabbix.com/documentation/1.8/complete
http://www.zabbix.com/wiki/start

zabbix由2部分構成,zabbix server與可選元件zabbix agent。
zabbix server可以通過SNMP,zabbix agent,ping,埠監視等方法提供對遠端伺服器/網路狀態的監視,資料收集等功能,它可以執行在Linux, Solaris, HP-UX, AIX, Free BSD, Open BSD, OS X等平臺之上。
zabbix agent需要安裝在被監視的目標伺服器上,它主要完成對硬體資訊或與作業系統有關的記憶體,CPU等資訊的收集。zabbix agent可以執行在Linux ,Solaris, HP-UX, AIX, Free BSD, Open BSD, OS X, Tru64/OSF1, Windows NT4.0, Windows 2000/2003/XP/Vista)等系統之上。

zabbix server可以單獨監視遠端伺服器的服務狀態;同時也可以與zabbix agent配合,可以輪詢zabbix agent主動接收監視資料(trapping方式),同時還可被動接收zabbix agent傳送的資料(trapping方式)。
另外zabbix server還支援SNMP (v1,v2),可以與SNMP軟體(例如:net-snmp)等配合使用。
軟體需求:
Software                                        Version                                        Comments
Apache                                                 1.3.12 or later       
PHP                                                 5.0 or later       
PHP moduleshp-gd                        GD 2.0 or later                 PHP GD module must support PNG p_w_picpaths.
PHP TrueType support                                                                 –with-ttf
PHP bc support                                                                                php-bcmath, –enable-bcmath
PHP XML support                                                                                php-xml or php5-dom, if provided as a separate package by the distributor
PHP session support                                                                        php-session, if provided as a separate package by the distributor
PHP socket support                                                                        php-net-socket, –enable-sockets. Required for user script support.
PHP multibyte support                                                                php-mbstring, –enable-mbstring
MySQL php-mysql                         3.22 or later                         Required if MySQL is used as Zabbix back end database.

①環境
yum -y install gcc mysql-server httpd php php-mysql php-gd php-bcmath php-xml php-mbstring mysql-devel php-snmp net-snmp-devel net-snmp net-snmp-utils OpenIPMI-devel curl-devel
②下載解壓
wget http://prdownloads.sourceforge.n … 8.2.tar.gz?download
tar zxvf zabbix-1.8.2.tar.gz
③配置zabbix資料庫
useradd zabbix
cd zabbix-1.8.2
cp -rf /usr/share/doc/mysql-server-5.0.77/my-medium.cnf /etc/my.cnf
mysql_install_db –user=mysql
/etc/init.d/mysqld start

進入資料庫:
mysql -u root -p

create database zabbix character set utf8;
grant all on zabbix.* to zabbix@localhost identified by `zabbixpwd`;
quit
退出資料庫
mysql -uzabbix -pzabbixpwd zabbix < create/schema/mysql.sql
mysql -uzabbix -pzabbixpwd zabbix < create/data/data.sql
mysql -uzabbix -pzabbixpwd zabbix < create/data/p_w_picpaths_mysql.sql
④編譯安裝zabbix
./configure –prefix=/usr/local/zabbix –enable-server –enable-proxy –enable-agent –with-mysql –with-net-snmp –with-libcurl –with-openipmi &&
make &&
make install

⑤zabbix服務配置
* 服務埠定義:
編輯 /etc/services,在後面追加:
cat >> /etc/services << “EOF”
zabbix-agent 10050/tcp Zabbix Agent
zabbix-agent 10050/udp Zabbix Agent
zabbix-trapper 10051/tcp Zabbix Trapper
zabbix-trapper 10051/udp Zabbix Trapper
EOF
* 複製配置檔案:
mkdir /etc/zabbix
cp misc/conf/zabbix_server.conf /etc/zabbix/
cp misc/conf/zabbix_proxy.conf /etc/zabbix/
cp misc/conf/zabbix_agent.conf /etc/zabbix/
cp misc/conf/zabbix_agentd.conf /etc/zabbix/
* 修改 zabbix server 配置檔案 /etc/zabbix/zabbix_server.conf 中的資料庫使用者名稱和密碼:
sed -i `95s/root/zabbix/` /etc/zabbix/zabbix_server.conf
sed -i `103aDBPassword=zabbixpwd` /etc/zabbix/zabbix_server.conf
* 安裝啟動指令碼
cp misc/init.d/fedora/core/zabbix_server /etc/init.d/
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
* 修改 /etc/init.d/zabbix_server 變數定義:
sed -i `19s#opt#usr/local#` /etc/init.d/zabbix_server
sed -i `25s#bin#sbin#` /etc/init.d/zabbix_server
* 修改 /etc/init.d/zabbix_agentd 變數定義:
sed -i `19s#opt#usr/local#` /etc/init.d/zabbix_agentd
sed -i `25s#bin#sbin#` /etc/init.d/zabbix_agentd
* 啟動 Zabbix Server:
/etc/init.d/zabbix_server start
* 啟動 Zabbix Agentd
/etc/init.d/zabbix_agentd start
* 配置WEB,複製 Web Interface 到 web 目錄:
cp -r frontends/php/* /var/www/html/
/etc/init.d/httpd start
⑥WEB配置zabbix
開啟 http://localhost/,看到提示:
Timezone for PHP is not set. Please set “date.timezone” option in php.ini.
按照提示,修改 php.ini 中時區設定:
date.timezone = Asia/Shanghai
service httpd restart

依次單擊下一步,在環境檢測時會看到幾個fail,再次修改 php.ini,根據提示設定相應引數:
post_max_size = 32M
max_execution_time = 600
max_input_time = 600       
memory_limit = 256M
upload_max_filesize = 32M
                                                                Current value                Required                Recommended   
PHP version                                                5.1.6                                 5.0                         5.3.0                         Ok
PHP memory limit                                 16M                                 128M                         256M                         Fail
PHP post max size                                 8M                                         16M                         32M                         Fail
PHP upload max filesize                 2M                                         2M                                 16M                         Ok
PHP max execution time                         30                                         300                         600                         Fail
PHP max input time                                 60                                         300                         600                         Fail
PHP timezone                                         Asia/Shanghai                                                                             Ok
PHP databases support                         MySQL                                                                                             Ok
PHP BC math                                         yes                                                                                             Ok
PHP MB string                                         yes                                                                                             Ok
PHP Sockets                                         yes                                                                                             Ok
PHP GD                                                         2.0.28                                 2.0                         2.0.34                         Ok
GD PNG Support                                         yes                                                                                             Ok
libxml module                                         2.6.26                                 2.6.15                         2.7.6                         Ok
ctype module                                         yes                                                                                             Ok

解決後按提示繼續安裝即可。

⑦結束:
安裝完後直接訪問:
http://localhost/
預設使用者名稱和密碼是:
admin/zabbix

客戶端安裝配置:
①環境
yum -y install gcc
②下載解壓
tar zxf zabbix-1.8.2.tar.gz
③配置zabbix使用者
useradd zabbix
cd zabbix-1.8.2
④編譯安裝zabbix
./configure –prefix=/usr/local/zabbix –enable-agent &&
make &&
make install
⑤zabbix服務配置
* 服務埠定義:
編輯 /etc/services,在後面追加:
cat >> /etc/services << “EOF”
zabbix-agent 10050/tcp Zabbix Agent
zabbix-agent 10050/udp Zabbix Agent
EOF
* 複製配置檔案:
mkdir /etc/zabbix
cp misc/conf/zabbix_agent.conf /etc/zabbix/
cp misc/conf/zabbix_agentd.conf /etc/zabbix/
* 修改配置檔案:
vi /etc/zabbix/zabbix_agent.conf
Server=192.168.168.100
vi /etc/zabbix/zabbix_agentd.conf
Server=192.168.168.100
Hostname=server30
* 安裝啟動指令碼
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
chmod a+x /etc/init.d/zabbix_agentd
* 修改 /etc/init.d/zabbix_agentd 變數定義:
BASEDIR=/usr/local/zabbix
FULLPATH=$BASEDIR/sbin/$BINARY_NAME
* 新增到啟動服務:
chkconfig –add zabbix_agentd
* 啟動 Zabbix Agentd
/etc/init.d/zabbix_agentd start