创建一个 Disaster 级别的触发器
参考 Template ICMP Ping 创建一个trigger,然后修改一下 Severity 的级别
Tip: 简便方法是 Link 一下模板,然后 Unlik 一下 ,不要选择 Unlink and clear 否则又没了
通过防火墙丢弃icmp包触发报警
[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
原文地址
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。