Gnokii SMS

Gnokii SMS

Gnokii é um conjunto de ferramentas que permitem várias operações em celulares e modens GSM. Entre elas o envio de SMS para uso de notificações.

Instalar:

CentOS:

yum install gnokii

debian:

apt-get install gnokii

Configuração: vim /etc/gnokiirc

[global]
 port = /dev/ttyACM0
 model = AT
 initlength = default
 connection = serial
 serial_baudrate = 19200
 2 smsc_timeout = 10
 [xgnokii]
 allow_breakage = 0
 [gnokiid]
 bindir = /usr/sbin/
 [logging]
 debug = on
 rlpdebug = off
 xdebug = off

Teste :

[root@r2d2 etc]# gnokii --identify
GNOKII Version 0.6.19
IMEI         : 356019013673843
Manufacturer : Sony Ericsson
Model        : AAC-1052021-BV
Product name : AAC-1052021-BV
Revision     : R1KG001 070418 2238

SMS:

[root@r2d2 etc]# echo "teste" | gnokii --sendsms 881205xx
GNOKII Version 0.6.19
Send succeeded!

Gnokii + Nagios

#Nagios command obj
# 'host-notify-by-gnokii' command definition
define command{
command_name host-notify-by-gnokii
command_line /opt/nagios/bin/sms_notification_by_gnokki $CONTACTPAGER$ "Nagios Host Alert nn $HOSTALIAS$ is $HOSTSTATE$; $OUTPUT$; $DATETIME$"
}

send sms example script:

#!/bin/sh
#
# Gnokii Plugin script
# (c) Horst venzke
# v 0.1 - 17.01.2004

mess=$2
number=$1
echo $mess | gnokii --sendsms $number
Advertisements

3 thoughts on “Gnokii SMS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s