前几天我博客记录了zabbix安装《Ubuntu系统LNMP环境下安装配置zabbix3.04》这里我们给大家分享一下zabbix-proxy安装配置。阿里云zabbix-service ,公司内网zabbix-proxy
下面开始:
zabbix-proxy服务器配置
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
2、安装zabbix-porxy
# apt-get install zabbix-proxy-mysql
3、这里会安装MySQL数据库,安装过程需要设置数据root用户密码
确认密码
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;
Query OK, 0 rows affected (0.00 sec)
mysql> \q
Bye
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
root@zabbix-proxy:/usr/share/doc/zabbix-proxy-mysql# ls
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
web配置添加zabbix-proxy
1、创建Proxy
Administrationè ProxiesèCreate proxy
2、配置proxy信息Create proxy
3、添加监控主机
4、完成查看信息