A related question: if hobbit-alerts.cfg is modified, does hobbit automatically pick up the new version, or is a restart required?
Restart's are evil - they disrupt things. Configuration changes will be picked up automatically - at least when the next alert happens.
Excellent. Of course now I've found a problem...
My test hobit-alerts.cfg:
$HG-TEST=host01|host02
HOST=$HG-TEST SCRIPT /opt/bb/server/ext/email bruce_mail MAIL blysik at shutterfly.com
And then I run the dump config:
-bash-2.05b$ ./bin/bbcmd --env=etc/hobbitserver.cfg hobbitd_alert --dump-config HOST= SCRIPT /opt/bb/server/ext/email bruce_mail FORMAT=SCRIPT REPEAT=30 MAIL blysik at shutterfly.com REPEAT=30
Shouldn't there be some hosts showing up after HOST= ?
-- Bruce Z. Lysik <blysik at shutterfly.com> Operations Engineer
"Bruce Lysik" wrote on 28/01/2005 11:06:55:
A related question: if hobbit-alerts.cfg is modified, does hobbit automatically pick up the new version, or is a restart required?
Restart's are evil - they disrupt things. Configuration changes will be picked up automatically - at least when the next alert happens.
Excellent. Of course now I've found a problem...
My test hobit-alerts.cfg:
$HG-TEST=host01|host02
HOST=$HG-TEST
Looking back at Henrik's earlier email, I think this should be...
HOST=%$HG-TEST
SCRIPT /opt/bb/server/ext/email bruce_mail MAIL blysik at shutterfly.com
And then I run the dump config:
-bash-2.05b$ ./bin/bbcmd --env=etc/hobbitserver.cfg hobbitd_alert -- dump-config HOST= SCRIPT /opt/bb/server/ext/email bruce_mail FORMAT=SCRIPT REPEAT=30 MAIL blysik at shutterfly.com REPEAT=30
Shouldn't there be some hosts showing up after HOST= ?
-- Bruce Z. Lysik <blysik at shutterfly.com> Operations Engineer
HTH, Andy.
#####################################################################################
This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI').
While every effort has been made to verify the information contained herein, ZESPRI does not make any representations as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. #####################################################################################
Andy France wrote on 28/01/2005 11:12:09:
"Bruce Lysik" wrote on 28/01/2005 11:06:55:
A related question: if hobbit-alerts.cfg is modified, does hobbit automatically pick up the new version, or is a restart required?
Restart's are evil - they disrupt things. Configuration changes will be picked up automatically - at least when the next alert happens.
Excellent. Of course now I've found a problem...
My test hobit-alerts.cfg:
$HG-TEST=host01|host02
Whoops! Drop the $ from the start of this line too!
HOST=$HG-TEST
Looking back at Henrik's earlier email, I think this should be...
HOST=%$HG-TEST
SCRIPT /opt/bb/server/ext/email bruce_mail MAIL blysik at shutterfly.com
And then I run the dump config:
-bash-2.05b$ ./bin/bbcmd --env=etc/hobbitserver.cfg hobbitd_alert -- dump-config HOST= SCRIPT /opt/bb/server/ext/email bruce_mail FORMAT=SCRIPT REPEAT=30 MAIL blysik at shutterfly.com REPEAT=30
Shouldn't there be some hosts showing up after HOST= ?
-- Bruce Z. Lysik Operations Engineer
HTH, Andy.
#####################################################################################
This email is intended for the person to whom it is addressed only. If you are not the intended recipient, do not read, copy or use the contents in any way. The opinions expressed may not necessarily reflect those of ZESPRI Group of Companies ('ZESPRI').
While every effort has been made to verify the information contained herein, ZESPRI does not make any representations as to the accuracy of the information or to the performance of any data, information or the products mentioned herein. ZESPRI will not accept liability for any losses, damage or consequence, however, resulting directly or indirectly from the use of this e-mail/attachments. #####################################################################################
In <12C0877BF55C7748BDDB82BDBD3E66F1378A73 at franklin.corp.shutterfly.com> "Bruce Lysik" <blysik at shutterfly.com> writes:
$HG-TEST=host01|host02
HOST=$HG-TEST SCRIPT /opt/bb/server/ext/email bruce_mail MAIL blysik at shutterfly.com
And then I run the dump config:
-bash-2.05b$ ./bin/bbcmd --env=etc/hobbitserver.cfg hobbitd_alert --dump-config HOST= SCRIPT /opt/bb/server/ext/email bruce_mail FORMAT=SCRIPT REPEAT=30 MAIL blysik at shutterfly.com REPEAT=30
Shouldn't there be some hosts showing up after HOST= ?
Hmm - yes, there should. This should fix it: diff -u -r1.28 hobbitd/do_alert.c --- hobbitd/do_alert.c 2005/01/20 10:45:44 1.28 +++ hobbitd/do_alert.c 2005/01/27 22:20:46 @@ -355,7 +355,7 @@ delim = strchr(l, '='); *delim = '\0'; - newtok->name = strdup(l); + newtok->name = strdup(l+1); /* Skip the '$' */ newtok->value = strdup(delim+1); newtok->next = tokhead; tokhead = newtok; But your $HG-TEST definition is also wrong. If it's a regular expression, it should be "$HG-TEST=(host01|host02)" - if it's just a simple list, it should be "$HG-TEST=host01,host02 Henrik
Henrik Storner wrote: Hmm - yes, there should. This should fix it: diff -u -r1.28 hobbitd/do_alert.c --- hobbitd/do_alert.c 2005/01/20 10:45:44 1.28 +++ hobbitd/do_alert.c 2005/01/27 22:20:46 @@ -355,7 +355,7 @@ delim = strchr(l, '='); *delim = '\0'; - newtok->name = strdup(l); + newtok->name = strdup(l+1); /* Skip the '$' */ newtok->value = strdup(delim+1); newtok->next = tokhead; tokhead = newtok;
I'm tired ... "$HG-TEST=%(host01|host02)" since a "%" is needed to flag it as a pc-regex.
OK, I'm trying to get my alerts file setup using the macros and I'd like to try and summarize all the findings from list postings into a single procedure. Let me know if this is correct, or at least help steer me in the right direction. So far: 1. I've used the non-tested, experimental shell script to convert my bbwarnsetup.cfg host groups into hobbit macros. An example of one host group converted is as follows: $HG1=pinky.nandomedia.com|sys(.*)p.nandomedia.com 2. I applied the patch above to do_alert.c Now I want to put that macro I got from the shell script into action. It should look something like this, right? $HG1=%(pinky.nandomedia.com|sys(.*)p.nandomedia.com) or better $HG1=%(pinky|sys(.*)p).nandomedia.com But that "(.*)" looks funny to me. All it should represent in that case is a number like 507, 405, etc., or something that perl could handle with a /\d{3}/. The end result needs to be a hostname like "sys452p.nandomedia.com". What would be the correct syntax, or is that indeed the correct syntax? Tom
In <41FE845B.9090700 at nandomedia.com> Tom Georgoulias <tgeorgoulias at nandomedia.com> writes:
[snip patch and example]
Now I want to put that macro I got from the shell script into action. It should look something like this, right?
$HG1=%(pinky.nandomedia.com|sys(.*)p.nandomedia.com)
or better
$HG1=%(pinky|sys(.*)p).nandomedia.com
But that "(.*)" looks funny to me. All it should represent in that case is a number like 507, 405, etc., or something that perl could handle with a /\d{3}/. The end result needs to be a hostname like "sys452p.nandomedia.com". What would be the correct syntax, or is that indeed the correct syntax?
Feel free to educate me on the finer details of Perl and the way it does regular expressions - I'm not in any way an expert on that subject. (I never could get my head twisted enough to figure out what all the different parenthesis and special chars do in Perl - so there's another reason why I've tried to make LARRD obsolete).
Yes, I think you can do without those parentheses. I actually have a small test tool to try and match names against expressions, and if I try your expression it works whether I have "(.*)" or just ".*". So
$HG1=%(pinky|sys.*p).nandomedia.com
should be fine.
Henrik
Henrik Storner wrote:
Feel free to educate me on the finer details of Perl and the way it does regular expressions - I'm not in any way an expert on that subject. (I never could get my head twisted enough to figure out what all the different parenthesis and special chars do in Perl - so there's another reason why I've tried to make LARRD obsolete).
Trust me, you don't want me teaching anyone perl. I struggle enough on my own. That regex I had in my last email was just to match 3 digits in a row (like a [0-9]). I guess what was confusing to me is the use of ".*" instead of just "*". I think this is an artifact of BB b/c I can remember having some problems many moons ago when I was trying to getting wildcarding to work properly, but correct me if I'm wrong.
Yes, I think you can do without those parentheses. I actually have a small test tool to try and match names against expressions, and if I try your expression it works whether I have "(.*)" or just ".*". So
$HG1=%(pinky|sys.*p).nandomedia.com
should be fine.
You're right, it does. I could swear I tried using something like this before, but even though it was showing up when I ran bbcmd --env=/home/hobbit/server/etc/hobbitserver.cfg hobbitd_alert --dump-config it didn't actually page me. The only time it really started working was after I shut hobbit down completely, then brought it back up. I'm not ruling out a mistake on my part, though. I've been making plenty of them the last week or so.
Release candidate still coming out sometime soon? I'm looking forward to it.
Tom
participants (4)
-
Andy@zespri.com
-
blysik@shutterfly.com
-
henrik@hswn.dk
-
tgeorgoulias@nandomedia.com