Hi Henrik,
Henrik Stoerner wrote:
On Thu, Oct 05, 2006 at 04:36:28PM +0200, Eric van de Meerakker wrote:
I'm currently upgrading to Hobbit 4.2.0 (our old systems still run 4.0.4) and I have an issue with a DeadCat BB extension called "show_blue.sh". It turns out that disabling something "until OK" doesn't write a log in $BBDISABLED, while disabling something with a specific duration will. Re-enabling such a test by hand will also result in a "Could not remove disable-file" log entry in the enadis.log file.
You could call it a bug, but on the other hand the BB compatibility files have no way of registering the "until-ok" setting.
OK. It turns out that show_blue only needs the presence of files in $BBDISABLED to determine which host/test combinations are disabled and doesn't use the contents at all. It used
cd $BBDISABLED
ls > $BLUEFILE
to get a list of hostnames and tests that are disabled, which are then processed further.
I've replaced the 'ls' command above with this one-liner:
$BB $BBDISP "hobbitdboard color=blue" | cut -d'|' -f1-2 | \
sed -e 's/\./,/g' -e 's/|/./g' > $BLUEFILE
This allowed me to leave the rest of the script alone. (I'm not too worried about performance because we don't monitor very many hosts.)
show_blue is intended to show all disabled tests in the "All non-green view" and uses the files in $BBDISABLED to determine which tests are disabled, the behaviour above makes it impossible for show_blue to determine all disabled tests.
What can I do to get show_blue working correctly with "disable until OK"?
How about replacing it ? I don't know what the output from the show_blue tool looks like, but if you just want an overview of the disabled statuses then this CGI script will do it:
[script deleted for brevity...]
That does indeed show the information I want, and I could have included that table in the non-green page, but I prefer the compact layout show_blue gives me: if there are disabled tests it puts up a separate hosts/tests grid on the non-green view page, showing all and only the disabled tests.
We use disable/enable a lot, e.g. for issues we cannot handle ourselves or which take longer to fix, and I like the constant reminder show_blue gives us, right on the non-green view page, which tests are disabled. This makes sure we don't 'forget' about disabled tests...
Thanks Henrik, your reply did point me in the right direction to solve this!
Regards,
Eric.