Page tree
Skip to end of metadata
Go to start of metadata


Note: This guide is intended to be for opHA 3, opEvents 3 and NMIS 9. The tool is available for previous versions, but the syntax and some parameters can change. 

In order to integrate the poller events into the primary server on an opHA environment, we can make use of the create_remote_event tool and create some event actions rules to send the poller events the the primary server: 

  1. Edit the Event Actions (Got to System, Edit Event Actions) and create a new script (Please, replace with your configurations):
    1. PRIMARY-URL (this is the Primary server the event will be sent to)

    2. USERNAME (A user account on the Primary with Admin rights)
    3. PASSWORD (the password for the USERNAME account)
    4. Authority (this is the button label that will appear on the Primary)

    5. POLLER-URL (this is the Poller-server sending the event, used to link back to the originating event from the Primary)

      "opevents_primary" : {
                  "exec" : [ "/usr/local/omk/bin/", "-s", "", "-u", "USERNAME", "-p", "PASSWORD", "authority='POLLER HUMAN NAME'" ],
                  "arguments" : [ "location=", "", "event=event.event", "details=event.details", "time=event.time", "", "element=event.element", "interface_description=event.interface_description", "type=event.type", "priority=event.priority", "level=event.level", "nodeType=node.nodeType", "state=event.state", "stateful=event.stateful" ],
                  "output" : "save",
                  "stderr" : "save",
                  "exitcode" : "save"

      Please note, you can edit the event information that you want to send. 

  2. Add a new policy in the Event Actions file: 
           "100" : {
                "IF" : "event.priority >= 1",
                "THEN" : "script.opevents_primary()",
                "BREAK" : "true"

    Please note, you can edit the condition and send just the events that you want. 

  3. Test the remote event: 

/usr/local/omk/bin/ -s -u nmis -p password authority='poller nine Poller' location= host= event="Node Configuration Change" details="Changed at 140 days 1:00:55" node="bnelab-rr1" time=1610703283 date= element= interface_description= type=nmis_eventlog priority=3 level=Warning nodeType= state= stateful=

The raw exit code should be 0: 

[Mon Jan 18 07:31:50 2021] [info] worker.action[6595] 6005396300eff20fc35d55eb method='opevents_primary' got raw exitcode=0 from pid=6602 exec=['/usr/local/omk/bin/','-s','','-u','nmis','-p','password','authority=\'poller nine Poller\'','location=','node=rbogon344','event=Node Configuration Change','details=Changed at 142 days 23:00:55','time=1610955103','date=','element=','interface_description=','type=nmis_eventlog','priority=3','level=Warning','nodeType=','state=','stateful=']


Sending UP events to the Primary

When an event is acknowledged, opEvents stops the propagation. That means, that all the rules are not going to run anymore. There are different approaches to achieve this, but is a common schema to set up opevents_auto_acknowledge_up to false in the poller, so the event is not acknowledge and can be sent to the primary.

More information: 

Reorder protection

Forwarded events may arrive out of order to the primary server, because of network congestion or slow action processing. 

To enable reorder protection, two steps need to be taken:

  • Set the configuration property state_reorder_window to a positive number (e.g. 30) on the receiving server.
  • Always send the authority property, to denote the event as originating from a remote authoritative source.

More information: Deduplication and storm control in opEvents#StatefulDeduplication,ForwardedEventsandReorderProtectionreorder_protection 

  • No labels