<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I gave that a try, didn't work :( I'm pretty much out of ideas, I'm
hoping when Henrik gets time he can help me troubleshoot this.<br>
<br>
-Charles<br>
<br>
Jones, Jason (Altrincham) wrote:
<blockquote
 cite="mid1A590FCC158A244B80DC7D09134B9AED01793C80@svr-gbn-exc-02.mgc.mentorg.com"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
  </style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  </o:SmartTagType>
  <div class="Section1">
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: windowtext;">Total
guess here but maybe you could
try changing:<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: windowtext;"><o:p> </o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">HOST=%(prod-.*) SERVICE=* EXHOST=$UNUSED_PROD<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">     MAIL $PRIMARY color=red REPEAT=60 RECOVERED NOTICE format=sms<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">     MAIL $SECONDARY color=red DURATION>20 REPEAT=60 RECOVERED NOTICE format=sms<o:p></o:p></span></font></pre>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: windowtext;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: windowtext;">To:<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: windowtext;"><o:p> </o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">HOST=%(prod-.*) EXHOST=%$UNUSED_PROD<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">     MAIL $PRIMARY color=red REPEAT=60 RECOVERED NOTICE format=sms<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">     MAIL $SECONDARY color=red DURATION>20 REPEAT=60 RECOVERED NOTICE format=sms<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;"><o:p> </o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">And obv remove the % from the start of $UNUSED_PROD, just “my 2 cents worth”<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;"><o:p> </o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">Thanks,<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; color: windowtext;">Jason.</span></font><font
 color="black" face="Arial"><span
 style="font-family: Arial; color: windowtext;"><o:p></o:p></span></font></pre>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 color="black" face="Times New Roman" size="3"><span
 style="font-size: 12pt; color: windowtext;" lang="EN-US">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font color="black" face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext; font-weight: bold;"
 lang="EN-US">From:</span></font></b><font color="black" face="Tahoma"
 size="2"><span
 style="font-size: 10pt; font-family: Tahoma; color: windowtext;"
 lang="EN-US"> Charles Jones [<a class="moz-txt-link-freetext" href="mailto:jonescr@cisco.com">mailto:jonescr@cisco.com</a>] <br>
  <b><span style="font-weight: bold;">Sent:</span></b> 15 November 2006
18:03<br>
  <b><span style="font-weight: bold;">To:</span></b> <st1:PersonName
 w:st="on"><a class="moz-txt-link-abbreviated" href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</a></st1:PersonName><br>
  <b><span style="font-weight: bold;">Subject:</span></b> Re: [hobbit]
hobbit-alerts.cfg regex/MACRO problem - need help</span></font><font
 color="black"><span style="color: windowtext;" lang="EN-US"><o:p></o:p></span></font></p>
  </div>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">I'm still having this problem.
If anyone has any ideas
I'm open to suggestions :)<br>
  <br>
-Charles<br>
  <br>
Charles Jones wrote: <o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">I am trying to use a regex
macro to exclude a number
of hosts from an alert.  Here is the one I was using at first:<br>
  <br>
  <o:p></o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">$UNUSED_PROD=%prod-app-(2|3|4|5|6|7|8|9|10|11|12|18|20|21|22|23|24)|prod-web-(1|2|3|4|9|10|11)<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">  <o:p></o:p></span></font></pre>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">Here is how I am using it for
the actual alert
definition:<br>
  <br>
  <o:p></o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">HOST=%(prod-.*) SERVICE=* EXHOST=$UNUSED_PROD<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">     MAIL $PRIMARY color=red REPEAT=60 RECOVERED NOTICE format=sms<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">     MAIL $SECONDARY color=red DURATION>20 REPEAT=60 RECOVERED NOTICE format=sms<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">  <o:p></o:p></span></font></pre>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">I ran into a problem with the
host
"prod-app-12" matching the regex. I realized this was because I was
not terminating the numbers, so I changed my variable to:<br>
  <br>
  <br>
  <o:p></o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">$UNUSED_PROD=%prod-app-(2|3|4|5|6|7|8|9|10|11|12|18|20|21|22|23|24)$|prod-web-(1|2|3|4|9|10|11)$<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">  <o:p></o:p></span></font></pre>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;">This SHOULD work according to
online regex testing
tools, and I also at Henriks advice, verified it using "pcretest":<br>
  <br>
  <o:p></o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">$ pcretest<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">PCRE version 6.6 06-Feb-2006<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">  re> /prod-app-(2|3|4|5|6|7|8|9|10|11|12|18|20|21|22|23|24)$|prod-web-(1|2|3|4|9|10|11)$/<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">data> prod-web-12<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">No match<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">data> prod-web-11<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"> 0: prod-web-11<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"> 1: <unset><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;"> 2: 11<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">data><o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">  <o:p></o:p></span></font></pre>
  <p class="MsoNormal" style="margin-bottom: 12pt;"><font color="black"
 face="Times New Roman" size="3"><span style="font-size: 12pt;">As seen
above, the host
"prod-web-12" does NOT match, but "prod-web-11" DOES, which
is exactly how I want it. <br>
  <br>
  <b><span style="font-weight: bold;">However, when I use this in
hobbit-alerts.cfg. I do not get the expected behavior. Instead, ALL
hosts
match, according to pages sent out and from viewing the "info"
section.  </span></b>The strange thing is, according to hobbitd_alert
--test, the hostname was successfully excluded, but clicking on the
"info" column for hosts that are supposed to be excluded reveals that
they are still configured to alert.<o:p></o:p></span></font></p>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">../bin/hobbitd_alert --test prod-web-11 procs --color-red<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">00009993 2006-11-09 21:48:30 send_alert prod-web-11:procs state Paging<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">00009993 2006-11-09 21:48:30 *** Match with 'HOST=%(prod-.*) SERVICE=*' ***<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">00009993 2006-11-09 21:48:30 Matching host:service:page 'prod-web-11:procs:PROD/PRODWEB' against rule line 170<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">00009993 2006-11-09 21:48:30 *** Match with 'MAIL $PRIMARY color=red REPEAT=60 RECOVERED NOTICE format=sms' ***<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">00009993 2006-11-09 21:48:30 Mail alert with command 'mail <a
 href="mailto:xxxxx@cingularme.com">xxxxx@cingularme.com</a>'<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">00009993 2006-11-09 21:48:30 Failed 'MAIL $SECONDARY color=red DURATION>20 REPEAT=60 RECOVERED NOTICE format=sms' (min. duration 0<1200)<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">...<o:p></o:p></span></font></pre>
  <pre><font color="black" face="Courier New" size="2"><span
 style="font-size: 10pt;">00009993 2006-11-09 21:48:30 Failed 'HOST=* SERVICE=* EXHOST=$UNUSED_PROD' (hostname excluded)<o:p></o:p></span></font></pre>
  <p class="MsoNormal" style="margin-bottom: 12pt;"><font color="black"
 face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
* Another thing, when I do the same test as above, using hostname
"prod-web-12", which is a host that should NOT be excluded,
hobbitd_alert still says that it was excluded (same last line of output
as the
prod-web-11 test above).<br>
  <br>
I have also tried enclosing the regex in quotes, which didn't work
either.<br>
  <br>
If anyone has any insight, please let me know. I have contacted Henrik
about
this, but I believe he misread my email, as he suggested that I add $
to the
regex, which I had already tried...so now I am hoping that he or
someone else
sees this message and can see what Im doing wrong.<br>
  <br>
-Charles<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="black" face="Times New Roman"
 size="3"><span style="font-size: 12pt;"><o:p> </o:p></span></font></p>
  </div>
</blockquote>
<br>
</body>
</html>