zabbix Web界面
安装zabbix agent(客户端)
环境 | IP |
---|---|
CentOS8 zabbix服务端 | 192.168.220.9 |
CentOS8 zabbix客户端 | 192.168.220.10 |
下载依赖工具
[root@client ~]# yum -y install wget make gcc gcc-c++ pcre-devel
下载zabbix(官网zabbix.com)
wget https://cdn.zabbix.com/zabbix/sources/stable/5.4/zabbix-5.4.4.tar.gz
创建用户
[root@client ~]# useradd -r -M -s /sbin/nologin zabbix
解压zabbix包
[root@client ~]# tar xf zabbix-5.4.4.tar.gz -C /usr/local/
开始编译安装zabbix,开启agent
[root@client ~]# cd /usr/local/zabbix-5.4.4/
[root@client zabbix-5.4.4]# ./configure --enable-agent
.......
***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************
[root@client zabbix-5.4.4]# make install
......
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/usr/local/zabbix-5.4.4'
make[1]: Leaving directory '/usr/local/zabbix-5.4.4'
修改zabbix_agentd配置文件
[root@client zabbix-5.4.4]# cd
[root@client ~]# cd /usr/local/etc
[root@client etc]# ls
zabbix_agentd.conf zabbix_agentd.conf.d
[root@client etc]# vim zabbix_agentd.conf
......
110 # Default:
111 # Server=
112
113 Server=192.168.220.9 (zabbix服务端的IP)被动模式
......
152 # ServerActive=
153
154 ServerActive=192.168.220.9 (zabbix服务端的IP) 主动模式
155
156 ### Option: Hostname
.....
162 # Default:
163 # Hostname=
164
165 Hostname=JgfgGFD (必须唯一,本机在zabbix web界面的名字)
166
167 ### Option: HostnameItem
......
[root@client etc]# systemctl stop firewalld //关闭防火墙和seLinux
[root@client etc]# setenforce 0
[root@client zabbix-5.4.4]# zabbix_agentd //开启zabbix_agentd
[root@client zabbix-5.4.4]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 0.0.0.0:10050 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
zabbix监控配置流程
监控配置步骤:
- 创建主机组
- 添加主机
– 在web界面添加主机
– 把主机加入主机组 - 添加监控项
– 手动添加监控项
– 通过模块添加监控项 - 添加触发器
- 配置用户媒介
- 添加动作
- 手动触发验证
将客户端加入到zabbix服务端的Web界面
创建主机组test
创建主机,将主机加入主机组
查看,添加别名,方便识别
添加监控项
查看添加的主机