Enviando SMS via Linha de Comando no Ubuntu

SMS 1.6 Device Settings Menu.

br-linux.org -

“Criei um pequeno tutorial de como enviar SMS usando linha de comando no Ubuntu.Isso pode ser de grande ajuda caso alguem use um sistema de monitoramento e queira ser avisado de erros em seu servidor.”

Enviado por Rafael Bernardes (rafael·stuartmusicΘgmail·com)

###########################################

Fiz um tutorial com o modem 3G gsm D301 HSPA Traveller para enviar SMS via linux(gnokii).Isso pode ser de grande valia se você tem um nagios gerenciando vários servidores.Você pode ser avisado no seu celular, por exemplo, que o disco do servidor encheu, ou que ele está fora do ar(não respondendo a pings).Ai vai da sua criatividade…

Quando encaixei o modem na USB do meu micro, recebi as seguintes mensagens:

Jan 14 13:33:39 rafael-desktop kernel: [ 8204.701752] usb0: unregister ‘cdc_ether’ usb-0000:00:10.0-2, CDC Ethernet Device
Jan 14 13:33:58 rafael-desktop kernel: [ 8223.335464] usb 1-2: new full speed USB device using uhci_hcd and address 4
Jan 14 13:33:58 rafael-desktop kernel: [ 8223.610749] usb 1-2: configuration #2 chosen from 1 choice
Jan 14 13:33:58 rafael-desktop kernel: [ 8223.620682] cdc_acm 1-2:2.1: ttyACM0: USB ACM device
Jan 14 13:33:59 rafael-desktop kernel: [ 8223.626794] cdc_acm 1-2:2.3: ttyACM1: USB ACM device
Jan 14 13:33:59 rafael-desktop kernel: [ 8223.642749] usb0: register ‘cdc_ether’ at usb-0000:00:10.0-2, CDC Ethernet Device, 02:80:37:fc:02:00

Instalando o Gnokii

Mais fácil impossivel

apt-get install gnokii

Usando o Gnokii

O gnokki ( http://www.gnokii.org/ ) é um poderoso canivete suiço pra celulares.Com ele você pode fazer o backup de sua agenda, dos seus contatos, e claro, enviar SMS.

Configuração:

No ubuntu, você precisará editar o arquivo /etc/gnokiirc.

# Set port to the physical port used to connect to your phone.
# Linux version is:
port = /dev/ttyACM0

# Set model to the model number of your phone. For the
# Symbian phones use:
# model = series60
# For other non-Nokia phones and when you want to use AT
# mode use:
# model = AT
# If you can’t figure out what to put here read the FAQ.
# If it still doesn’t help, consult gnokii-ml or #gnokii at freenode.
model = AT

# The type of the connection, for IR set this to infrared or irda.
# For the nk6110 driver only infrared is valid for the IrDA connection.
# See Docs/gnokii-ir-howto for more detailes on this.
# If you have 6210/6250/7110 phone and dau9p cable (the one you can
# use with 6100 series and cannot use hardware modem from the phone)
# you may want to use ‘dau9p’ value to get faster initialization.
# If you use dlr3 or dlr3p cable for nokia phones in FBUS mode (ie.
# you don’t use model = AT) you may want to use ‘dlr3p’ value here.
# Note that it is recommended and currently the best way to use this
# cable with nk6510 driver.
connection = serial

# Set this to ‘yes’ if you want gnokii to set and check the lock file in
# /var/lock directory. It avoids potential conflicts with other serial
# port software (eg. minicom). If you have wrong permissions for the
# directory, a warning will be generated. If you don’t want a lockfile, set
# it to ‘no’.
use_locking = yes

# Baudrate to use on serial port connections.
# Currently used only by models AT and BIP/CIMD. Defaults to 19200.
serial_baudrate = 19200

# Force serial port handshaking mode, useful primarily for “AT” model.
# Gnokii “AT” model uses software handshake by default.
# Possible values: hardware (RTS/CTS - 7 wires) or software (XON/XOFF - 3 wires)
handshake = software

O resto deixei padrão. Antes de tudo você terá que informar o PIN (se ele existir) ao gnokii:

root@rafael-desktop:~# gnokii - -entersecuritycode PIN
GNOKII Version 0.6.18
Enter your code:
Code ok.

Pronto!

Agora para enviar um sms para determinado número digite:

root@rafael-desktop:~# echo “Mensagem de teste” | gnokii - -sendsms 118643****-r
GNOKII Version 0.6.18
Send succeeded!

É isso!

Fonte - referência (rmb.mus.br)...

Comentários

Unknown disse…
como vc conseguiu instalar o Giant no Hardy Heron... estou há três dias tentando e nada ... tem como postar um tutorial para fazê-lo também... o usb do modem é reconhecido, mas o modem não... já fui no rules... já desmontei o pendrive (31MB Media), mas notei que, mesmo desmontado, continua a aparecer o ícone do mesmo... se puder dar uma luz ... agradeço...
Marcelo Ramalho disse…
Ola Tarcisio, boa tarde, eu apenas postei esse comentário que achei interessante, quem pode lhe informar melhor é quem escreveu o artigo que foi Enviado por Rafael Bernardes (rafael·stuartmusicΘgmail·com).
Fonte - referência (rmb.mus.br)

Postagens mais visitadas