ddddddf 发表于 2019-1-24 08:38:16

zabbix之 定义action 包括condition和operations(6)

  

  (a)定义action 包括 conditions 和 operations
configuration --> actions --> create action
action conditions operations  此时,我们添加一个item 对agent端的http服务80端口检测
  并添加trigger 设置一旦最后一次探测值为0 就触发 action
  

http://s2.运维网.com/wyfs02/M00/8B/39/wKiom1hHZKTx7GWvAABSw1A2eEU734.png-wh_500x0-wm_3-wmp_4-s_1946573218.png
  

  

http://s1.运维网.com/wyfs02/M01/8B/35/wKioL1hHZLaji0rMAABY91lgtRk711.png-wh_500x0-wm_3-wmp_4-s_45970053.png
  

  

http://s2.运维网.com/wyfs02/M02/8B/39/wKiom1hHZLai4yo0AABx7jA1OfQ027.png-wh_500x0-wm_3-wmp_4-s_3818774250.png
  

  

http://s2.运维网.com/wyfs02/M00/8B/35/wKioL1hHZLawOJ15AADBKVuuZuo866.png-wh_500x0-wm_3-wmp_4-s_62065573.png
  

  观察过程 monitoring --> events

  可以定义多个operations    zabbix server 会按照步骤依次执行

  operations 包括 send message 和 remote command 还有 发现主机等等 很多
  

  (b)报警脚本
  

  
http://s2.运维网.com/wyfs02/M00/8B/39/wKiom1hHZa-AF0ejAAENiVcTjxM063.png-wh_500x0-wm_3-wmp_4-s_79785169.png
  

  

http://s2.运维网.com/wyfs02/M00/8B/35/wKioL1hHZa_grA_VAABqwGsfX98151.png-wh_500x0-wm_3-wmp_4-s_1224127152.png
  

  

http://s2.运维网.com/wyfs02/M01/8B/35/wKioL1hHZa_BGe8qAABgwPno7cU136.png-wh_500x0-wm_3-wmp_4-s_469009404.png
  

  

http://s2.运维网.com/wyfs02/M02/8B/39/wKiom1hHZbChsKp9AAARZ9v5re4413.png-wh_500x0-wm_3-wmp_4-s_1675047917.png
  

  

http://s2.运维网.com/wyfs02/M02/8B/35/wKioL1hHZbDx3ehKAABoPT3Q3Lc211.png-wh_500x0-wm_3-wmp_4-s_443090122.png
  

  

http://s2.运维网.com/wyfs02/M00/8B/39/wKiom1hHZbGjml2NAAIZBfzD6Q0679.png-wh_500x0-wm_3-wmp_4-s_1998815437.png
  


  

# vim /usr/lib/zabbix/alertscripts/sendmail.sh
--> 必须在特定的目录下(服务器端)
#!/bin/bash
contact=$1
subject="$2"
body="$3"
echo "$body" | mail -s "$subject" "$contact"  




页: [1]
查看完整版本: zabbix之 定义action 包括condition和operations(6)