zabbix安裝-nginx+php環境zabbix2.4安裝文檔

來源:互聯網
上載者:User

zabbix安裝-nginx+php環境zabbix2.4安裝文檔
1、安裝依賴包
yum -y install gcc gcc-c++ autoconf httpdphp mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysqlphp-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmathmysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp net-snmp-develcurl-devel
2、修改php.ini,以達到zabbixserver的要求
# vim /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
post_max_size = 32M
max_input_time = 300
memory_limit = 128M
mbstring.func_overload = 2

3、啟動mysql和httpd

4、建立zabbix啟動並執行使用者和組
# groupadd -g 201 zabbix
# useradd -g zabbix -u 201 zabbix

5、編譯安裝zabbix
# tar -zxf zabbix-2.4.2.tar.gz
# ./configure --prefix=/usr/local/zabbix--enable-server --enable-proxy --enable-agent --with-mysql=/usr/bin/mysql_config--with-net-snmp --with-libcurl
# make && make install

在檔案/etc/services尾部追加以下記錄:
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-server 10051/tcp # zabbix Trapper
zabbix-server 10051/udp # zabbix Trapper

6、匯入資料庫資訊並授權
# mysql –uroot –p
mysql> create database zabbix characterset utf8;
mysql> grant all on zabbix.* tozabbix@localhost identified by ‘zabbix’;

# mysql -uzabbix -pzabbixzabbix<./database/mysql/schema.sql
# mysql -uzabbix -pzabbix zabbix<./database/mysql/images.sql
# mysql -uzabbix -pzabbix zabbix<./database/mysql/data.sql


7、建立相關的目錄和連結
# mkdir /var/log/zabbix
# chown zabbix.zabbix /var/log/zabbix
# ln -s /usr/local/zabbix/etc/ /etc/zabbix
# ln -s /usr/local/zabbix/bin/* /usr/bin/
# ln -s /usr/local/zabbix/sbin/* /usr/sbin/

8、把zabbix server加入到系統服務
# cp zabbix-2.4.2/misc/init.d/fedora/core/zabbix_*/etc/init.d
# vim /etc/init.d/zabbix_server
BASEDIR=/usr/local/zabbix
# vim /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix

9、修改設定檔
# vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
LogFile=/var/log/zabbix/zabbix_server.log

10、設定zabbix監控自己
# vim /etc/zabbix/zabbix_agentd.conf
LogFile=/var/log/zabbix/zabbix_agentd.log
Server=127.0.0.1,x.x.x.x
ServerActive=x.x.x.x:10051
Hostname=主機名稱
UnsafeUserParameters=1

11、拷貝網頁檔案到nginx網站目錄
# cp -r zabbix-2.4.2/frontends/php//usr/share/nginx/html/zabbix
# chown -R nginx.nginx/usr/share/nginx/html/zabbix/

12、啟動zabbix_server和zabbix_agentd並設定開機自啟動
# service zabbix_server start
# chkconfig zabbix_server on
# service zabbix_agentd start
# chkconfig zabbix_agentd on

13、在web頁面中安裝zabbix


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.