Versions Compared

Key

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

...

The script action lets you execute a program of your choice, and optionally captures and saves that program's output with the event. As usual, the section script of conf/EventActions.nmis contains the required configuration directives:


Wiki Markupcode
{
   "script" : {
      "traceroute_node" : {
         "exec" : "/bin/traceroute",
         "arguments" : "--max-hops=20 node.host",
         "output" : "save"
      },
      "future_proof" : {
         "max_tries" : 2,
         "output" : "save",
         "stderr" : "save",
         "exitcode" : "save",
         "exec" : [
            "/usr/local/bin/someprogram",
            "--first-fixed-arg",
            "no substitution happens here"
         ],
         "arguments" : [
            "event.node",
            "event.event",
            "--extra",
            "event.details"
         ]
      },
      "ping_node" : {
         "output" : "save",
         "exec" : "/bin/ping",
         "arguments" : "-c 5 node.host"
      }
   }
}

...