Topic
5 replies Latest Post - ‏2011-03-03T22:36:54Z by thomaspdaniel
SystemAdmin
SystemAdmin
255 Posts
ACCEPTED ANSWER

Pinned topic Netcool Impact 4.x eventreader/orgnode handling question

‏2009-08-19T07:29:12Z |
Hello & thanks for looking at this question.

I have a pretty basic question for you, I am looking into a Netcool Impact policy written by someone else and I am trying to understand how this works. My main issue is understanding how the Omnibus events that are returned by an 'eventreader' are handled by the policy, the event reader is setup as a service.

The policy is just a lot of functions that call each other passing the OrgNodes array between them, i.e. CHECK_HUNTGROUP(OrgNodes) - there is not WHILE loop anywhere in the policy to loop around the dataitems returned by the eventreader, I am guessing that internall the policy nlops around each dataitem returned.

This brings me to my last issue which is rather dependant upon the above question really, if within the policy I determine that I NO longer want to continue with the processing of this specific Omnibus alert (or DataItem) and I add an 'Exit()' statement within the policy - does this exit the policy completely or just processing of that specific Omnibus alert/DataItem and the policy will move to the NEXT one returned by the eventreader.

I hope this makes sense to someone, it maybe simple but at the moment I cannot understand the process.

Mark.
Updated on 2011-03-03T22:36:54Z at 2011-03-03T22:36:54Z by thomaspdaniel
  • sunjit
    sunjit
    126 Posts
    ACCEPTED ANSWER

    Re: Netcool Impact 4.x eventreader/orgnode handling question

    ‏2009-08-20T03:01:39Z  in response to SystemAdmin
    When a event enters a policy, it will execute one statement (or function) after the other till it reaches the end of the policy. If you have Exit(), then the event will not execute any further statements after it - Exit() will basically signal the event to exit to the policy right then.
    Think of event in a policy as a flow control within a flowchart, it will execute one block after the other. If the block has a condition, if it execute BlockA if it is true or Block B if it is false. You can have loops to execute certain part(s) of the policy more than once.

    The reader will have 'n' number of events and repeats the same process for each event. It can happen single threaded or multi-threaded, depends on how your EventProcessor is running. EventProcessor is the where you configure the processing of events.

    Hope this helps,
    Sunjit
    • SystemAdmin
      SystemAdmin
      255 Posts
      ACCEPTED ANSWER

      Re: Netcool Impact 4.x eventreader/orgnode handling question

      ‏2009-08-20T09:03:21Z  in response to sunjit
      Thanks for the reply, the information has cleared up some parts of my understanding - to clarify then:-

      The event reader may find 'n' events in the objectserver which match the reader SQl, it passes these alerts to the policy ONE at a time (maybe multi-threaded) and the policy will processes the alert until a point in the policy where where nothing else happens, if one of the functions determines certain criteria are met I can add an EXIT statement, this will cause the policy to STOP processing this particular event and START processing the next that the event reader has found.

      As the policy works in the above way do I need to pass the "OrgNodes" into the function, i.e. CALL_THIS_FUNCTION (OrgNodes) - the policy will only be working on the current data item, it is not like the policy has been passed an ARRAY of data items.

      thanks, Mark.
      • SystemAdmin
        SystemAdmin
        255 Posts
        ACCEPTED ANSWER

        Re: Netcool Impact 4.x eventreader/orgnode handling question

        ‏2009-09-07T19:44:02Z  in response to SystemAdmin
        I have a further extension to my original question.

        If the Exit() statement terminates processing of the policy then can anyone explain why I get the following results from my testing.

        --------------START OF POLICY----------------
        function MARK() {
        if(@ExtraIntA==99) {
        @ExtraCharA = "TEST_A";
        ReturnEvent(EventContainer);
        Exit();
        } else {
        @ExtraCharA = "TEST_B";
        }

        MARK();

        @ExtraCharA = "TEST_C";
        ReturnEvent(EventContainer);
        ----------------END OF POLICY------------------

        When I send in an event with an @ExtraIntA value = 99 and it is picked up by the eventreader and this policy is the only policy attached to that reader then how come the @ExtraCharA field is set to "TEST_C"

        thanks for your help.
        • sfsfsf
          sfsfsf
          1 Post
          ACCEPTED ANSWER

          Re: Netcool Impact 4.x eventreader/orgnode handling question

          ‏2011-03-02T01:30:12Z  in response to SystemAdmin
          At a guess it would be because your event is being processed by your function MARK(), then hitting your '@ExtraCharA = "TEST_C";' section of code.

          Take out the TEST_C section then see if it works as you expect.
        • thomaspdaniel
          thomaspdaniel
          64 Posts
          ACCEPTED ANSWER

          Re: Netcool Impact 4.x eventreader/orgnode handling question

          ‏2011-03-03T22:36:54Z  in response to SystemAdmin
          using exit() within a function will exit the function and not the policy.

          using 5.1.1.1

          function exitTest() {
          log("in function");
          exit();
          log("still in function");
          }

          log("pre function");
          exitTest();
          log("post function");
          output
          03 Mar 2011 23:32:47,927: tpd_testingpool-3-thread-237Parser log: pre function
          03 Mar 2011 23:32:47,927: tpd_testingpool-3-thread-237Parser log: in function
          03 Mar 2011 23:32:47,927: tpd_testingpool-3-thread-237Parser log: post function