歡迎您光臨本站 註冊首頁

CentOS5.4下安裝簡訊貓

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

為了能及時知道網站的運行情況,我打算給我們伺服器上一套監控系統,在網站出現問題后,及時的通知我,初步打算採用郵件,簡訊,msn這三種方式,今天我們這篇文章主要是講linux下簡訊貓的安裝.

硬體環境:一台老掉牙的伺服器(自攢的,用了5年了),GPRS簡訊貓(串口的)
軟體環境:CentOS5.4(基礎化安裝,安裝組件參見<利用yum安裝postfix郵件伺服器>)

好,介紹完畢,我們首先對linux進行yum update -y &操作保證最新.

第一:安裝硬體:把簡訊貓接上電,把sim卡插入,把串口接到伺服器主板的介面上.
第二:安裝minicom,gettext-devel gettext
[root@nagios ~]# yum install -y minicom gettext-devel gettext
第三:運行命令:
[root@nagios ~]# minicom -s ,配置Serial port setup–>Bps/Par/Bits, 將相關值改為9600 8N1, /dev/modem改為對應串口(ttyS0是串口1,ttyS1是串口2). 選擇Save setup as dfl—>Exit from Minicom
第四:從http://www.gnokii.org/下載gnokii,並編譯安裝.
[root@nagios ~]# tar jxvf gnokii-0.6.28.1.tar.bz2
[root@nagios ~]# cd gnokii-0.6.28
[root@nagios ~]# ./configure
[root@nagios ~]# gmake
[root@nagios ~]# gmake install
[root@nagios ~]#cp /usr/local/share/doc/gnokii/sample/gnokiirc /root/.gnokiirc
[root@nagios ~]#vi ~/.gnokiirc(修改如下幾項)
model = AT
# model = 6110
serial_baudrate = 9600

[root@nagios ~]#gnokii -identify#檢測
GNOKII Version 0.6.28
LOG: debug mask is 0x1
Config read from file /root/.gnokiirc.
phone instance config:
model = AT
port = /dev/ttyS0
connection = serial
initlength = default
serial_baudrate = 9600
serial_write_usleep = -1
handshake = software
require_dcd = 0
smsc_timeout = 10
rfcomm_channel = 0


sm_retry = 0
Initializing AT capable mobile phone ...
Serial device: opening device /dev/ttyS0
Serial device: setting RTS to high and DTR to high
Message sent: 0x00 / 0x0004
-----華麗的省略線------ (不省略博文不顯示)
Received message type 06
IMEI : 012345678901234
Manufacturer : WAVECOM MODEM
Model : MULTIBAND 900E 1800
Product name : MULTIBAND 900E 1800
Revision : 534_09gg.2D 1748852
Serial device: closing device
[root@nagios ~]#
說明木問題了,你可以發給簡訊試一試:
[root@nagios ~]# echo -e "我注意你很久了." | gnokii --sendsms 1365139XXXX

很快你就收到了,如果有什麼問題,可以留言,也可以發送問題到我的郵箱:guoli0813@163.com


[火星人 ] CentOS5.4下安裝簡訊貓已經有646次圍觀

http://coctec.com/docs/linux/show-post-51880.html