Xymon Mailing List Archive search

BB environment variables

8 messages in this thread

list Jon Boede · Mon, 06 Oct 2008 10:56:38 -0500 ·
What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?

For example, if I have a script that receives an email and reports a status because of it?  I know that I could hard-code everything, but that's tacky.  :-)

Thanks,
Jon
list Jim Smith · Mon, 6 Oct 2008 10:01:16 -0600 ·
Execute this line at the beginning of your script:

 
.   $BBHOME/etc/bbdef.sh

 
Make sure you have the period<space> at the beginning.

 
Jim Smith

SVHS
quoted from Jon Boede

 
From: Jon Boede [mailto:user-68c969ba1bfa@xymon.invalid] 
Sent: Monday, October 06, 2008 10:57 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] BB environment variables

 
What's a good way to get all the BB environment variables set up when I
want to use them in a script that's not launched from hobbitd?

For example, if I have a script that receives an email and reports a
status because of it?  I know that I could hard-code everything, but
that's tacky.  :-)

Thanks,
Jon
list Jon Boede · Mon, 06 Oct 2008 11:18:10 -0500 ·
I don't have a bbdef.sh anywhere under my hobbit ~/server directory... :-(
quoted from Jim Smith

Smith, Jim wrote:
*Execute this line at the beginning of your script:*

* *

*.   $BBHOME/etc/bbdef.sh*

* *

*Make sure you have the period<space> at the beginning.*

* *

*Jim Smith*

*SVHS*

* *

* *


*From:* Jon Boede [mailto:user-68c969ba1bfa@xymon.invalid]
*Sent:* Monday, October 06, 2008 10:57 AM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* [hobbit] BB environment variables

 
What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?

For example, if I have a script that receives an email and reports a status because of it?  I know that I could hard-code everything, but that's tacky.  :-)

Thanks,
Jon
list Larry Barber · Mon, 6 Oct 2008 11:24:43 -0500 ·
Try using $BBHOME/etc/hobbitserver.cfg .

Thanks,
Larry Barber
quoted from Jon Boede

On Mon, Oct 6, 2008 at 11:18 AM, Jon Boede <user-68c969ba1bfa@xymon.invalid> wrote:
 I don't have a bbdef.sh anywhere under my hobbit ~/server directory... :-(


Smith, Jim wrote:

 *Execute this line at the beginning of your script:*

* *

*.   $BBHOME/etc/bbdef.sh*

* *

*Make sure you have the period<space> at the beginning.*

* *

*Jim Smith*

*SVHS*

* *

* *

*From:* Jon Boede [mailto:user-68c969ba1bfa@xymon.invalid <user-68c969ba1bfa@xymon.invalid>]
quoted from Jon Boede
*Sent:* Monday, October 06, 2008 10:57 AM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* [hobbit] BB environment variables


What's a good way to get all the BB environment variables set up when I
want to use them in a script that's not launched from hobbitd?

For example, if I have a script that receives an email and reports a status
because of it?  I know that I could hard-code everything, but that's tacky.

:-)

Thanks,
Jon

list Jim Smith · Mon, 6 Oct 2008 10:29:23 -0600 ·
Sorry...I was thinking about Big Brother clients.

 
For Hobbit, you should call your script from "server/etc/
hobbitlaunch.cfg".

 
I have one like this:

 
[lvm]

        ENVFILE /home/hobbit/server/etc/hobbitserver.cfg

        NEEDS hobbitd

        CMD $BBHOME/ext/bb-lvm.sh

        LOGFILE $BBSERVERLOGS/bb-lvm.log

        INTERVAL 15m

 
Jim Smith
quoted from Jon Boede

 
From: Jon Boede [mailto:user-68c969ba1bfa@xymon.invalid] 
Sent: Monday, October 06, 2008 11:18 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] BB environment variables

 
I don't have a bbdef.sh anywhere under my hobbit ~/server directory...

:-(
quoted from Larry Barber

Smith, Jim wrote: 

Execute this line at the beginning of your script:

 
.   $BBHOME/etc/bbdef.sh

 
Make sure you have the period<space> at the beginning.

 
Jim Smith

SVHS

 
From: Jon Boede [mailto:user-68c969ba1bfa@xymon.invalid] 
Sent: Monday, October 06, 2008 10:57 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] BB environment variables

 
What's a good way to get all the BB environment variables set up when I
want to use them in a script that's not launched from hobbitd?

For example, if I have a script that receives an email and reports a
status because of it?  I know that I could hard-code everything, but
that's tacky.  :-)

Thanks,
Jon
list Rich Smrcina · Mon, 06 Oct 2008 11:34:40 -0500 ·
quoted from Jon Boede
Jon Boede wrote:
I don't have a bbdef.sh anywhere under my hobbit ~/server directory... :-(

Smith, Jim wrote:
*Execute this line at the beginning of your script:*

* *

*.   $BBHOME/etc/bbdef.sh*

* *

*Make sure you have the period<space> at the beginning.*

* *

*Jim Smith*

*SVHS*
Try hobbitserver.cfg

-- 

Rich Smrcina
VM Assist, Inc.
Phone: XXX-XXX-XXXX
Ans Service:  XXX-XXX-XXXX
user-61add9955ef9@xymon.invalid
http://www.linkedin.com/in/richsmrcina

Catch the WAVV!  http://www.wavv.org
WAVV 2009 - Orlando, FL - May 15-19, 2009
list Stef Coene · Mon, 6 Oct 2008 19:20:15 +0200 ·
quoted from Jon Boede
On Monday 06 October 2008, Jon Boede wrote:
What's a good way to get all the BB environment variables set up when I
want to use them in a script that's not launched from hobbitd?

For example, if I have a script that receives an email and reports a
status because of it?  I know that I could hard-code everything, but
that's tacky.  :-)

server/bin/bbcmd <your script>
And if that gives an error that it can not open a config file, first do
export BBHOME=<server dir>

This also works for the hobbit client.


Stef
list Henrik Størner · Tue, 7 Oct 2008 05:34:31 +0000 (UTC) ·
quoted from Jon Boede
In <user-43bb833ec55d@xymon.invalid> user-68c969ba1bfa@xymon.invalid (Jon Boede) writes:
What's a good way to get all the BB environment variables set up when I 
want to use them in a script that's not launched from hobbitd?
Put "bbcmd" in front of your command. I.e. run

   bbcmd /home/jon/myscript.sh

Forget everything about using "bbdef.sh" (that's for Big Brother), or
source'ing hobbitserver.cfg directly - bbcmd is *the* way to have the
Hobbit environment available.


Henrik