gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Nagios/Groundwork's issue


From: Martyn
Subject: Nagios/Groundwork's issue
Date: Wed, 23 Sep 2009 11:36:28 +0100

Hi all, I have just installed Gnokii for my SMS alerts and having a few issues, could you check my config and let me know if you see any errors or any reason why I can not send SMS alerts.

I can send SMS via command line in the following way:

echo "Hello World" | gnokii --sendsms +123456789 –r

Here is my Nagios Command:

/usr/bin/printf "%.120s" "ALERT\n\nNotification Type:  $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:  $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$ ##" | gnokii --sendsms "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is$SERVICESTATE$ **" $CONTACTEMAIL$ -r

And my .gnokiirc file

[global]
 port = /dev/ttyS0
 model = AT
 initlength = default
 connection = serial
 use_locking = yes
 serial_baudrate = 115200
 handshake = software
 sm_retry = 1
 smsc_timeout = 10
 [gnokiid]
 bindir = /usr/local/sbin/
 [connect_script]
 TELEPHONE = 123456789
 [disconnect_script]
 [logging]
 debug = on
 rlpdebug = off
 xdebug = on

From within Groundworks I get the following from a test

/usr/bin/printf "%.120s" "ALERT\n\nNotification Type: -\n\nService: service_desc\nHost: Linux Server #1\nAddress: 127.0.0.1\nState: UP\n\nDate/Time: 2009-09-23 11:34:19\n\nAdditional Info:\n\n- ##" | gnokii --sendsms "** - alert - Linux Server #1/service_desc isUP **" - -r

GNOKII Version 0.6.22
Couldn't read ä·x†Í·ˆ‘±]/.gnokiirc config file.
Couldn't read ä·x†Í·ˆ‘±]/.gnokiirc config file.
LOG: debug mask is 0x1
LOG: xdebug mask is 0x1
Config read from file /etc/gnokiirc.
ERROR: Can't find HOME environment variable!
WARNING: cannot open logfile, logs will be directed to stderr
phone instance config:
model = AT
port = /dev/ttyS0
connection = serial
initlength = default
serial_baudrate = 115200
serial_write_usleep = -1
handshake = software
require_dcd = 0
smsc_timeout = 10
rfcomm_channel = 1
sm_retry = 1
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
41 54 5a 0d                                     | ATZ            
write: [ATZ<cr>]
read : [ATZ<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x000a
02 41 54 5a 0d 0d 0a 4f 4b 0d                   |  ATZ   OK      
Received message type 00
Message sent: 0x00 / 0x0005
41 54 45 31 0d                                  | ATE1           
write: [ATE1<cr>]
read : [ATE1<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x000b
02 41 54 45 31 0d 0d 0a 4f 4b 0d                |  ATE1   OK     
Received message type 00
Message sent: 0x00 / 0x000a
41 54 2b 43 4d 45 45 3d 31 0d                   | AT+CMEE=1      
write: [AT+CMEE=1<cr>]
read : [AT+CMEE=1<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x0010
02 41 54 2b 43 4d 45 45 3d 31 0d 0d 0a 4f 4b 0d |  AT+CMEE=1   OK
Received message type 00
Message sent: 0x06 / 0x0008
41 54 2b 43 47 4d 4d 0d                         | AT+CGMM        
write: [AT+CGMM<cr>]
read : [AT+CGMM<cr><cr><lf> MULTIBAND  900E  1800 <cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x06 / 0x0029
02 41 54 2b 43 47 4d 4d 0d 0d 0a 20 4d 55 4c 54 |  AT+CGMM    MULT
49 42 41 4e 44 20 20 39 30 30 45 20 20 31 38 30 | IBAND  900E  180
30 20 0d 0a 0d 0a 4f 4b 0d                      | 0     OK       
Received message type 06
Message sent: 0x06 / 0x0008
41 54 2b 43 47 4d 49 0d                         | AT+CGMI        
write: [AT+CGMI<cr>]
read : [AT+CGMI<cr><cr><lf> WAVECOM WIRELESS CPU<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x06 / 0x0027
02 41 54 2b 43 47 4d 49 0d 0d 0a 20 57 41 56 45 |  AT+CGMI    WAVE
43 4f 4d 20 57 49 52 45 4c 45 53 53 20 43 50 55 | COM WIRELESS CPU
0d 0a 0d 0a 4f 4b 0d                            |     OK         
Received message type 06
Message sent: 0x61 / 0x0009
41 54 2b 43 53 43 53 3f 0d                      | AT+CSCS?       
write: [AT+CSCS?<cr>]
read : [AT+CSCS?<cr><cr><lf>+CSCS: "PCCP437"<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x61 / 0x0023
02 41 54 2b 43 53 43 53 3f 0d 0d 0a 2b 43 53 43 |  AT+CSCS?   +CSC
53 3a 20 22 50 43 43 50 34 33 37 22 0d 0a 0d 0a | S: "PCCP437"   
4f 4b 0d                                        | OK             
Received message type 61
Initialisation completed
 usage: --sendsms destination              recipient number (msisdn)
        --smsc message_center_number       number (msisdn) of the message
                                           center
        --smscno message_center_index      index of the message center stored
                                           in the phone memory
        -l n
        --long n                           send message longer than default
                                           160 characters
        -r
        --report                           request delivery report
        -v n
        --validity n                       set message validity
        -C n
        --class n                          set message class; possible values
                                           are 0, 1, 2, or 3
        -8
        --8bit                             set 8bit coding
        -i
        --imelody                          send imelody message, text is read
                                           from stdin
        -a file;file;file;file
        --animation file;file;file;file    send animation message
        -o this;total;serial
        --concat this;total;serial         send 'this' part of all 'total' parts
                                           identified by 'serial'
        -w url
        --wappush url                      send wappush to the given url
Message text is read from standard input.

Serial device: closing device

Command returned exit status 255

Thanks all



reply via email to

[Prev in Thread] Current Thread [Next in Thread]