On Sun, Aug 20, 2006 at 07:34:58AM +0200, Michael Magua wrote:
In hobbit-alerts.cfg I have:
HOST=mail
MAIL user-d7ae79a03f32@xymon.invalid REPEAT=20 SERVICE=smtp
#SCRIPT /usr/local/bin/smsalert FORMAT=SMS
#SCRIPT echo "$BBALPHAMSG" | gnokii --sendsms <cell number> FORMAT=SMS
Both of those script calls are commented out as I was trying various
things. Here is my /usr/local/bin/smsalert:
#!/bin/sh
echo "$BBALPHAMSG" | gnokii --sendsms <cell number>
Your SCRIPT command is partially wrong; the "recipient" parameter is
missing. This is typically the phone-number for the SMS recipient.
If you don't want to use it, just put some dummy value there. This
parameter is passed to the script as $RCPT.
I tested it myself, and found two possible problems:
1) Make sure the "hobbit" user can access the serial port. In my
setup, the user must be in the "dialout" group to access the
/dev/ttyS0 file (the serial port device); check the file
permissions on your serial device.
2) gnokii complains if the message test is more than 160 characters.
Change your script command to
echo "${BBALPHAMSG:0:160}" | gnokii --sendsms "$RCPT"
If you still have problems, the ~hobbit/server/logs/page.log has the
output from the script commands, so you should check that for
errors.
Regards,
Henrik