Philip Clark wrote:
On Fri, 2006-09-01 at 20:44, Chris Morrison wrote:
I've noticed that with my external script, BB will display a problem as
'red', but won't actually email anyone, even though it has been setup to
in bbwarnrules.cfg .
For example...
If I do...
$BBHOME/bin/bb localhost "status test.test red `date` Not good"
And I wait a couple of minutes, I don't receive an alert.
But if I do...
$BBHOME/bin/bb localhost "status test.test red `date` Not good"
$BBHOME/bin/bb localhost "page test.test red `date` This is a test"
I'll receive the alert. It's as if BB isn't automatically recognizing
the fact that things marked with a red status should be notified.
Is this normal, or is there something I can set so that I won't have to
send the "page test.test red `date` This is a test" every time
something's wrong?
I've noticed that devmon just sends the 'status', which is probably why
I'm not getting any alerts for things marked red coming from devmon.
It's normally the case when using the "bb" binary that only the
"status" message is specified. The binary should then make the
determination (based on colour) about whether to also send a
"page" message too. It should only be necessary to duplicate that
process if an external is by-passing the binary and communicating
directly to the BB servers through sockets.
If the script sources the BB environment, the variables BB and
BBDISP are defined to give the command line a standard form:
$BB $BBDISP "status test.test red `date` Not good"
The first is the path to the binary (as you have used), but the
second should be the IP of the display server and not a hostname.
Also, I think that there is some cross-checking done with the
bb-hosts file so I would avoid using even the loop-back IP in
place of that.
The two files that the "bb" binary uses when sending a "page"
message are the local copy of bb-hosts and bbwarnsetup.cfg
(for pagelevels). It can often be the case that these files
become out of sync with the ones on the server. In that
case, I would also expect your manual "page" message to
fail. It's probably still the next logical thing to check.
Also, if you are still having problems with maint.pl, have
you tested the "disable" function manually on the command
line? This would help to show if this is a BB problem or
a script one.
Cheers, Phil.
Phil,
The script that I made, as well as devmon, use sockets to communicate
to the BB server. I'm testing the binary method to see if it has the
same affect (which it appears to be).
Even if I replace 'localhost' above with the FQDN of my BB server
(which acts as a BBDISPLAY/BBPAGER), it still has the same result.
So if I do.. $BBHOME/bin/bb monitor.domain.net "status
test.domain.net.test red `date` Oh No" , I'll look at BB via my web
browser, and see that it has in fact received the red alert.
Unfortunately, still does not send a page.
When I finally do $BBHOME/bin/bb monitor.domain.net "page
test,domain,net.test red `date` Oh No" , I receive the alert via email.
So BB is able to send me the alert, it's just for some reason ignoring
the fact that what I sent previously should have sent me an alert
automatically because of the red status.
The exact same thing happens when I send it via sockets.
In bbwarnsetup.cfg...
bbwarn: TRUE
pagelevels: red purple
pagelevelsmail: yellow purple
ignforall:
pagerecovered: TRUE
pagetype: EVENT
The really funny thing is, this is only happening with my external
scripts. For all the tests performed directly by the BB server, and
all the BB clients reporting into the BB server, everything works fine.
What's even funnier is that if I go ahead and $BBHOME/bin/bb
monitor.domain.net "status test.domain.net.test green `date` Looking
Good" , it will alert me that it has recovered, without needing another
command to do the page!
About the maint.pl , if I do $BBHOME/bin/bb monitor.domain.net "disable
test.domain.net* 20 Testing" , nothing is created in my bbvar/disabled
directory.
Pulling my hair out here! :-)
|