您好,登錄后才能下訂單哦!
一、安裝所需要的軟件
總下載地址:http://bbs.it-adv.net/viewthread.php?tid=1081&extra=page%3D1
wget http://www.it-adv.net/fetion/linuxso_20101113.rar
//下面的這個(gè)連接是下載飛信的可執(zhí)行文件fetion,要注冊(cè)回復(fù)后才能看到
http://bbs.it-adv.net/p_w_upload.php?aid=43&k=954fb0d183808bfb706d8c4a35308874&t=1335168710
//下面的這個(gè)連接是下載rar的解壓縮軟件文件的軟件
wget http://www.rarlab.com/rar/rarlinux-3.9.2.tar.gz
二、解壓下載的軟件
1,安裝rar的解壓縮軟件
tar zxvf rarlinux-3.9.2.tar.gz
cd rar
make && make install
make時(shí)如果報(bào)以下
rar: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
解決方法:
[root@localhost download]# yum install libstdc++.so.6
2、創(chuàng)建fetion目錄
mkdir /usr/local/fetion
rar x linuxso_20101113.rar
cp ./lib* /usr/local/fetion
把下載的fetion執(zhí)行程序拷貝過(guò)去到fetion目錄中,并修改fetion目錄屬主和屬組為nagios,增加執(zhí)行權(quán)限
3、增加飛信所需的動(dòng)態(tài)鏈接庫(kù)
vi /etc/ld.so.conf
/usr/local/fetion
4、這一步最關(guān)鍵,否則系統(tǒng)識(shí)別不到
ldconfig --更新/usr/local/fetion中的庫(kù)文件,能夠被系統(tǒng)識(shí)別
5、手動(dòng)執(zhí)行fetion,看是否報(bào)錯(cuò):
/usr/local/fetion/fetion
************************ IMPORTANT STATEMENT ************************
** **
** PLEASE DON'T USE THIS SOFTWARE TO SEND JUNK SHORT MESSAGES. **
** OTHERWISE PLEASE BEAR YOUR OWN CONSEQUENCES. **
** **
** Version:[20101205002-linux] **
*********************************************************************
This program is the console version of China Fetion!
It's free for personal user.
This project website: http://www.it-adv.net/
AUTHOR:KelvinH MSN/EMAIL:shichangguo@msn.com
Usage:
--mobile=[mobile]
--sid=[sid]
--pwd=[pwd]
--config=[config file] *format:index mobile password
--index=[index no in config file,refer to sample.conf]
--debug *debug mode on
--hide *login fetion in hidden state
--to=[mobile/sid]
--command-path=[command file path]
--robotmode
--daemon(linux only)
--proxy-ip(http proxy ip)
--proxy-port(http proxy port)
--msg-gb=[gb2312/gbk message]
--msg-utf8=[utf8 message]
--msg-type=[0/1/2 sms longsms smartmsg]
--file-gb=[gb2312/gbk file]
--file-utf8=[utf8 file]
--query-cmcc-no
--auto-retry
--exit-on-verifycode
--t3key=[http://www.tui3.com/page/smssend/]
6】測(cè)試
root># /usr/local/fetion/fetion --mobile=1371xx --pwd=xx --to=1371xx --msg-utf8="阿薩"
SIP-C/4.0 280 Send SMS OK
T: sip:203294876@fetion.com.cn;p=3044
I: 2
Q: 1 M
L: 116
D: Wed, 12 Dec 2012 03:41:17 GMT
XI: 8EB4A6172FA8AD75614FB3CC323AD8F0
--其中pwd為該手機(jī)的飛信密碼,并不是139密碼;如果出現(xiàn)send sms ok的話,就說(shuō)明已經(jīng)發(fā)生成功了,一般第一次發(fā)生的時(shí)候,會(huì)在fetion目錄生成該手機(jī)的jpg
7】修改commands.cfg
define command {
command_name notify-service-by-fetion
command_line /usr/local/fetion/fetion --mobile=1371xx --pwd=xx --msg-utf8="***Nagios***\nNotification Type: $NOTIFICATIONTYPE$\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n$SERVICEOUTPUT$ " --to=1371xx
}
define command {
command_name notify-host-by-fetion
command_line /usr/local/fetion/fetion --mobile=1371xx --pwd=xx --msg-utf8="***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\nDate/Time: $LONGDATETIME$\n " --to=1371xx
}
--其中to后面可以是contacts.cfg里面的聯(lián)系人
信息格式可以隨便修改,也可以這樣寫(xiě)
define command{
command_name notify-host-by-fetion
command_line /usr/local/fetion/fetion --mobile=1371x --pwd=xx --msg-utf8="***Nagios***\nNotification Type: $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$" --to=1371xx
}
# 'notify-service-by-fetion' command definition
define command{
command_name notify-service-by-fetion
command_line /usr/local/fetion/fetion --mobile=1371 --pwd=xx --msg-utf8="***Nagios***\nNotification Type: $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" --to=xx
}
8】修改contacts.cfg,增加pager
define contact {
contact_name nagiosadmin
alias nagios administrator
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-fetion,notify-service-by-email
host_notification_commands notify-host-by-fetion,notify-service-by-email
# email 1371@139.com
pager 1371xx
9】重啟nagios服務(wù)
免責(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)容。