您好,登錄后才能下訂單哦!
一.由于運(yùn)維工作使用的操作系統(tǒng)多是CentOS和ubuntu,兩個(gè)系統(tǒng)上面安裝的飛信依賴(lài)包會(huì)有所不同,現(xiàn)在我就安裝一下CentOS的fetion
二.安裝fetion的一些依賴(lài)包 由于fetion需要的是32位系統(tǒng)的包,所以安裝的軟件名稱(chēng)后面加上.i686(ubuntu軟件名稱(chēng)后面是: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文件已經(jīng)被作者更新,無(wú)法使用,所以要重官網(wǎng)下載fetion最新文件,文件下載網(wǎng)址(http://bbs.it-adv.net/viewthread.php?tid=1081&extra=page%3D1)(注意:此網(wǎng)址不能直接點(diǎn)擊打開(kāi),要拷貝到瀏覽器里面打開(kāi))
[root@localhost ~]chmod +x fetion
[root@localhost ~]mv fetion /usr/sbin/
[root@localhost ~]cp /usr/sbin/fetion /usr/local/fetion/
四.下載更新后的庫(kù)文件
[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/
五.安裝完成之后測(cè)試,輸入完驗(yàn)證碼就可以正常發(fā)送短信
[root@localhost ~]fetion --mobile=13918016506 --pwd=Aiyou1234 --to=13918016506,13918016506 --msg-utf8="hello world"
要求輸入驗(yàn)證碼,驗(yàn)證碼的路徑在/usr/sbin路徑下,由于是圖片下載到本地查看
六.nagios配置配置飛信報(bào)警
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 $"
)
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。