CentOS 7.4 安装 yum Zabbix 3.4
Download and install Zabbixhttps://www.zabbix.com/download
安装
安装mariadb
yum install mariadb-server mariadb –y
systemctl enable mariadb
systemctl restart mariadb
安装Zabbix3.4
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
yum install zabbix-server-mysql zabbix-web-mysql -y
配置
创建数据库
mysql
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.08 sec)
MariaDB [(none)]> exit
Bye
导入数据库
zcat /usr/share/doc/zabbix-server-mysql-3.4.8/create.sql.gz |mysql -uzabbix -pzabbix zabb
注意:/usr/share/doc/zabbix-server-mysql-xxx 以实际安装的版本为准
配置数据库用户及密码
vim /etc/zabbix/zabbix_server.conf
124 # Default:
125 DBPassword=zabbix
启动zabbix server并设置开机启动
systemctl enable zabbix-server
systemctl start zabbix-server
编辑Zabbix前端PHP配置,更改时区
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
启动httpd并设置开机启动
systemctl enable httpd
systemctl start httpd
安装Zabbix Web
浏览器访问,并进行安装
http://10.10.10.16/zabbix/
默认用户Admin 默认密码zabbix
zabbxi-agent安装及配置
安装zabbxi-agent
yum install zabbix-agent –y
配置zabbxi-agent
vim /etc/zabbix/zabbix_agentd.conf
修改IP地址server IP地址
97 Server=10.10.10.16
138ServerActive=10.10.10.16
启动zabbxi-agent并设置开机启动
systemctl enable zabbix-agent.service
systemctl restart zabbix-agent.service
Zabbix agent 在windows上安装部署
https://www.zabbix.com/download_agents
conf目录存放是agent配置文件
bin文件存放windows下32位和64位安装程序
配置zabbix agent.win.conf
LogFile=c:\zabbix\zabbix_agentd.log
Server=10.10.10.16
ServerActive=10.10.10.16
Hostname=Windows_A
参数说明:
Server:zabbix server的ip地址,
ServerActive: zabbix 主动监控server的ip地址,
其中Server和ServerActive都指定zabbix Server的IP地址,不同的是,前者是被动后者是主动。也就是说Server这个配置是用来允许172.17.22.155这个ip来我这取数据。而ServerActive的172.17.22.155的意思是,客户端主动提交数据给他。
Hostname 主机名,必须唯一,区分大小写。Hostname必须和zabbix web上配置的一直,否则zabbix主动监控无法正常工作。因为agent拿着这个主机名去问server,我有配置主动监控项吗?server拿着这个主机名去配置里面查询,然后返回信息。
zabbix agent检测分为主动(agent active)和被动(agent)两种形式,主动与被动的说法均是相对于agent来讨论的。
主动:agent请求server获取主动的监控项列表,并主动将监控项内需要检测的数据提交给server/proxy
被动:server向agent请求获取监控项的数据,agent返回数据。
安装agent
修改好文件后,用CMD(需有管理员权限)将Zabbix Agent安装为Windows系统的服务,在windows控制台下执行以下命令:
c:\zabbix\bin\win64\zabbix_agentd.exe -i -c c:\zabbix\conf\zabbix_agentd.win.conf
zabbix_agentd.exe : service installed successfully
zabbix_agentd.exe : event source installed successful
启动agent客户端
c:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -s
控制台信息
zabbix_agentd.exe : service started successfully
查看Windows端口使用
PS C:\Users\Administrator> netstat -ano|findstr "10050"
TCP 0.0.0.0:10050 0.0.0.0:0 LISTENING 1836
TCP [::]:10050 [::]:0 LISTENING 1836
PS C:\Users\Administrator> tasklist|findstr "1836"
zabbix_agentd.exe 1836 Services 0 8,540 K
PS C:\Users\Administrator>
查看启动的日志zabbix_agentd.log:
c:\zabbix\zabbix_agentd.log
参考:
https://www.cnblogs.com/clsn/p/7885990.html#auto_id_16
页:
[1]