BB environment variables
list Jon Boede
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
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 Jon Boede
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] *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
Try using $BBHOME/etc/hobbitserver.cfg . Thanks, Larry Barber
▸
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>]
▸
*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
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
▸
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...
:-(
▸
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
▸
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
▸
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
▸
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