CentOS 6.5 x64安装Nagios 飞信报警

一.由于运维工作使用的操作系统多是CentOSUbuntu,两个系统上面安装的飞信依赖包会有所不同,现在我就安装一下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
[root@localhost ~]tar zxvf fetion20091117-linux.tar.gz
[root@localhost ~]mv fx/ /usr/local/fetion
[root@localhost ~]cd /usr/local/fetion/
[root@localhost fetion]#  ls
cache  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.conf
include /etc/ld.so.conf.d/*.conf
/usr/local/fetion
[root@localhost fetion]#sudo ldconfig

三.由于fetion20091117-linux.tar.gz文件里面的fetion文件已经被作者更新,无法使用,所以要重官网下载fetion最新文件,文件下载网址(  )

[root@localhost ~]chmod +x fetion
[root@localhost ~]mv fetion /usr/sbin/
[root@localhost ~]cp /usr/sbin/fetion /usr/local/fetion/
四.下载更新后的库文件
[root@localhost ~]wget
[root@localhost ~]wget (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

Ubuntu 12.04 x64 安装Nagios飞信报警


[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路径下,由于是图片下载到本地查看

Ubuntu 12.04 x64 安装Nagios飞信报警


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

Ubuntu 12.04 x64 安装Nagios飞信报警

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 $"

Nagios 的详细介绍请点这里
Nagios 的下载地址请点这里

相关阅读

Nagios 实现飞信告警配置

Nagios结合飞信实现短信报警之安装飞信

Nagios飞信Linux系统免费短信报警配置

教你实现Nagios监控Linux主机及飞信报警

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/11fc46f7583f421ff23e5bdcf8bb941f.html