CentOS 6.5 x64安裝nagios fetion報警

一.由於運維工作使用的操作系統多是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]#  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最新文件,文件下載網址http://bbs.it-adv.net/viewthread.php?tid=1081&extra=page%3D1)注意:此網址不能直接點擊打開,要拷貝到瀏覽器裏面打開

120503850.png

[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

114826624.png

[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"113407981.png

要求輸入驗證碼,驗證碼的路徑在/usr/sbin路徑下,由於是圖片下載到本地查看

113937753.png

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




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章