Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

here's the main chunk of code from the existing script, which is doing the job just fine

while (my($gid,$gname) = each %groups) { if ($debug >= 3) { writeLog("I","Check notification group $gna +me");} ##Create an ARRAY with each filter for each group my @gArray = getFilterGroups($gid); foreach my $fGroup (@gArray) { my %fHash = getFilters($fGroup); my $fullMatch = getEntries($fGroup); if ($debug >=3) { writeLog("I","The filter group ($fGroup) + has $fullMatch entries");} my $count = 0; while (my($slot,$value) = each %fHash) { if ($debug >=3) { writeLog("I","Checking event against + FILTER:$slot=>$value");} my $result = checkEvent($slot,$value); if ($result == 1) { if ($debug >=3) {writeLog("I","Tivoli slot and fil +ter slot information match");} $count++; if ($debug >=4) {writeLog("I","Count is at $count +--> fullMatch is $fullMatch")}; if ($count == $fullMatch) { my @memberList = getMembers($gid); foreach my $member(@memberList) { if ($debug >=2) {writeLog("I","Generating +automated notification to $member");} #notifyLog($member); notify($member); } if ($debug >= 1) { writeLog("I","inserting int +o db log");} dblog($gid); $count = 0; } } } } }

It simply loops through all the groups present in the DB and grabs the filters. It considers a match to be when all the slot/value combination's in the filter DB match with those received from the event.

Events are received from a BMC product called Impact. It has a built-in rules engine and when certain criteria are satisfied we call the PERL script.

Details of the events are passed to the script as environment variables, here's a code snippet,

my $thost = $ENV{mc_host}; my $source = $ENV{source}; my $server_hndl = $ENV{server_handle};

In reply to Re^2: Building a notification system based on MySQL by shank098
in thread Building a notification system based on MySQL by shank098

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others chanting in the Monastery: (3)
    As of 2025-06-17 03:57 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?
      erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.