部署zabbix监控详解
文章目录
zabbix监控配置流程
管理层次:
开发人员 提供监控指标
运营人员 让其找开发要监控指标
运维人员 想加监控就直接加就行了
配置流程
创建主机
创建主机组
添加监控项
添加触发器
配置媒介
配置动作
手动触发告警
zabbix 监控指标
- 系统:
- CPU
- 内存
- 硬盘
- 网络:
- 网卡、网口
- 业务:
- 进程
- 端口号
- 日志
- 硬件:
- 电源个数
- CPU温度
- 硬盘温度
手动创建zabbix监控
zabbix客户端部署
[root@localhost ~]# systemctl disable --now firewalld.service
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 ~]# useradd -rMs /sbin/nologin zabbix
//下载编译工具和依赖包
[root@localhost ~]# dnf -y install make gcc gcc-c++ pcre-devel openssl openssl-devel
//下载zabbix压缩包
[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
***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************
[root@localhost zabbix-6.2.2]# make install
//修改配置文件
[root@localhost ~]# vim zabbix-6.2.2/conf/zabbix_agentd.conf
Server=192.168.188.130 //服务端主机ip
ServerActive=192.168.188.130 //agent主动模式
Hostname=monitor //zabbix系统内主机名
[root@localhost ~]# vim /usr/local/etc/zabbix_agentd.conf
Server=192.168.188.130 //服务端主机ip
ServerActive=192.168.188.130 //agent主动模式
Hostname=monitor //zabbix系统内主机名
//启动zabbix_agentd
[root@localhost ~]# zabbix_agentd
[root@localhost ~]# 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 [::]:*
创建监控主机
创建主机组并加入主机
添加监控项
- 用模板方式添加
- 手动添加监控项
我们可以先在被监控端创建一个测试的文件
[root@localhost ~]# touch /tmp/zjq
添加触发器
然后开始添加一个监控文件的触发器
添加媒介
如果想实现邮箱告警的话,需要添加媒介
stmp授权码
添加动作
手动触发告警
写入数据
[root@localhost ~]# echo wdnmd >> /tmp/zjq
发送邮箱,查看结果
windos 部署zabbix 监控
下载zabbix_agentd包
服务10050端口以启动
切记防火墙要关闭
添加监控主机
本机我们使用这张网卡ip
添加主机
模板内有监控一直触发告警