- 主机配置
- Windows
- 配置zabbix-agentd.conf
- 启动agent
- 关闭防火墙
- ip地址
- 在web界面上添加主机/主机组
- 模板添加监控项
- zabbix监控配置
- linux
- 在web界面添加主机
- 添加监控项
- 模板添加监控
- 手动添加监控
- 添加触发器
- 配置用户媒介
- 添加动作
- 手动触发并验证
- 下载windows版的zabbix_agentd
#移动c盘的zabbix目录下conf目录下,编辑zabbix_agentd.conf,惨改下面几个参数 server=192.168.129.250 serverActive=192.168.129.250 Hostname=windows
| 实验环境 | ip |
|---|---|
| server端 | 192.168.129.250 |
| agent端 | 192.168.129.135 |
//下载zabbix_agent包 [root@Server ~]# scp zabbix-5.4.4.tar.gz 192.168.129.135:/usr/src root@192.168.247.211's password: zabbix-5.4.4.tar.gz 100% 20MB 101.2MB/s 00:00 [root@agent src]# tar xf zabbix-5.4.4.tar.gz //安装依赖包 [root@agent src]# yum -y install gcc gcc-c++ make pcre-devel //创建用户zabbix [root@agent src]# useradd -r -M -s /sbin/nologin zabbix //编译并安装 [root@agent ~]# cd zabbix-5.4.4 [root@agent zabbix-5.4.4]# ./configure --enable-agent && make install //生成主机名 [root@agent zabbix-5.4.4]# tr -dc A-Za-z < /dev/urandom| head -c 8 |xargs AMNydcau //修改配置文件 [root@agent zabbix-5.4.4]# vim /usr/local/etc/zabbix_agentd.conf Server=192.168.129.250 #113行 ServerActive=192.168.129.250 #154行 Hostname=AMNydcau #165行 生产环境建议使用随机生成的字符串 //关闭防火墙 [root@agent ~]# systemctl stop firewalld [root@agent ~]# systemctl disable firewalld 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 ~]# zabbix_agentd [root@agent ~]# ss -anlt State Recv-Q Send-Q Local Address:Port Peer Address:Port 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 [::]:*在web界面添加主机
- 此处为绿色表示正常对其监控
[root@agent tmp]# echo "hello123" >> abc添加触发器
[root@agent tmp]# echo "hello123" >> abc配置用户媒介
- 服务端安装
[root@Server ~]# yum -y install postfix [root@Server ~]# systemctl enable --now postfix.service Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service. [root@Server ~]# ss -anlt State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 127.0.0.1:9000 0.0.0.0:* LISTEN 0 128 0.0.0.0:22 0.0.0.0:* LISTEN 0 100 127.0.0.1:25 0.0.0.0:* LISTEN 0 128 0.0.0.0:10050 0.0.0.0:* LISTEN 0 128 0.0.0.0:10051 0.0.0.0:* LISTEN 0 80 *:3306 *:* LISTEN 0 128 *:80 *:* LISTEN 0 128 [::]:22 [::]:* LISTEN 0 100 [::1]:25 [::]:*
[root@agent tmp]# echo "hello123" >> abc



