External scripts not working the same?
Greetings,
We are looking at migrating from BB to Hobbit. One major stumbling block right now is that we have over 400 devices on the network right now that we monitor via SNMP. Firewalls, Routers, proxies, etc.
Our basic script in BB was under the ext folder on the server and was run every 5 minutes when bbtest-net ran. An instance of this script was called for each device we needed checked. It pulled the IP address of the device from the environment variables and called the bb executable with it's result when the test was completed. This doesn't seem to be possible in hobbit. Every reference I've seen in the archives has told people to use hobbitlaunch.
Unless I'm misunderstanding things (which is possible...), I can tell hobbitlaunch to fire off my external script every 5 minutes, but the script will only run that one time, meaning I'd have to modify my script to run a loop through all of the devices that I want the test run for. This is not really the way we want to go, because then it ignores the hosts that are planned down for maintenance and such.
What I'd like to do is add a service tag in the bbhost file called router_test. Then, when the network tests are run, hobbit should be smart enough to know that there is an external script defined in hobbitlaunch.cfg that matches that tag and run it for that machine. Is this possible?
Little help for a newbie to Hobbit?
Stewart
On Tue, Oct 25, 2005 at 12:50:57PM -0400, Stewart_Larsen at doh.state.fl.us wrote:
Our basic script in BB was under the ext folder on the server and was run every 5 minutes when bbtest-net ran. An instance of this script was called for each device we needed checked. It pulled the IP address of the device from the environment variables and called the bb executable with it's result when the test was completed.
I'm a bit puzzled by this description, because it doesn't match any of the ways I know of that BB uses to run extension scripts. BB will
- if you add a script to the bb-bbexttab config - run the script once per cycle, not once for each host. bbtest-net (from bbgen, I presume) doesn't change that; in fact, there's nothing in bbtest-net that would ever trigger an extension-script.
So I would guess that some custom modification has been done to your BB setup - or to bbtest-net - which takes care of this particular way of invoking the SNMP polling script once per host.
This doesn't seem to be possible in hobbit. Every reference I've seen in the archives has told people to use hobbitlaunch.
Right. hobbitlaunch really is just a utility to launch programs at regular intervals, with some specific environment setup, redirection of logfiles and such.
Unless I'm misunderstanding things (which is possible...), I can tell hobbitlaunch to fire off my external script every 5 minutes, but the script will only run that one time, meaning I'd have to modify my script to run a loop through all of the devices that I want the test run for. This is not really the way we want to go, because then it ignores the hosts that are planned down for maintenance and such.
What I'd like to do is add a service tag in the bbhost file called router_test. Then, when the network tests are run, hobbit should be smart enough to know that there is an external script defined in hobbitlaunch.cfg that matches that tag and run it for that machine. Is this possible?
As others have said, it is pretty simple to cook up a script that grabs the hosts that have a specific tag in the bb-hosts file, and run you SNMP polling script against those hosts. There's a "boiler- plate" script listed in the Hobbit "Tips & Tricks" web-document that you can easily adapt to suit your needs.
The tricky part is your idea about tying this in with the other network tests, to avoid polling the hosts that are down or disabled. I can understand why (I know how long snmpget takes to timeout a request) ... it's just an idea that I haven't heard before.
I think it's a great idea - it would certainly be useful for exactly this kind of test where you want to avoid testing unreachable systems. Adding this kind of filter to bbhostgrep should not be terribly difficult - stay tuned.
Regards, Henrik
On Tue, Oct 25, 2005 at 10:55:35PM +0200, Henrik Stoerner wrote:
The tricky part is your idea about tying this in with the other network tests, to avoid polling the hosts that are down or disabled. I can understand why (I know how long snmpget takes to timeout a request) ... it's just an idea that I haven't heard before.
I think it's a great idea - it would certainly be useful for exactly this kind of test where you want to avoid testing unreachable systems. Adding this kind of filter to bbhostgrep should not be terribly difficult - stay tuned.
A first attempt at implementing this is included in the latest snapshot, available at http://www.hswn.dk/beta/ - or, to just pick up the new utility, grab http://www.hswn.dk/beta/snapshot/common/bbhostgrep.c
Just drop this file into the hobbit-4.1.2/common/ directory and run "make".
This adds a new "--no-down" option to bbhostgrep. This causes it to query the Hobbit server for information about the hosts that have a non-green "conn" column (ping test); these hosts are ignored and will not show up in the output from bbhostgrep.
You can also use "--no-down=SOMETEST". bbhostgrep will then also query the Hobbit server for the current state of the SOMETEST column for all hosts; if this column for a host has status blue (disabled), then that host will also be ignored. Note that this is in addition to the "conn" check.
Regards, Henrik
Could we avoid the test on the conn tag when specifying the --no-down=TAG because I have systems that I am not allowed to ping but stil have to do other tests towards. Could the conn be the default and then if I specify another tag this is the only tag tested for ?
/Thomas
Henrik Stoerner wrote:
On Tue, Oct 25, 2005 at 10:55:35PM +0200, Henrik Stoerner wrote:
The tricky part is your idea about tying this in with the other network tests, to avoid polling the hosts that are down or disabled. I can understand why (I know how long snmpget takes to timeout a request) ... it's just an idea that I haven't heard before.
I think it's a great idea - it would certainly be useful for exactly this kind of test where you want to avoid testing unreachable systems. Adding this kind of filter to bbhostgrep should not be terribly difficult - stay tuned.
A first attempt at implementing this is included in the latest snapshot, available at http://www.hswn.dk/beta/ - or, to just pick up the new utility, grab http://www.hswn.dk/beta/snapshot/common/bbhostgrep.c
Just drop this file into the hobbit-4.1.2/common/ directory and run "make".
This adds a new "--no-down" option to bbhostgrep. This causes it to query the Hobbit server for information about the hosts that have a non-green "conn" column (ping test); these hosts are ignored and will not show up in the output from bbhostgrep.
You can also use "--no-down=SOMETEST". bbhostgrep will then also query the Hobbit server for the current state of the SOMETEST column for all hosts; if this column for a host has status blue (disabled), then that host will also be ignored. Note that this is in addition to the "conn" check.
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
On Wed, Oct 26, 2005 at 09:24:20AM +0200, Thomas wrote:
Could we avoid the test on the conn tag when specifying the --no-down=TAG because I have systems that I am not allowed to ping but stil have to do other tests towards. Could the conn be the default and then if I specify another tag this is the only tag tested for ?
If there's no "conn" status for a host, then bbhostgrep won't do the check of the conn-test for that host.
The one thing that might trip things up is if you use "noping", and there's a "clear" conn-status. A "clear" status can show up for number of reasons - a host that is up, but has a "noping" tag to disable ping, or a host that is down, but has a "dialup" tag.
Perhaps I should change it to only ignore a host if there is a conn test that is either red or blue - i.e. we know for sure that this host is either down (red), or disabled (blue).
Henrik
participants (3)
-
henrik@hswn.dk
-
Stewart_Larsen@doh.state.fl.us
-
tlp-hobbit@holme-pedersen.dk