Henrik Stoerner wrote:
I'd say HOST=%^va[\d]*$
You need the "%" first, to tell Hobbit that what comes next is a regexp. Then the "^" means that the expression must match at the beginning of the string. "\w" is whitespace ? Think so - in that case it is not needed, since Hobbit will never match with any whitepace in the hostname.
Based on the tutorial, \w is a word character (usually letters, underscores). Good tip about beginning of string.
What comes after the MAIL keyword is passed directly to your "mail" utility. So it would probably be better to have
$pg-tom=tomsemail at somewhere.com,tomscell at wireless.com
if your "mail" tool supports listing multiple recipients separated by commas. Some dont - then you can use a short-hand notation like:
$pg-tom=tomsemail at somewhere.com tomscell at wireless.com
and separate them by spaces - Hobbit will handle this as if you had multiple "MAIL ..." lines with each of the mail recipients. So it sends out the mail in separate e-mails, instead of one e-mail to all of the recipients. (Same net effect).
Then is the syntax for using macros in the MAIL line the same as HOST:
$pg-tom=tomsemail at somewhere.com tomscell at wireless.com
HOST %^va.*$ MAIL=%$pg-tom
When I run this through 'bbcmd hobbitd-alert --test' I get two lines that look like this:
00008432 2005-10-13 14:30:06 Failed 'MAIL %$pg-tom DURATION>5 COLOR=red' (min. duration 0<300)
I would have expected the actual email addresses...
One more thing: I'm sure "DURATION=5m" is not what you want. Make that "DURATION>5m".
Correct, I typed it into the message incorrectly.
Thanks.
Rich Smrcina VM Assist, Inc. Main: (262)392-2026 Cell: (414)491-6001 Ans Service: (360)715-2467 rich.smrcina at vmassist.com
Catch the WAVV! http://www.wavv.org WAVV 2006 - Chattanooga, TN - April 7-11, 2006