Hi
Has anyone managed to get gnokii to work with Hobbit for alerts? I'm a bit stumped.
I have a premicell and a serial cable going from the server to the premicell. I compiled gnokii and from the command line I can do:
echo "some msg" | gnokii --sendsms <cell number>
And that works. However following the examples from the Hobbit website on sms notifications does not work.
Any help would be greatly appreciated!
Regards Michael Magua
On Sat, Aug 19, 2006 at 10:08:10PM +0200, Michael Magua wrote:
I have a premicell and a serial cable going from the server to the premicell. I compiled gnokii and from the command line I can do:
echo "some msg" | gnokii --sendsms <cell number>
And that works. However following the examples from the Hobbit website on sms notifications does not work.
"Does not work" is a rather generic error description. What exactly is that that you cannot get to work? Your alerting rules, the alert script you're - presumably - using to interface with Gnokii, or ... ?
Perhaps if you'd show us what's in your hobbit-alerts.cfg file, and how you're trying to invoke gnokii via an alerting script ? It would make troubleshooting a lot easier.
Regards, Henrik
On 8/19/06, Henrik Stoerner <henrik at hswn.dk> wrote:
On Sat, Aug 19, 2006 at 10:08:10PM +0200, Michael Magua wrote:
I have a premicell and a serial cable going from the server to the premicell. I compiled gnokii and from the command line I can do:
echo "some msg" | gnokii --sendsms <cell number>
And that works. However following the examples from the Hobbit website on sms notifications does not work.
"Does not work" is a rather generic error description. What exactly is that that you cannot get to work? Your alerting rules, the alert script you're - presumably - using to interface with Gnokii, or ... ?
Perhaps if you'd show us what's in your hobbit-alerts.cfg file, and how you're trying to invoke gnokii via an alerting script ? It would make troubleshooting a lot easier.
Regards, Henrik
Sure.
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>
None of these ideas work. If I use the sendsms method as described in the examples on the Hobbit site, those don't work either.
Thanks Michael
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:
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.
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
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:
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.
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.
On Sun, Aug 20, 2006 at 09:36:35PM +0200, Michael Magua wrote:
I have no clue why this still isn't working!
Now in hobbit-alerts.cfg I have:
SCRIPT /usr/local/bin/smsalert FORMAT=SMS
You're still missing a recipient.
SCRIPT /usr/local/bin/smsalert 012345678 FORMAT=SMS
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.
What's in the page.log file ?
Regards, Henrik
On 8/20/06, Henrik Stoerner <henrik at hswn.dk> wrote:
On Sun, Aug 20, 2006 at 09:36:35PM +0200, Michael Magua wrote:
I have no clue why this still isn't working!
Now in hobbit-alerts.cfg I have:
SCRIPT /usr/local/bin/smsalert FORMAT=SMS
You're still missing a recipient.
SCRIPT /usr/local/bin/smsalert 012345678 FORMAT=SMS
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.What's in the page.log file ?
Regards, Henrik
Yum recipient is missing as I have it in /usr/local/bin/smsalert: #!/bin/bash echo "${BBALPHAMSG:0:160}" | gnokii --sendsms 012345678
I couldn't find logs. I don't have the page.log as you suggested.
On Sun, Aug 20, 2006 at 10:29:05PM +0200, Michael Magua wrote:
Yum recipient is missing as I have it in /usr/local/bin/smsalert:
The syntax for hobbit-alerts.cfg requires it.
I couldn't find logs. I don't have the page.log as you suggested.
Yes you do. In the ~hobbit/server/logs/ directory, or /var/lib/hobbit if you use the pre-built packages.
Regards, Henrik
On Sun, Aug 20, 2006 at 10:37:06PM +0200, Henrik Stoerner wrote:
I couldn't find logs. I don't have the page.log as you suggested.
Yes you do. In the ~hobbit/server/logs/ directory, or /var/lib/hobbit if you use the pre-built packages.
Sorry, that last one should be /var/log/hobbit, of course.
Henrik
On 8/20/06, Henrik Stoerner <henrik at hswn.dk> wrote:
On Sun, Aug 20, 2006 at 10:37:06PM +0200, Henrik Stoerner wrote:
I couldn't find logs. I don't have the page.log as you suggested.
Yes you do. In the ~hobbit/server/logs/ directory, or /var/lib/hobbit if you use the pre-built packages.
Sorry, that last one should be /var/log/hobbit, of course.
Henrik
I have alot of these:
2006-08-21 07:40:48 Tried to down BOARDBUSY: Invalid argument 2006-08-21 07:45:54 Tried to down BOARDBUSY: Invalid argument 2006-08-21 07:59:07 Tried to down BOARDBUSY: Invalid argument 2006-08-21 08:03:10 Tried to down BOARDBUSY: Invalid argument 2006-08-21 08:05:54 Tried to down BOARDBUSY: Invalid argument
Michael
On Mon, Aug 21, 2006 at 08:07:38AM +0200, Michael Magua wrote:
On 8/20/06, Henrik Stoerner <henrik at hswn.dk> wrote:
On Sun, Aug 20, 2006 at 10:37:06PM +0200, Henrik Stoerner wrote:
I couldn't find logs. I don't have the page.log as you suggested.
Yes you do. In the ~hobbit/server/logs/ directory, or /var/lib/hobbit if you use the pre-built packages.
Sorry, that last one should be /var/log/hobbit, of course.
I have alot of these:
2006-08-21 07:40:48 Tried to down BOARDBUSY: Invalid argument
Harmless, they often show up when Hobbit is shut down or restarted. No "Gnokii" entries ? In that case your alert setup doesn't trigger any alerts. What's in the "notifications.log" file - same directory?
Regards, Henrik
On 8/21/06, Henrik Stoerner <henrik at hswn.dk> wrote:
On Mon, Aug 21, 2006 at 08:07:38AM +0200, Michael Magua wrote:
On 8/20/06, Henrik Stoerner <henrik at hswn.dk> wrote:
On Sun, Aug 20, 2006 at 10:37:06PM +0200, Henrik Stoerner wrote:
I couldn't find logs. I don't have the page.log as you suggested.
Yes you do. In the ~hobbit/server/logs/ directory, or /var/lib/hobbit if you use the pre-built packages.
Sorry, that last one should be /var/log/hobbit, of course.
I have alot of these:
2006-08-21 07:40:48 Tried to down BOARDBUSY: Invalid argument
Harmless, they often show up when Hobbit is shut down or restarted. No "Gnokii" entries ? In that case your alert setup doesn't trigger any alerts. What's in the "notifications.log" file - same directory?
Regards, Henrik
Well I gave the box a reboot and it all works now! :)
participants (2)
-
henrik@hswn.dk
-
m.magua@gmail.com