您的位置:首页 > 运维架构 > Linux

CentOS 6.5 x64安装nagios fetion报警

2013-12-10 11:20 555 查看
一.由于运维工作使用的操作系统多是CentOS和ubuntu,两个系统上面安装的飞信依赖包会有所不同,现在我就安装一下CentOS的fetion
二.安装fetion的一些依赖包 由于fetion需要的是32位系统的包,所以安装的软件名称后面加上.i686(ubuntu软件名称后面是:i386)

[root@localhost ~]#yum install glibc.i686 krb5-libs.i686 libstdc++.i686 zlib.i686
二.下载fetion程序文件[root@localhost ~]wget http://www.it-adv.net/fetion/downng/fetion20091117-linux.tar.gz[root@localhost ~]tar zxvf fetion20091117-linux.tar.gz[root@localhost ~]mv fx/ /usr/local/fetion[root@localhost ~]cd /usr/local/fetion/[root@localhost fetion]# lscache commands done fetion libACE-5.7.2.so libACE_SSL-5.7.2.so libcrypto.so.4 libeay32.dll libssl.so.4 logs plugins[root@localhost fetion]#sudo vim /etc/ld.so.confinclude /etc/ld.so.conf.d/*.conf/usr/local/fetion[root@localhost fetion]#sudo ldconfig三.由于fetion20091117-linux.tar.gz文件里面的fetion文件已经被作者更新,无法使用,所以要重官网下载fetion最新文件,文件下载网址http://bbs.it-adv.net/viewthread.php?tid=1081&extra=page%3D1)(注意:此网址不能直接点击打开,要拷贝到浏览器里面打开)

[root@localhost ~]chmod +x fetion[root@localhost ~]mv fetion /usr/sbin/[root@localhost ~]cp /usr/sbin/fetion /usr/local/fetion/四.下载更新后的库文件[root@localhost ~]wget http://www.it-adv.net/fetion/linuxso_20101113.rar[root@localhost ~]wget http://www.rarsoft.com/rar/rarlinux-3.6.0.tar.gz (rar的解压软件)
[root@localhost ~]tar zxvf rarlinux-3.6.0.tar.gz
[root@localhost ~]cd rar
[root@localhost rar]#make
[root@localhost rar]#cd ..
[root@localhost ~]unrar x linuxso_20101113.rar

[root@localhost ~]cp libACE* libcrypto.so.4 libssl.so.4 /usr/local/fetion/五.安装完成之后测试,输入完验证码就可以正常发送短信[root@localhost ~]fetion --mobile=13918016506 --pwd=Aiyou1234 --to=13918016506,13918016506 --msg-utf8="hello world"

要求输入验证码,验证码的路径在/usr/sbin路径下,由于是图片下载到本地查看


六.nagios配置配置飞信报警Configuration contacts.cfg

define contact (
contact_name admin
alias system admin
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d, r
service_notification_options c, w, r
service_notification_commands notify-service-by-fetion
host_notification_commands notify-host-by-fetion
pager 139xxxxxxxxx
)
Configuration miscommands.cfg file
define command (
command_name notify-host-by-fetion
command_line /usr/sbin/fetion --mobile=139xxxxxxxx --pwd=xxxxxxxx --to=$CONTACTPAGER$ --msg-utf8="Host $ HOSTSTATE $ alert for $ HOSTNAME $! on '$ LONGDATETIME $'"
)
define command (
command_name notify-service-by-fetion
command_line /usr/sbin/fetion --mobile=139xxxxxxxx --pwd=xxxxxxxx --to=$CONTACTPAGER$ --msg-utf8="$ HOSTADDRESS $ $ HOSTALIAS $ / $ SERVICEDESC $ is $ SERVICESTATE $ on $ LONGDATETIME $"


本文出自 “运维” 博客,请务必保留此出处http://czar90.blog.51cto.com/2239743/1338764
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: