zabbix告警配置(包括添加触发器、媒介、动作和声音告警还有邮箱怎么配置)非常详细

zabbix告警配置

文章目录

1.添加触发器









2.手动触发验证





3.添加媒介(第三方邮箱)












4.添加动作







5.手动触发验证




6.本地邮箱告警配置



bash 复制代码
[root@zabbix-server ~]# hostnamectl set-hostname zabbixserver.example.com
[root@zabbix-server ~]# bash
[root@zabbixserver ~]# hostname
zabbixserver.example.com
[root@zabbixserver ~]# zabbix_get -s 192.168.116.143 -k vfs.file.cksum[/tmp/abc,sha256]
e54e4db5a177bd4d986796a020f202ec0f90f4aef037769bda181efd79cff9b2
[root@zabbixserver ~]# yum -y install postfix
Complete!
[root@zabbixserver ~]# yum provides *bin/mail
Last metadata expiration check: 2:09:28 ago on Sat 06 Jan 2024 01:19:35 PM CST.
s-nail-14.9.22-6.el9.x86_64 : Environment for sending and receiving mail
Repo        : appstream
Matched from:
Provide    : /bin/mail

s-nail-14.9.22-6.el9.x86_64 : Environment for sending and receiving mail
Repo        : devel
Matched from:
Provide    : /bin/mail
[root@zabbixserver ~]# yum -y install s-nail
Complete!
[root@zabbixserver ~]# systemctl enable --now postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@zabbixserver ~]# ss -antl
State              Recv-Q             Send-Q                          Local Address:Port                            Peer Address:Port             Process             
LISTEN             0                  4096                                  0.0.0.0:10050                                0.0.0.0:*                                    
LISTEN             0                  4096                                  0.0.0.0:10051                                0.0.0.0:*                                    
LISTEN             0                  4096                                127.0.0.1:9000                                 0.0.0.0:*                                    
LISTEN             0                  100                                 127.0.0.1:25                                   0.0.0.0:*                                    
LISTEN             0                  128                                   0.0.0.0:22                                   0.0.0.0:*                                    
LISTEN             0                  100                                     [::1]:25                                      [::]:*                                    
LISTEN             0                  70                                          *:33060                                      *:*                                    
LISTEN             0                  511                                         *:80                                         *:*                                    
LISTEN             0                  128                                      [::]:22                                      [::]:*                                    
LISTEN             0                  151                                         *:3306                                       *:*                    
[root@zabbixserver ~]# which mail
/usr/bin/mail
[root@zabbixserver ~]# echo "hello china" | mail -s "wenhou" 邮箱



bash 复制代码
[root@zabbixserver ~]# find / -name zabbix
find: '/proc/1389757': No such file or directory
find: '/proc/1389777': No such file or directory
/root/zabbix-6.4.10/src/zabbix_java/src/com/zabbix
/root/zabbix-6.4.10/src/go/plugins/zabbix
/var/lib/selinux/targeted/active/modules/100/zabbix
/usr/local/share/zabbix
/opt/data/zabbix
[root@zabbixserver ~]# cd /usr/local/share/zabbix
[root@zabbixserver zabbix]# ls
alertscripts  externalscripts
[root@zabbixserver zabbix]# cd alertscripts/
[root@zabbixserver alertscripts]# ls
[root@zabbixserver alertscripts]# touch sendmail.sh
[root@zabbixserver alertscripts]# chmod +x sendmail.sh
[root@zabbixserver alertscripts]# vim sendmail.sh
[root@zabbixserver alertscripts]# cat sendmail.sh
#!/bin/bash

content=$(echo $1 | tr "\r\n" "\n")
subject=$(echo $2 | tr "\r\n" "\n")

echo "$content" | mail -s "$subject" $3
[root@zabbixserver alertscripts]# ./sendmail.sh "hello wuhan" "wenhou" 邮箱























相关推荐
斯~内克1 小时前
Centrifugo 深度解析:构建高性能实时应用的开源引擎
前端·开源
还是奇怪1 小时前
Linux - 安全排查 2
linux·运维·安全
牛奶咖啡131 小时前
Linux系统的常用操作命令——文件远程传输、文件编辑、软件安装的四种方式
运维·服务器·软件安装·linux云计算·scp文件远程传输·vi文件编辑·设置yum的阿里云源
weixin_437398211 小时前
转Go学习笔记(2)进阶
服务器·笔记·后端·学习·架构·golang
tan77º3 小时前
【Linux网络编程】Socket - UDP
linux·服务器·网络·c++·udp
czhc11400756633 小时前
Linux 76 rsync
linux·运维·python
说私域3 小时前
基于开源AI智能名片链动2+1模式的S2B2C商城小程序:门店私域流量与视频号直播融合的生态创新研究
人工智能·小程序·开源
szxinmai主板定制专家4 小时前
【精密测量】基于ARM+FPGA的多路光栅信号采集方案
服务器·arm开发·人工智能·嵌入式硬件·fpga开发
你不知道我是谁?4 小时前
负载均衡--四层、七层负载均衡的区别
运维·服务器·负载均衡
蓝易云4 小时前
Qt框架中connect()方法的ConnectionType参数使用说明 点击改变文章字体大小
linux·前端·后端