CentOS 7.1安裝zabbix
# yum install zabbix-2.4.6-1.el7.x86_64.rpm zabbix-server-2.4.6-1.el7.x86_64.rpm zabbix-server-mysql-2.4.6-1.el7.x86_64.rpm zabbix-agent-2.4.6-1.el7.x86_64.rpm zabbix-sender-2.4.6-1.el7.x86_64.rpm zabbix-web-2.4.6-1.el7.noarch.rpm zabbix-get-2.4.6-1.el7.x86_64.rpm zabbix-web-mysql-2.4.6-1.el7.noarch.rpm trousers-0.3.11.2-4.el7_1.x86_64.rpm
說明:CentOS 7.1安裝zabbix-2.4.6-1.el7,其與trousers-0.3.11.2-3不兼容,需要升級trousers至0.3.11.2-4.el7_1。
創建數據庫:
server和proxy
shell> mysql -uroot -p<password>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected]
mysql> quit;
shell> mysql -uzabbix -p<password> zabbix < database/mysql/schema.sql
# stop here if you are creating database for Zabbix proxy
shell> mysql -uzabbix -p<password> zabbix < database/mysql/images.sql
shell> mysql -uzabbix -p<password> zabbix < database/mysql/data.sql
配置zabbix:
(1) zabbix_server
server的配置文件為zabbix_server.conf,至少應該為其配置數據庫等相關的信息;例如:
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBHost=172.16.100.67
DBName=zabbix
DBUser=zbxuser
DBPassword=zbxpass
DBSocket=/var/lib/mysql/mysql.sock
SNMPTrapperFile=/var/log/snmptt/snmptt.log
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
(2) 配置php環境
編輯/etc/httpd/conf.d/zabbix.conf,添加如下項。
php_value date.timezone Asia/Shanghai
啟動httpd服務:systemctl start httpd.service
訪問zabbix web
http://your_host/zabbix
登錄:Admin/zabbix
(3) 配置zabbix_agent
agent的配置文件為zaabix_agentd.conf,至少應該為其指定server的IP地址;
源碼安裝:
下載地址:http://www.zabbix.com/download.php
# tar -zxvf zabbix-2.0.0.tar.gz
創建用戶:
# groupadd zabbix
# useradd -g zabbix zabbix
註意:同時安裝了server和agent的節點上,建議其運行用戶不要相同。
創建數據庫:
server和proxy的運行都依賴於數據庫,agent則不需要。
以MySQL數據庫為例:
mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
mysql> GRANT ALL ON zabbix.* TO [email protected]