//配置gnokii
mkdir -p /root/.config/gnokii
cp /usr/local/share/doc/gnokii/sample/gnokiirc /root/.config/gnokii/config
vi /root/.config/gnokii/config
[global]
port = /dev/ttyS0
model = AT
initlength = default
connection = serial
use_locking = no
serial_baudrate = 9600
smsc_timeout = 10
[xgnokii]
allow_breakage = 0
[gnokiid]
bindir = /usr/local/bin/
[connect_script]
TELEPHONE = 12345678
[disconnect_script]
[logging]
debug = off
rlpdebug = off
xdebug = off
[phone_fake]
port = foobar
model = AT
connection = serial
[fake_driver]
sms_inbox = /tmp/sms
//测试gnokii
/usr/local/bin/gnokii --identify
[root@Nagios ~]# gnokii --identify
GNOKII Version 0.6.30
Cannot open logfile /root/.cache/gnokii/gnokii-errors
WARNING: cannot open logfile, logs will be directed to stderr
Lockfile /var/lock/LCK..ttyS0 is stale. Overriding it...
IMEI : 351047888189814
Manufacturer : WAVECOM MODEM
No flags section in the config file.
Model : MULTIBAND 900E 1800
Product name : MULTIBAND 900E 1800
Revision : 641b09gg.Q2403A 132
//测试短信
echo -e "Give me a surprise" |/usr/local/bin/gnokii --sendsms 1581111****(号码)
//赋予权限
chown -R nagios.nagios /usr/local/bin/gnokii
chown -R nagios.nagios /dev/ttyS0
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14661773/viewspace-751455/,如需转载,请注明出处,否则将追究法律责任。