下面開始:
1、配置zabbix源
# wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+trusty_all.deb
# dpkg -i zabbix-release_3.0-1+trusty_all.deb
# apt-get update
<a href="http://s5.51cto.com/wyfs02/M01/87/0C/wKiom1fSMf2AjB4DAABkN0cnFZY591.jpg-wh_500x0-wm_3-wmp_4-s_36633031.jpg" target="_blank"></a>
2、安裝zabbix-porxy
# apt-get install zabbix-proxy-mysql
<a href="http://s3.51cto.com/wyfs02/M01/87/0A/wKioL1fSMgqzs20wAAB_ljM-ork049.jpg-wh_500x0-wm_3-wmp_4-s_293972048.jpg" target="_blank"></a>
3、這裡會安裝MySQL資料庫,安裝過程需要設定資料root使用者密碼
<a href="http://s3.51cto.com/wyfs02/M02/87/0A/wKioL1fSMhvB9QmhAABToYAuG8o742.jpg-wh_500x0-wm_3-wmp_4-s_3916705496.jpg" target="_blank"></a>
确認密碼
<a href="http://s2.51cto.com/wyfs02/M01/87/0C/wKiom1fSMiyBYTVFAAAzi2abjd0876.jpg-wh_500x0-wm_3-wmp_4-s_1274665138.jpg" target="_blank"></a>
4、建立zabbix_proxy資料庫用于收集存儲監控主機、服務資訊。
root@zabbix-proxy:~# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.28-0ubuntu0.15.04.1 (Ubuntu)
Copyright (c) 2000, 2015, 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_proxy;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on zabbix_proxy.* to zabbix_proxy@localhost identified by 'you_password';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
mysql> \q
Bye
<a href="http://s1.51cto.com/wyfs02/M02/87/0C/wKiom1fSMkqiryXjAADY2qyjuW8477.jpg" target="_blank"></a>
5、資料初始化導入表結構
root@zabbix-proxy:~# cd /usr/share/doc/zabbix-proxy-mysql/
root@zabbix-proxy:/usr/share/doc/zabbix-proxy-mysql# ls
changelog.Debian.gz copyrightschema.sql.gz
root@zabbix-proxy:/usr/share/doc/zabbix-proxy-mysql# gunzip schema.sql.gz
changelog.Debian.gz copyrightschema.sql
root@zabbix-proxy:/usr/share/doc/zabbix-proxy-mysql# mysql -hlocalhost -uzabbix_proxy -pBd_zabbix zabbix_proxy < schema.sql
Warning: Using a password on the command line interface can be insecure.
6、配置zabbix_proxy.conf
root@zabbix-proxy:~# vi /etc/zabbix/zabbix_proxy.conf
ProxyMode=0
Server= 121.40.58.147
ServerPort=10051
Hostname=Zabbix_proxy
DBName=zabbix_proxy
DBUser=zabbix_proxy
DBPassword=Bd_zabbix
7、啟動zabbix_proxy服務
root@zabbix-proxy:~# /etc/init.d/zabbix-proxy restart
[ ok ] Restarting zabbix-proxy (via systemctl): zabbix-proxy.service.
8、檢視監聽端口
root@zabbix-proxy:~# netstat -ntpl |grep zabbix_proxy
tcp 00 0.0.0.0:100510.0.0.0:* LISTEN 31174/zabbix_proxy
tcp6 00 :::10051:::* LISTEN 31174/zabbix_proxy
1、建立Proxy
Administrationè ProxiesèCreate proxy
<a href="http://s4.51cto.com/wyfs02/M02/87/0C/wKiom1fSMqfRek_AAAAy26PCpcU633.jpg" target="_blank"></a>
2、配置proxy資訊Create proxy
<a href="http://s1.51cto.com/wyfs02/M01/87/0A/wKioL1fSMrywUl9KAAAmiWaleok828.jpg" target="_blank"></a>
<a href="http://s3.51cto.com/wyfs02/M02/87/0C/wKiom1fSMs7h_rdwAAA5140w4w8560.jpg" target="_blank"></a>
3、添加監控主機
<a href="http://s1.51cto.com/wyfs02/M02/87/0A/wKioL1fSMt7hdz1OAACxyuZSsxM870.jpg-wh_500x0-wm_3-wmp_4-s_2019663097.jpg" target="_blank"></a>
<a href="http://s2.51cto.com/wyfs02/M02/87/0C/wKiom1fSMxyjfePeAABwgDYIG-Y878.jpg" target="_blank"></a>
4、完成檢視資訊
<a href="http://s2.51cto.com/wyfs02/M01/87/0A/wKioL1fSMy7BssO6AABbpUM5bLk564.jpg" target="_blank"></a>
本文轉自 運維小當家 51CTO部落格,原文連結:http://blog.51cto.com/solin/1851030,如需轉載請自行聯系原作者