[hobbit] Gnokii and Hobbit
Michael Magua
m.magua at gmail.com
Sun Aug 20 21:36:35 CEST 2006
On 8/20/06, Henrik Stoerner <henrik at hswn.dk> wrote:
> On Sun, Aug 20, 2006 at 07:34:58AM +0200, Michael Magua wrote:
> >
> > In hobbit-alerts.cfg I have:
> >
> > HOST=mail
> > MAIL admin at domain.com 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
Hi
I have no clue why this still isn't working!
Now in hobbit-alerts.cfg I have:
SCRIPT /usr/local/bin/smsalert FORMAT=SMS
And /usr/local/bin/smsalert is:
#!/bin/bash
echo "${BBALPHAMSG:0:160}" | gnokii --sendsms 012345678
Where 012345678 is my cellnumber. Permissions are fine because user
hobbit can send an sms via the command line by doing `echo "hello" |
gnokii --sendsms 012345678`. I then get an sms.
More information about the Xymon
mailing list