Versions Compared

Key

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

...

Expand
titleMethod 2: Configure by using Golang flags

Configure by entering flags into the command in the jsm.cfg file. Use -apiKey flag for your apiKey and -ns flag for nagios_server name. If multiple OP5 servers are not in use, there is no need to define the nagios server. Using flags overwrites all the other configuration methods discussed earlier in the article.
Configure the apiKey from the cfg file as follows:

Code Block
define command {
    command_name    notify-service-by-jsm
    command_line    /home/jsm/jec/scripts/send2jsm -apiKey="apiKey1" -entityType=service ...
}

When apiKey is added to the cfg file, it overrides the apiKey in the config.json file.

To send additional custom arguments, add them after the flags. For example, customArgName1 customArgValue1 customArgName2 customArgValue2. Parse custom arguments by adding {{_payload.customArgName}} to wherever is needed in the input fields. To learn more about using raw parameters, see dynamic fields.

Expand
titleMethod 3: Configure from script

Configure apiKey and nagios_server from send2jsm.go script. To use this option, build the script again and put the new executable to /usr/bin directory. Find information about the location of the send2jsm.go and how to build a go script in the "Source for send2jsm and recompiling" section.

...

The package that you downloaded also includes JEC utility which is located under /usr/local/bin and the script that is needed to be run by JEC which is under /home/jsm/jec/scripts. After the configuration of JEC is done, be sure to run it. Learn more about about running JEC documentation.

Source and recompiling send2jsm

...