Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

OP5 Monitor Integration

OP5 Monitor is a software product for Network monitoring and management based on the Open Source Project Nagios, and is further developed and supported by op5 AB. OpsGenie is an alert and notification management solution that is highly complementary to Op5 Monitor.

What does OpsGenie offer for OP5 Monitor users?

OpsGenie provides a powerful two-way integration with OP5. When a new alert - host or service - is created in OP5, a corresponding OpsGenie alert will be automatically created, containing rich information about the alert. OpsGenie will provide rich notifications with on-call rotation, scheduling etc. features and alert escalations. Users can choose any of the alert actions of OpsGenie to map to the acknowledge action of OP5.

Functionality of the integration

OP5 to OpsGenie:

  • When a host or service alert is created on OP5, an alert will be created in OpsGenie.
  • When a host or service alert is closed on OP5, corresponding alert will be closed in OpsGenie.
  • When a host or service alert is acknowledged on OP5, corresponding alert will be acknowledged in OpsGenie.

OpsGenie to OP5:

  • If Send Alert Updates Back to OP5 is enabled, actions executed on OP5 alerts will be sent to OP5 as acknowledgement action.
  • This action mapping features are explained in detail in the Action Mapping Feature section below.

Download OpsGenie OP5 Package

For OP5 Monitor's Red Hat Based Distributions

  • Download OpsGenie OP5 (Linux RPM)
  • You can either share the OP5 file to your remote OP5 monitor or you can copy the link in the opening page and run the following command:
    wget https://linkTo.the.OP5Package
  • Run the following command :
    rpm -i opsgenie-op5-<your_version>.rpm

During upgrades, rpm package does not overwrite your existing configurations. It saves the new default configuration file as opsgenie-integration.conf.rpmnew. You can find more information about rpm upgrade config file handling from here.

If you want to update from version 201X-XX-XX to 2.X.X, you must add --force parameter. E.g.:
rpm -U --force opsgenie-integration-<your_version>.rpm

We suggest that you backup your configuration files before update!

Adding OP5 Integration in OpsGenie

  1. Please create an OpsGenie account if you haven't done already.
  2. Go to OP5 Integration page.
  3. Specify who should be notified for OP5 alerts using the "Teams" field. Auto-complete suggestions will be provided as you type.
  4. Copy the integration API key by clicking on the copy button. You'll be using this in the Marid configuration.
  5. Click "Save Integration".

OpsGenie OP5 Package Configuration in OP5 Monitor

The plugin uses a golang-executable file (included in the plugin as nagios2opsgenie) to create, acknowledge and close alerts in OpsGenie. OP5 should be configured to execute this file on events to create, acknowledge and close alerts in OpsGenie.

Setting the apiKey is required. Other configuration parameters are set to defaults that work with OP5.

Configuration Parameters

apiKey

Copy the API key from the OP5 integration you've created above. nagios2opsgenie uses this key to authenticate to OpsGenie. API key is also used to identify the right integration configuration that should be used to process alerts.

recipients

Recipients field is used to specify who should be notified for the OP5 alerts. This field is used to set the default recipients field value. It can be modified to route different alerts to different people in OpsGenie OP5 integration's Advanced Settings page. Recipients can be set to users, groups, escalations or schedules who will be notified by OpsGenie. If you did not set recipients in the integration, this field is required.

teams

Teams field is used to specify which teams should be notified for the OP5 alerts. This field is used to set the default teams field value. It can be modified to route different alerts to different teams in OpsGenie OP5 integration's Advanced Settings page.

tags

Tags field is used to specify the tags of the alert that created in Opsgenie.

viaMaridUrl

viaMaridUrl field is used to send alerts to OpsGenie through Marid. You should enter host and port values of your working Marid.

  • Useful when OP5 server has no internet connection but Marid has internet connection.
  • In order to use this feature you should be running the Marid provided within OpsGenie OP5 Plugin
  • Marid should be running with web server enabled ( http or https configurations eanbled )
  • Marid can run on a seperate host server, the communication between nagios2opsgenie & Marid is done with basic http.
  • Helps OP5 server to consume less time when sending data to OpsGenie by letting Marid do the long task with an async approach.

logPath

Specifies the full path of the log file. (Default value is /var/log/opsgenie/nagios2opsgenie.log)

nagios2opsgenie.http.proxy.enabled

nagios2opsgenie.http.proxy.enabled field is to enable/disable external proxy configuration. The default value is false.

nagios2opsgenie.http.proxy.host

It is the host of the proxy.

nagios2opsgenie.http.proxy.port

It is the port of the proxy.

nagios2opsgenie.http.proxy.scheme

It is the proxy connection protocol. It may be http or https depending on your proxy servers. Its default value is http.

nagios2opsgenie.http.proxy.username

It is the Proxy authentication username.

nagios2opsgenie.http.proxy.password

It is the Proxy authentication password.

There are three ways to configure golang-executable file:

  1. Configuring from conf file: You can configure from /etc/opsgenie/conf/opsgenie-integration.conf file. Configuring from conf file will overwrite the configurations made in the script.
  2. Configuring by using Golang Flags: You can configure by entering flags to command in the opsgenie.cfg file. Use -apiKey flag for your apiKey and -ns flag for your nagios_server name. If you don't have multiple OP5 servers, you don't have to define the nagios server. Using flags will overwrite all the other configuration methods mentioned above.

You configure the apiKey from the cfg file as follows:

define command {
    command_name    notify-service-by-opsgenie
    command_line    /usr/bin/nagios2opsgenie -apiKey="apiKey1" -entityType=service ...
}

When apiKey is added to the cfg file, it will override the apiKey in the opsgenie-integration.conf file.

If you want to send additional custom arguments, you can add them after the flags as: customArgName1 customArgValue1 customArgName2 customArgValue2
You can parse custom arguments by adding {{_payload.customArgName}} to wherever you need on the input fields.
For more information about using raw parameters please visit Dynamic Fields document.

3. Configuring from script: You can configure apiKey and nagios_server from nagios2opsgenie.go script. If you use this option, you need to build the script again and put the new executable to /usr/bin directory. You can find information about the location of the nagios2opsgenie.go and how to build a go script in the "Source" section.

Define OpsGenie as Contact

  1. Login to your OP5 monitor.
  2. Go to your /opt/monitor/etc directory where you'll find nagios.cfg.
    cd /opt/monitor/etc
  3. Add the following line to main Nagios configuration file (nagios.cfg)
...
cfg_file=opsgenie.cfg
...
       
  1. Reboot your monitor to see the "opsgenie" contact in your contact list.
  2. Add the contact "opsgenie" to your OP5 Monitor’s main contact group.

If everything goes well, you will see alerts in OpsGenie for every notification created in OP5.

Configure OpsGenie to OP5 Integration (Optional)

The plugin uses Marid utility (included in the plugin) to enrich alerts when they get created and to update the state of the them in OP5 when they get updated in OpsGenie. For example, when users acknowledge an alert from their mobile devices using the OpsGenie app, alert gets acknowledged in OP5, and when users add notes to alerts in OpsGenie, comments get posted to OP5 as well. Marid subscribes to alert actions in OpsGenie and reflects these actions on OP5.

  • To start Marid, run the following command:
    /etc/init.d/marid start
  • To stop Marid, run the following command:
    /etc/init.d/marid stop

There is also a restart command for Marid: /etc/init.d/marid restart

Marid is a Java application; therefore requires the Java Runtime version 1.6+ Both the Open JDK and Oracle JVMs can be used.

In order to use this feature "Send Alert Actions To OP5" checkbox should be enabled in OpsGenie OP5 Integration.

Ensure that JAVA_HOME environment variable is set. If it is not, you may set it by removing the comment at the begining of the following line in /etc/opsgenie/profile file and set JAVA_HOME to your JRE installation directory.

#JAVA_HOME=<path/to/JDK or JRE/install>

To be able to execute actions in OP5, Marid gets the configuration parameters from /etc/opsgenie/conf/opsgenie-integration.conf file.

Configuration Parameters

op5.url

Marid posts alert actions to an endpoint which is constructed using this URL.

op5.username

Marid uses your OP5 account's username to authenticate.

op5.password

Marid uses your OP5 account's password to authenticate.

If you use Marid, you will see rich alerts populated with host or service current status information in OpsGenie for every notification created in OP5.

For more information refer to Marid Integration Server and Callbacks docs. Please do not hesitate to get in touch with any questions, issues, etc.

FAQ and Troubleshooting

If you're having trouble getting the integration to work, please check if your problem is mentioned below, and follow our advice:

1- OP5 alerts are not getting created in OpsGenie:

Run the following test command from the shell. Check if the test alert is created in OpsGenie:

/usr/bin/nagios2opsgenie -entityType=host -t=PROBLEM -hs=DOWN -hn=test_host

If you're getting a "Trace/breakpoint trap" error: It means your nagios2opsgenie plugin isn't compatible with your server distribution. Follow the "Source and Recompiling nagios2opsgenie" section below and rebuild your nagios2opsgenie.go according to your specific server environment.

If the alert is created in OpsGenie: It means the integration is installed correctly. The problem might be that OP5 is not notifying the OpsGenie contact for alerts. Check your OP5 alert notifications log.

If not: Check the logs at /var/log/opsgenie/nagios2opsgenie.log. Look for the following errors in the log file:

  • If you're seeing "RestException[Could not authenticate.]" in the logs, it means OpsGenie couldn't identify your api key. Check if you've set the API key correctly, as explained in "OpsGenie OP5 Package Configuration in OP5 Monitor" above.
  • If you're seeing "Could not execute this action with apiKey of [OP5] integration" in the logs, you might have downloaded the wrong integration package. Make sure that you download the OP5 integration package.
  • If you can't make sense of the problem, set the plugin's log level to debug, try again and send the logs to us at support@opsgenie.com.

If there is no /var/log/opsgenie/nagios2opsgenie.log file, or there are no logs in it, check the following:

  1. First, make sure the nagios user has permission to write to /var/log/opsgenie directory. The installation package should automatically do this for you. If you encounter problems, execute chown -R nagios:opsgenie /var/log/opsgenie.
  2. Now check your OP5 server logs at /var/log/opsgenie/nagios2opsgenie.log. See if there are error logs regarding nagios2opsgenie, and contact us with them.

Setting nagios2opsgenie plugin's log level to DEBUG:

Change the line nagios2opsgenie.logger=warning to nagios2opsgenie.logger=debug in /etc/opsgenie/conf/opsgenie-integration.conf file.

2- The OP5 alert is not acknowledged when you ack the alert at OpsGenie:

  1. First, check your alert logs.
    • If you don't see the "Posted [Acknowledge] action to OP5.." log, it means OpsGenie didn't send the Acknowledge action to OP5. Check your integration configuration, it might not have matched the alert action.
    • If you're seeing "Executed [Acknowledge] action via Marid with errors." log, it means the op5ActionExecutor.groovy script in your Marid has encountered an error. Check the logs at /var/log/opsgenie/marid/script.log for error logs.
    • If you only see the "Posted [Acknowledge] action to OP5.." log and no related log after that, it might mean Marid is having connection problems. Check the logs at /var/log/opsgenie/marid/Marid.log for error logs.

If you don't see any logs restart your Marid and try sending Acknowledge action again.

  1. If you can't make sense of the problem, set the Marid's script log level to debug, try again and send the /var/log/opsgenie/marid/script.log file to us at support@opsgenie.com.

Setting Marid's script log level to DEBUG:

Change the line log4j.logger.script=WARN, script to log4j.logger.script=DEBUG, script in /etc/opsgenie/marid/log.properties file. Then, restart Marid service.

3- Marid is causing memory leak, or using up too much RAM:

Change the line log4j.rootLogger=WARN, marid to log4j.rootLogger=DEBUG, marid in /etc/opsgenie/marid/log.properties file. Then, restart Marid service and send the /var/log/opsgenie/marid/Marid.log file to us at support@opsgenie.com so we can analyze further.

4- If you get no java executable is found error while installing OpsGenie OP5 Package :

To get Marid to work you need Java. If it's not present on your OP5 monitor install it via:
yum install java

Then run the following command to find your java:
ls -l /usr/lib/jvm

Set the JAVA_HOME to the directory containing a bin/java executable using export command:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.e16_8.x86_64

Source and Recompiling nagios2opsgenie

The source for the executable nagios2opsgenie is located under /usr/bin/ and nagios2opsgenie.go is located under /etc/opsgenie/ and is also available at GitHub OpsGenie Integration repository. If you wish to change the behavior of the executable, you can edit nagios2opsgenie.go and build it using:
go build nagios2opsgenie.go

You can refer to http://golang.org/doc/install/source. Note that nagios2opsgenie is built for linux/amd64 systems.

Action Mapping Feature

OpsGenie allows customers to define action mappings between OpsGenie actions and OP5 actions.

To be able to use the Action Mappings feature you should provide some information to the integration which are listed below:

  • Username: The username of your OP5 account.
  • Password: The password of your OP5 account.
  • OP5 Monitor URL: This is the domain name of your OP5 Monitor e.g. https://19.167.1.143

For alerts created by OP5

  • You can use this section to map OpsGenie actions to OP5 actions when the source of the alert is OP5 (i.e When the alert is created by OP5 integration.)
  • You can map different OpsGenie actions to different OP5 actions. For example, you can acknowledge the alert in OP5, when the alert is acknowledged from OP5. In order to do this, you should define If alert is acknowledged in OpsGenie, acknowledge in OP5. mapping in Send Alert Updates Back to OP5 section.

OP5 Monitor Integration