Xymon Mailing List Archive search

Gnokii and Hobbit

13 messages in this thread

list Michael Magua · Sat, 19 Aug 2006 08:41:22 +0200 ·
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
list Michael Magua · Sat, 19 Aug 2006 22:08:10 +0200 ·
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
list Henrik Størner · Sat, 19 Aug 2006 23:20:55 +0200 ·
quoted from 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
list Michael Magua · Sun, 20 Aug 2006 07:34:58 +0200 ·
quoted from Henrik Størner
On 8/19/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> 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 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>

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
list Henrik Størner · Sun, 20 Aug 2006 10:30:54 +0200 ·
quoted from Michael Magua
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
list Michael Magua · Sun, 20 Aug 2006 21:36:35 +0200 ·
quoted from Henrik Størner
On 8/20/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
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
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.
list Henrik Størner · Sun, 20 Aug 2006 22:19:32 +0200 ·
quoted from Michael Magua
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
quoted from Michael Magua
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
list Michael Magua · Sun, 20 Aug 2006 22:29:05 +0200 ·
quoted from Henrik Størner
On 8/20/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> 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.
list Henrik Størner · Sun, 20 Aug 2006 22:37:06 +0200 ·
quoted from Michael Magua
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
list Henrik Størner · Sun, 20 Aug 2006 22:52:03 +0200 ·
quoted from Henrik Størner
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
list Michael Magua · Mon, 21 Aug 2006 08:07:38 +0200 ·
quoted from Henrik Størner
On 8/20/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> 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
list Henrik Størner · Mon, 21 Aug 2006 10:08:30 +0200 ·
quoted from Michael Magua
On Mon, Aug 21, 2006 at 08:07:38AM +0200, Michael Magua wrote:
On 8/20/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> 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
list Michael Magua · Mon, 21 Aug 2006 10:15:13 +0200 ·
quoted from Henrik Størner
On 8/21/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
On Mon, Aug 21, 2006 at 08:07:38AM +0200, Michael Magua wrote:
On 8/20/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> 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! :)