Xymon Mailing List Archive search

problems with sms script

3 messages in this thread

list Jarrod Hodder · Mon, 16 Jun 2008 15:38:44 +1000 ·
Hello

 
I have set up a script to send out a sms when ever the connection to my
proxy server fails.

I have used gammu as a SMS gateway. 

 
The script that I get hobbit to call to reads as following

 
#!/bin/sh

 
echo "test" | gammu --sendsms TEXT <Phone Number here>

 
When I am logged on as the user Hobbit, I can run the script fine. The
recipient receives the SMS, so the permissions are fine.

 
In my hobbits-alerts.cfg I have the following information

 
HOST=<Host Address> SERVICE=conn

SCRIPT /usr/local/bin/smstest <Phone Number>

 
I know that the variable $rcpt is not being used, I don't need it. The
phone number is coded into the script itself. I simply have it so
Hobbits will not fail.

 
When the script runs, the page.log file has this error in it.

 
2008-06-16 15:24:51 Paging script /usr/local/bin/smstest terminated with
status 255

 
Can I use a custom script like the one I have? Or do I need to use a
specific standard.

 
I don't want any specific information in the sms, just a notification
that is has fallen over. 

Currently, I just want it to send the 'test' sms.

 
Is what I am trying to achieve possible?

 
If it is, what have I done wrong?

Thanks


Jarrod Hodder

Paradigm IT Solutions

XXX Livingston Ave

Kambah ACT 2902

 
Phone: XXXX XXX XXX

Fax: XXXX XXX XXX

www.paradigmit.net.au <file:///\\www.paradigmit.net.au\>
list Tim McCloskey · Sun, 15 Jun 2008 22:49:46 -0700 ·
Try with the full path to 'gammu'. (the running hobbit env on your sys may be different than your shell).

I use the same method but not with true SMS, I just use mail.


example below.


page-primary.sh
/bin/mail -s "$BBSVCNAME $BBHOSTNAME $MACHIP $CFID" user-6e7ec7198606@xymon.invalid < /dev/null


hobbit-alerts.cfg
GROUP=linux,web SERVICE=*
SCRIPT /path/to/page-primary.sh FORMAT=sms COLOR=red


Jarrod Hodder wrote:
echo "test" | gammu --sendsms TEXT <Phone Number here>
list Jarrod Hodder · Mon, 16 Jun 2008 16:19:30 +1000 ·
New error now

Error opening device, you don't have permissions.
2008-06-16 16:15:16 Paging script /usr/local/bin/smstest terminated with
status 255

So now it is saying I don't have permission.

But I can execute the script fine from the hobbit user.

Something has gorn haywire.
quoted from Tim McCloskey

``````````````````````

Tim McCloskey Wrote:

Try with the full path to 'gammu'. (the running hobbit env on your sys
may be different than your shell).

I use the same method but not with true SMS, I just use mail.


example below.


page-primary.sh
/bin/mail -s "$BBSVCNAME $BBHOSTNAME $MACHIP $CFID"
user-6e7ec7198606@xymon.invalid < /dev/null


hobbit-alerts.cfg
GROUP=linux,web SERVICE=*
SCRIPT /path/to/page-primary.sh FORMAT=sms COLOR=red


Jarrod Hodder wrote:
echo "test" | gammu --sendsms TEXT <Phone Number here>