搭建zabbix监控windows

所用工具是centos7和zabbix2.4.8

所有安装都是yum安装的

先配置一个zabbix的yum仓库

这个是网址:http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/


yum install zabbix-2.4.8-1.el7.x86_64.rpm zabbix-server-2.4.8-1.el7.x86_64.rpm zabbix-server-mysql-2.4.8-1.el7.x86_64.rpm zabbix-agent-2.4.8-1.el7.x86_64.rpm zabbix-sender-2.4.8-1.el7.x86_64.rpm zabbix-web-2.4.8-1.el7.noarch.rpm zabbix-get-2.4.8-1.el7.x86_64.rpm  zabbix-web-mysql-2.4.8-1.el7.noarch.rpm trousers-0.3.11.2-4.el7_1.x86_64.rpm


创建数据库:


server和proxy的运行都依赖于数据库,agent则不需要。


以MySQL数据库为例:
shell> mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '';
mysql> quit;
shell> mysql -uzabbix -p zabbix < database/mysql/schema.sql
# stop here if you are creating database for Zabbix proxy
shell> mysql -uzabbix -p zabbix < database/mysql/images.sql
shell> mysql -uzabbix -p zabbix < database/mysql/data.sql

配置zabbix:


(1) zabbix_server
server的配置文件为zabbix_server.conf,至少应该为其配置数据库等相关的信息;例如:
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid

(2) 配置php环境
编辑/etc/httpd/conf.d/zabbix.conf,添加如下项。
   php_value date.timezone Asia/Shanghai


  启动httpd服务:systemctl start httpd.service


  访问zabbix web
  http://your_host/zabbix


  登录:Admin/zabbix


(3) 配置zabbix_agent
agent的配置文件为zaabix_agentd.conf,至少应该为其指定server的IP地址;
DBHost=172.16.100.67
DBName=zabbix
DBUser=zbxuser
DBPassword=zbxpass
DBSocket=/var/lib/mysql/mysql.sock
SNMPTrapperFile=/var/log/snmptt/snmptt.log
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts


注意:/etc/zabbix/zabbix_server.conf中的DBPassword一定要开启,不然会报zabbix不在线的错误

win7上配置zabbix-agent:

下载地址:   https://www.zabbix.com/downloads/2.4.0/zabbix_agents_2.4.0.win.zip

  以管理员的运行cmd

  C:\zabbix\bin\win64\zabbix_agent -c  C:\zabbix\conf\zabbix_agentd.win -i -i先安装zabbix

C:\zabbix\bin\win64\zabbix_agent -c  C:\zabbix\conf\zabbix_agentd.win -s -s运行zabbix

注意:此方法在win10上会遇到故障,无法启动zabbix ,在win7上适用

你可能感兴趣的:(搭建服务器)