Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • /usr/local/nmis9 is replaced with your NMIS path.
  • SERVER is replaced with the IP or domain of your server (eg. 192.168.1024.10185, or nmis-01.mydomain.net).
  • WEBHOOK is replaced with the webhook we copied in the last step.

...

You can now call the script through opEvents with the command:

script.slacker()

How you do this exactly is going to vary depending on how you want the end result to work.  For example, let's add a call to the script when a node goes down.   To do this, scroll down in your Event Actions until you find the line that readsThis would look like the following:

Code Block
             "30" : {
               "BREAK" : "false",
               "IF" : "event.event eq \"Node Down\"",
               "THEN" : [
                  "tag.isbroken(nodedown)",
                  "tag.verybad(42)",
                  "script.slacker()"
                ]
			}

and add the call inside the square brackets.  The end result should look something like this:


Image RemovedAfter modifying the Event Actions to suit your needs, you can then proceed to press the Save button, and verify the Syntax is OK. Once confirmed, you will then need to restart the opEvents daemon (opeventsd).

Testing the integration

If you have applied the integration to an event that may not occur on a regular occurrence, you can also run the following command to simulate the event and verify your integration works:

Code Block
/usr/local/omk/bin/opevents-cli.pl act=create-event node=DC-A-RTR-01 state=down event="Node Down" stateful="Node"

...

You will need to restart the opeventsd opEvents daemon once making this change.