Zabbix 短信报警配置4

2022-02-09 19:43:38 浏览数 (1)

触发测试

创建一个 Disaster 级别的触发器

参考 Template ICMP Ping 创建一个trigger,然后修改一下 Severity 的级别

Tip: 简便方法是 Link 一下模板,然后 Unlik 一下 ,不要选择 Unlink and clear 否则又没了

通过防火墙丢弃icmp包触发报警

代码语言:javascript复制
[root@h101 ~]# iptables -L -nv | grep icmp
    7   672 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           
   87  9577 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 
[root@h101 ~]# grep icmp /etc/sysconfig/iptables
-A INPUT -p icmp -j ACCEPT 
#-A INPUT -p icmp -j DROP 
-A INPUT -j REJECT --reject-with icmp-host-prohibited 
#-A FORWARD -j REJECT --reject-with icmp-host-prohibited 
[root@h101 ~]# vim /etc/sysconfig/iptables
[root@h101 ~]# grep icmp /etc/sysconfig/iptables
#-A INPUT -p icmp -j ACCEPT 
-A INPUT -p icmp -j DROP 
-A INPUT -j REJECT --reject-with icmp-host-prohibited 
#-A FORWARD -j REJECT --reject-with icmp-host-prohibited 
[root@h101 ~]# /etc/init.d/iptables reload 
iptables: Trying to reload firewall rules:                 [  OK  ]
[root@h101 ~]# iptables -L -nv | grep icmp
    0     0 DROP       icmp --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 
[root@h101 ~]# 

过一小会儿(根据检查频度和触发规则而定),报警被触发了

几乎同时也收到了短信

Events 里也留下了记录

查看方法是 : [Monitoring]->[Events]


命令汇总

  • cat sms_get_balance.bash
  • ./sms_get_balance.bash
  • cat sms_sent_message.bash
  • ./sms_sent_message.bash
  • ./sms_sent_message.bash '15016017077' '高级报警测试
  • vim /etc/sysconfig/iptables
  • grep icmp /etc/sysconfig/iptables
  • /etc/init.d/iptables reload
  • iptables -L -nv | grep icmp

原文地址

0 人点赞