nagios fetion - 飞信报警

【基本介绍】
这里我们介绍nagios利用飞信提供短信报警功能

【飞信安装测试】 - linux平台
[url]http://bbs.it-adv.net/viewthread.php?tid=916&extra=&page=1[/url]
1. libACE库的支持
拷贝相应的so文件到/usr/lib下面
2. fetion的安装配置
解压fetion文件到安装路径,例如/usr/local/fetion
3. 测试飞信是否正常 - 前提是你的手机测试过飞信
/usr/local/fetion/fetion --mobile=137*** --pwd=*** --to=137*** --msg-utf8="test"

【nagios配置】
配置命令

# notify-service-by-email
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddre
ss: $HOSTADDRESS$\nState: $SERVICESTATE$\n\
nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVI
CESTATE$ **" $CONTACTEMAIL$
}

# notify-host-by-sms
define command{
command_name notify-host-by-sms
command_line /usr/local/fetion/fetion --mobile=xxx --pwd=xxx --to=xxx,xxx,xxx --msg-gb=" $NOTIFICATIONTYPE$ H
ost Alert: $HOSTNAME$($HOSTADDRESS$) is $HOSTSTATE$ " --exit-on-verifycode=1 --msg-type=1
}


配置联系人

# create contact
define contact{
contact_name test_user
#use generic-contact
service_notification_options c,w,r,u
host_notification_options d,u,r
service_notification_commands notify-service-by-sms,notify-service-by-email
host_notification_commands notify-host-by-sms,notify-host-by-email
host_notification_period 24-7
service_notification_period 24-7
email xx
}

define contactgroup{
contactgroup_name xxx_user
alias Nagios xxx
members test_user
}



配置host,service

define host{
use linux-server
host_name xx-web03
address xx.xx.xx.xx
max_check_attempts 2
normal_check_interval 5
notification_interval 5
contact_groups xxx_user
check_command check-host-alive
notification_options d,u,r
}



【问题】
问题一
/usr/local/fetion/fetion: error while loading shared librarIEs: libstdc++.so.6: cannot open shared object file: No such file or Directory
解决方法:
yum -y install libstdc++.so.6

问题二
/usr/local/fetion/fetion: error while loading shared libraries: libgssapi_krb5.so.2: cannot open shared object file: No such file or directory
解决办法
yum install krb5-libs

问题三
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
解决办法:
yum -y install libz.so.1 --setopt=protected_multilib=false

【参考引用】
[url]http://tamenglang.blog.51cto.com/431396/183917[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值