zabbix 3.2安装方式一: 源码安装
1、从官网下载源码进行解压
tar -zxvf zabbix-3.2.0.tar.gz
http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.2.7/zabbix-3.2.7.tar.gz/download
2、创建用户 Create user account
groupadd zabbix useradd -g zabbix zabbix
3、创建zabbix数据库 ,前提是已经搭建好MYSQL数据库 Create Zabbix database
shell> mysql -uroot -p<password> mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>'; mysql> quit; # stop here if you are creating database with Zabbix packages shell> cd zabbix-3.2.7/database/mysql shell> mysql -uzabbix -p<password> zabbix < schema.sql # stop here if you are creating database for Zabbix proxy shell> mysql -uzabbix -p<password> zabbix < images.sql shell> mysql -uzabbix -p<password> zabbix < data.sql
4 Configure the sources
4.1 ./configure --enable-server --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
4.2 make install
make install
will by default install the daemon binaries (zabbix_server, zabbix_agentd, zabbix_proxy) in/usr/local/sbin and the client binaries (zabbix_get, zabbix_sender) in /usr/local/bin.
5. 编辑配置:/usr/local/etc/zabbix_server.conf
LogFile=/tmp/zabbix_server.log #日志
DBName=zabbix #数据库名称
DBUser=zabbix_user #数据库用户名
DBPassword=zabbix123 #数据库用户密码
DBSocket=/tmp/mysql.sock #数据库的sock文件位置
6. Start up the daemons
shell> zabbix_server
7.配置WEB ,Installing Zabbix web interface
mkdir <htdocs>/zabbix
service httpd restart
8.登录web 初始化zabbix
Step 1
In your browser, open Zabbix URL: http://<server_ip_or_name>/zabbix
注意:Database host: 应该填服务器的地址,特别不是在本机打开浏览器的,否则后面会一直提示找不到 /var/lib/mysql/mysql.sock.
zabbix 3.2 客户端 yum安装:(注意操作系统版本)
Installing repository configuration package
1、Install the repository configuration package. This package contains yum (software package manager) configuration files.
# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
3、编辑配置 vim /etc/zabbix/zabbix_agent
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.30.133 #被动模式下的 服务器IP
ServerActive=192.168.30.133 #主动模式 服务器IP
Hostname=Zabbix server #Hostname 必须跟在web界面添加主机的 hostname 一致
4、#zabbix_agent #启动客户端
5、在服务器端测试
zabbix_get -s 127.0.0.1 -p 10050 -k "system.cpu.load[all,avg1]" # -s 后面跟客户端IP
6、登录管理的web口 添加主机,并修改web管理界面语言 htttp://zabbix_server_ip/zabbix 默认账号:admin 密码:zabbbix
添加 host主机
完成主机添加后,过一会查看是否正常:
只有ZBX 状态的颜色为绿色,才正常。
如果一直为灰色,需检查配置文件、客户端与服务器的防火墙、进程是否都正常。
大功告成, 好多问题啊。。。。