zabbix监控配置流程
zabbix监控指标:
系统: CPU、内存、硬盘
网络: 网卡、网口
业务: 进程、端口号、日志
硬件: 电源个数、CPU温度、硬盘温度
zabbix监控配置流程详解
管理层次:
开发人员要加监控,需要让其提供监控指标
运营人员要加监控,让其找开发要监控指标
运维人员要加监控
配置层次:
1.添加主机或主机组
2.添加监控项
a.使用模板添加
b.自定义模板
c.手动加监控项
3.添加触发器
4.添加媒介
5.为用户选择要使用的媒介
6.添加动作
7.手动触发并验证
环境准备
| IP | 系统 | 主机 |
|---|---|---|
| 192.168.170.128 | CentOS8 | zabbix |
| 192.168.170.129 | CentOS8 | agent |
安装客户端
//把服务端的zabbix包传到客户端
[root@zabbix ~]# scp zabbix-5.0.25.tar.gz 192.168.170.129:/root/
The authenticity of host '192.168.170.129 (192.168.170.129)' can't be established.
ECDSA key fingerprint is SHA256:qaKQJmPYIS5ZJ95xnw1qr/aKcWnQVf7B9KJCxs1ru9A.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.170.129' (ECDSA) to the list of known hosts.
root@192.168.170.129's password:
zabbix-5.0.25.tar.gz 100% 20MB 65.8MB/s 00:00
//关闭防火墙和selinux
[root@agent ~]# 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@agent ~]# setenforce 0
[root@agent ~]# vim /etc/selinux/config
[root@agent ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
//创建用户
[root@agent ~]# useradd -r -M -s /sbin/nologin zabbix
//解压包
[root@agent ~]# tar xf zabbix-5.0.25.tar.gz
//安装依赖包
[root@agent ~]# yum -y install wget vim gcc gcc-c++ make pcre-devel openssl openssl-devel
//编译安装
[root@agent ~]# cd zabbix-5.0.25/
[root@agent zabbix-5.0.25]# ./configure --enable-agent
Enable agent 2: no
Enable Java gateway: no
LDAP support: no
IPv6 support: no
***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************
[root@agent zabbix-5.0.25]# make install
//创建唯一标识
[root@agent ~]# tr -dc A-Za-z < /dev/urandom | head -c 8 |xargs
IWuZcMrR
//修改配置文件
[root@agent zabbix-5.0.25]# cd /usr/local/etc/
[root@agent etc]# pwd
/usr/local/etc
[root@agent etc]# ls
zabbix_agentd.conf zabbix_agentd.conf.d
[root@agent etc]# vim zabbix_agentd.conf
Server=192.168.170.128 搜索Server,添加服务端IP地址
ServerActive=192.168.170.128 搜索ServerActive,添加服务端IP地址
ServerActive=IWuZcMrR 唯一主机名
[root@agent etc]# zabbix_agentd
[root@agent etc]# 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 5 127.0.0.1:631 0.0.0.0:*
LISTEN 0 128 0.0.0.0:10050 0.0.0.0:*
LISTEN 0 128 0.0.0.0:111 0.0.0.0:*
LISTEN 0 32 192.168.122.1:53 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 5 [::1]:631 [::]:*
LISTEN 0 128 [::]:111 [::]:*
配置服务端(在web中配置)







浙公网安备 33010602011771号