您好,登錄后才能下訂單哦!
一、安裝所需要的軟件
總下載地址:http://bbs.it-adv.net/viewthread.php?tid=1081&extra=page%3D1
wget http://www.it-adv.net/fetion/linuxso_20101113.rar
//下面的這個連接是下載飛信的可執行文件fetion,要注冊回復后才能看到
http://bbs.it-adv.net/p_w_upload.php?aid=43&k=954fb0d183808bfb706d8c4a35308874&t=1335168710
//下面的這個連接是下載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時如果報以下
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、創建fetion目錄
mkdir /usr/local/fetion
rar x linuxso_20101113.rar
cp ./lib* /usr/local/fetion
把下載的fetion執行程序拷貝過去到fetion目錄中,并修改fetion目錄屬主和屬組為nagios,增加執行權限
3、增加飛信所需的動態鏈接庫
vi /etc/ld.so.conf
/usr/local/fetion
4、這一步最關鍵,否則系統識別不到
ldconfig --更新/usr/local/fetion中的庫文件,能夠被系統識別
5、手動執行fetion,看是否報錯:
/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】測試
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為該手機的飛信密碼,并不是139密碼;如果出現send sms ok的話,就說明已經發生成功了,一般第一次發生的時候,會在fetion目錄生成該手機的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里面的聯系人
信息格式可以隨便修改,也可以這樣寫
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服務
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。