安裝部署zabbix3.0

來源:互聯網
上載者:User

標籤:zabbix


服務端:

[[email protected] ~]#rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-


1.el6.noarch.rpm



安裝rpm包的lamp環境 

[[email protected] ~]#yum install -y  httpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-gd 


php-mbstring


安裝zabbix服務端

[[email protected] ~]#yum install zabbix zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql net-


snmp-devel -y



用戶端:

[[email protected] ~]#rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-


1.el6.noarch.rpm

[[email protected] ~]#yum install -y zabbix-agent




#這裡有必要說一下zabbix3.0必須要php5.4以上因此需要安裝特殊源,才能夠安裝php5.5

查看當前的php版本

[[email protected] ~]# php -v

PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53) 

Copyright (c) 1997-2010 The PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies


如果確定要完全升級系統的PHP版本,可運行如下命令:

[[email protected] ~]#yum install yum-plugin-replace

[[email protected] ~]#yum replace php-common --replace-with=php55w-common



1、

MySQL配置

[[email protected] ~]#cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

啟動MySQL

[[email protected] ~]#/etc/init.d/mysqld start

建立使用者並授權

[[email protected] ~]#mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.1.73-log Source distribution


Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.


Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.


mysql> CREATE DATABASE `zabbix` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

Query OK, 1 row affected (0.00 sec)


mysql> show create database zabbix;

+----------+-----------------------------------------------------------------+

| Database | Create Database                                                 |

+----------+-----------------------------------------------------------------+

| zabbix   | CREATE DATABASE `zabbix` /*!40100 DEFAULT CHARACTER SET utf8 */ |

+----------+-----------------------------------------------------------------+


mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;

mysql> flush privileges;

mysql> exit


這裡建立資料庫一定要是utf8的編碼




2、複製網站

[[email protected] ~]#cp -R /usr/share/zabbix/ /var/www/html/



3、匯入資料檔案

[[email protected] ~]#cd /usr/share/doc/zabbix-server-mysql-3.0.3

[[email protected] ~]#zcat create.sql.gz |mysql -uzabbix -pzabbix zabbix



4、檔案授權

[[email protected] ~]#chmod -R 755 /etc/zabbix/web

[[email protected] ~]#chown -R apache.apache /etc/zabbix/web 




5、啟動apache && zabbix

[[email protected] ~]#/etc/init.d/zabbix-server start

[[email protected] ~]#/etc/init.d/zabbix-agent start

[[email protected] ~]#/etc/init.d/httpd start




6、檢測

[[email protected] ~]# netstat -lntp

[[email protected] html]# netstat -lntp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address         

tcp        0      0 0.0.0.0:22            

tcp        0      0 127.0.0.1:25          

tcp        0      0 0.0.0.0:10050         

tcp        0      0 0.0.0.0:10051         

tcp        0      0 0.0.0.0:3306          

tcp        0      0 :::80                 

tcp        0      0 :::22                 

tcp        0      0 ::1:25                

tcp        0      0 :::10050              

tcp        0      0 :::10051              



修複apache的wring

[[email protected] ~]#vi /etc/httpd/conf/httpd.conf

ServerName 127.0.0.1:80




7、相關資料修改

修改php設定檔

[[email protected] ~]#vim /etc/php.ini

post_max_size = 16M

max_execution_time = 300

max_input_time = 300

date.timezone = Asia/shanghai


修改zabbix_server設定檔

[[email protected] ~]#vi /etc/zabbix/zabbix_server.conf

修改資料庫地址、資料庫名、 使用者、密碼

分別對應

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

DBSocket=/var/lib/mysql/mysql.sock



配置web安裝

登入web進行安裝

http://192.168.1.169/zabbix/


650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/87/3A/wKiom1fX6qPSqnlIAADX3vaBqlM072.jpg" style="float:none;" title="1.jpg" alt="wKiom1fX6qPSqnlIAADX3vaBqlM072.jpg" />


650) this.width=650;" src="http://s5.51cto.com/wyfs02/M01/87/3A/wKiom1fX6qSTmr0JAAGv5HSsLmc350.jpg" style="float:none;" title="2.jpg" alt="wKiom1fX6qSTmr0JAAGv5HSsLmc350.jpg" />



輸入zabbix資料的帳號密碼

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/87/37/wKioL1fX6qTQHz44AAFVm1GFfU8431.jpg" style="float:none;" title="3.jpg" alt="wKioL1fX6qTQHz44AAFVm1GFfU8431.jpg" />



650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/87/37/wKioL1fX6qSxqni1AABKF6kDPW0818.jpg" style="float:none;" title="4.jpg" alt="wKioL1fX6qSxqni1AABKF6kDPW0818.jpg" />

650) this.width=650;" src="http://s1.51cto.com/wyfs02/M02/87/3A/wKiom1fX6qWyOlwMAAFZUVYCKF4705.jpg" style="float:none;" title="5.jpg" alt="wKiom1fX6qWyOlwMAAFZUVYCKF4705.jpg" />

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/87/3A/wKiom1fX6qbR7GPjAADv7MWUZRg417.jpg" style="float:none;" title="6.jpg" alt="wKiom1fX6qbR7GPjAADv7MWUZRg417.jpg" />



登入帳號Admin  密碼zabbix

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/87/37/wKioL1fX6qayuc9mAADa0-rjAF4313.jpg" style="float:none;" title="7.jpg" alt="wKioL1fX6qayuc9mAADa0-rjAF4313.jpg" />



zabbix安裝完畢


650) this.width=650;" src="http://s5.51cto.com/wyfs02/M01/87/37/wKioL1fX6qeBZ1SfAAD0v3Z3bEk849.jpg" style="float:none;" title="8.jpg" alt="wKioL1fX6qeBZ1SfAAD0v3Z3bEk849.jpg" />




設定中文

650) this.width=650;" src="http://s4.51cto.com/wyfs02/M01/87/3A/wKiom1fX6qeRvFblAABvwj_T0z8850.jpg" style="float:none;" title="9.jpg" alt="wKiom1fX6qeRvFblAABvwj_T0z8850.jpg" />






650) this.width=650;" src="http://s5.51cto.com/wyfs02/M00/87/3A/wKiom1fX6qjCMTu2AAHRl7ovj6w679.jpg" style="float:none;" title="10.jpg" alt="wKiom1fX6qjCMTu2AAHRl7ovj6w679.jpg" />




650) this.width=650;" src="http://s5.51cto.com/wyfs02/M02/87/37/wKioL1fX6qih9fFIAAB8KvLwEj0736.jpg" style="float:none;" title="11.jpg" alt="wKioL1fX6qih9fFIAAB8KvLwEj0736.jpg" />








觀察日誌解決問題

[[email protected] ~]#tail -f /var/log/httpd/error_log

[[email protected] ~]#tail -f /var/log/zabbix/zabbix_server.log


故障

(一)

connection to database ‘zabbix‘ failed: [1045] Access denied for user ‘zabbix‘@‘localhost‘ (using 


password: YES)

  2757:20160912:192912.707 cannot set MySQL character set to "utf8"


解決方案:

正確的授權

grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;





(二)

cannot send list of active checks to "127.0.0.1": host [Zabbix server] not monitored


解決方案:

需要把用戶端的設定檔的Hostname改成和主機的hostname一樣

服務端的主機名稱必須與用戶端Hostname一樣



本文出自 “比爾營運筆記” 部落格,請務必保留此出處http://chenshoubiao.blog.51cto.com/6159058/1852420

安裝部署zabbix3.0

聯繫我們

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