3 月 022014
 




zabbix-短信报警


4、创建fetion.sh短信发送脚本
cat fetion.sh

!/bin/bash

$1, $2, $3 mean Recipient, Subject and Message

fetion_dir=/usr/local/fetion

LDLIBRARYPATH=${fetiondir}/lib ${fetiondir}/fetion –mobile=13534283278 –pwd=13800138000 –to=$1 –msg-type=1 –msg-utf8=”$2 $3″

保存后测试脚本:
chmod a+x fetion.sh
./fetion.sh 135xxxxxxxx hello world
检查手机是否收到消息
5、新增zabbix的Media Type
登录到zabbix,进入“Administration” >> ”Media types”,点击右上角“Create Media Type”。
Description填”Fetion”或其它名称,Type选择”Script”,Script填”fetion.sh”。
点击”Save”保存配置。

vim zabbixserver.conf
AlertScriptsPath=/usr/local/zabbix/alertscripts
service zabbix
server restart
6、新增zabbix的Actions配置
登录到zabbix,进入”Configation” >> “Actions”,点击右上角”Create Actions”。
输入”Name”,其它都默认
点击右侧“Action Operations”下的”New”按钮,”Operation Type”选择”Send message”,”Send Message to”选择一个或多个要发送消息的用户组,”Send only to”选择我们之前新增的Fetion。
点击”Save”保存配置

7、zabbix用户配置
登录到zabbix, 进入”Adimistration” >> “Users”,在之前选定要发送消息的组里的Members栏位里选择一个用户,例如选择Admin用户。
在用户信息修改界面最下方的”Media”处点击”Add”按钮。
Type选择”Fetion”,Send to填入收信手机号码,其它参数按需修改,点击Add添加。
点击”Save”保存配置。
至此配置完成,触发一个警报试下手机是否收到讯息。

##########################注意

vim zabbix_server.conf
AlertScriptsPath=/usr/local/zabbix/alertscripts
这一步必须要做 否则无法发送短信



 Posted by at 上午 6:27

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny