作業系統:CentOS 5.4
軟體版本:Zabbix 1.8.2 (stable)
// 安裝 RPMforge 套件庫
( http://wiki.centos.org/zh-tw/Additio...22e7ac9f42bf4d )
i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
# rpm -i rpmforge-release-0.5.1-1.el5.rf.i386.rpm # yum check-update
// 檢查必要的套件是否安裝
# rpm -q gcc mysql-devel curl-devel httpd php php-mysql php-bcmath php-gd net-snmp-devel fping e2fsprogs-devel zlib-devel libgssapi-devel krb5-devel openssl-devel libidn-devel iksemel iksemel-devel
// 安裝遺漏的套件
# yum install mysql-devel php-mysql php-bcmath php-gd net-snmp-devel fping libgssapi-devel iksemel iksemel-devel
// 啟動 MySQL
# service mysqld start # chkconfig mysqld on
// 下載 zabbix 安裝程式
下載位址:http://sourceforge.net/projects/zabbix/files/
# wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/1.8.2/zabbix-1.8.2.tar.gz/download # tar -xzf zabbix-1.8.2.tar.gz
// 新增資料庫
# mysql -u root -p mysql> create database zabbix character set utf8; mysql> quit; # cd create/schema # mysql -uroot -p zabbix < mysql.sql # cd ../data # mysql -uroot -p zabbix < data.sql # mysql -uroot -p zabbix < images_mysql.sql
// 編譯安裝 zabbix 主程式
# cd /tmp/zabbix-1.8.2/ # ./configure --prefix=/opt/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-jabber --with-libcurl # make install
// 設定服務名稱
編輯 /etc/services,為方便管理,插入的位置可依照 port 的順序為主。
zabbix-agent 10050/tcp #Zabbix Agent zabbix-agent 10050/udp #Zabbix Agent zabbix-trapper 10051/tcp #Zabbix Trapper zabbix-trapper 10051/udp #Zabbix Trapper
// 設定 zabbix
mkdir -p /etc/zabbix/alert.d mkdir -p /var/log/zabbix-server mkdir -p /var/log/zabbix-agent mkdir -p /var/run/zabbix-server mkdir -p /var/run/zabbix-agent cp /tmp/zabbix-1.8.2/misc/conf/zabbix_server.conf /etc/zabbix cp /tmp/zabbix-1.8.2/misc/conf/zabbix_agentd.conf /etc/zabbix cp /tmp/zabbix-1.8.2/misc/init.d/redhat/8.0/zabbix_server /etc/init.d cp /tmp/zabbix-1.8.2/misc/init.d/redhat/8.0/zabbix_agentd /etc/init.d
// 設定檔 zabbix_server.conf , zabbix_agentd.conf
編輯 /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix-server/zabbix_server.log PidFile=/var/run/zabbix-server/zabbix_server.pid DBName=zabbix DBUser=root DBPassword=<DB Password> AlertScriptsPath=/etc/zabbix/alert.d/
編輯 /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix-agentd/zabbix_agentd.pid LogFile=/var/log/zabbix-agentd/zabbix_agentd.log EnableRemoteCommands=1 Server=127.0.0.1 Timeout=10
// 啟動檔 zabbix_server , zabbix_agentd
編輯 /etc/init.d/zabbix_server 及 /etc/init.d/zabbix_agentd
progdir="/opt/zabbix/sbin/"
//