目录
linux 部署zabbix监控
zabbix客户端部署
[root@localhost ~]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# setenforce 0
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
[root@localhost ~]# vi /etc/selinux/config
[root@localhost ~]# useradd -rMs /sbin/nologin zabbix
[root@localhost ~]# dnf -y install make gcc gcc-c++ pcre-devel openssl openssl-devel
[root@localhost ~]# wget https://cdn.zabbix.com/zabbix/sources/stable/6.2/zabbix-6.2.2.tar.gz
//解压,编译安装zabbix_agentd
[root@localhost ~]# tar -xf zabbix-6.2.2.tar.gz
[root@localhost ~]# cd zabbix-6.2.2
[root@localhost zabbix-6.2.2]# ./configure --enable-agent
[root@localhost zabbix-6.2.2]# make install
[root@localhost ~]# zabbix_agentd
[root@localhost ~]# ss -anlt
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 [::]:*
[root@localhost ~]# vim /usr/local/etc/zabbix_agentd.conf
Server=192.168.202.138
ServerActive=192.168.202.138
Hostname=client
[root@localhost ~]# zabbix_agentd
[root@localhost ~]# ss -anlt
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 [::]:*
创建监控主机
点击右上角添加
创建主机组并加入主机
添加监控项
用模板方式添加
手动添加监控项
我们可以先在被监控端创建一个测试的文件
[root@localhost src]# touch /tmp/zdz
添加触发器
添加媒介
添加动作
手动触发告警
[root@localhost ~]# echo xixi >> /tmp/zdz
查看结果