Zenoss Integration

Zenoss is an open-source application, server, and network management platform.

What does OpsGenie offer Zenoss users?

OpsGenie Zenoss integration plugin utilizes full capabilities of OpsGenie and provides a bi-directional integration with Zenoss. Integration leverages OpsGenie's Zenoss-specific executable and Marid utility to automatically create alerts and synchronizes alert status between Zenoss and OpsGenie.

Installation

The steps below describe how to integrate OpsGenie and Zenoss using OpsGenie Zenoss integration plugin. Note that slight alteration to these instructions may be necessary depending on the exact Linux distribution and your Zenoss configuration.

Prerequisites

Packages provided support the following systems:

  • Red Hat based linux distributions
  • Debian based linux distributions

Download OpsGenie Zenoss Plugin

For Red Hat Based Distributions

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

To update from version 201X-XX-XX to 2.X.X, add --force parameter.

E.g.: rpm -U --force opsgenie-integration-<your_version>.rpm

We suggest backing up configuration files before updating!

For Debian Based Distributions

Add Zenoss integration in OpsGenie

  1. Please create an OpsGenie account, if you haven't done so already.
  2. Go to OpsGenie Zenoss Integration page.
  3. Specify who is notified of Sentry alerts using the Teams field. Auto-complete suggestions are provided as you type.
  4. Copy the API key.
  5. Click Save Integration.

OpsGenie Plugin Configuration in Zenoss

The plugin uses a golang-executable file (included in the plugin as zenoss2opsgenie) to create, acknowledge, and close alerts in OpsGenie. Configure Zenoss to execute this file on events to create, acknowledge, and close alerts in OpsGenie.

Configuration Parameters
Description
Mandatory to fill

apiKey

Copy the API key from the Zenoss integration you've created above. zenoss2opsgenie 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.

Yes

zenoss.command_url

URL to get detailed event data from Zenoss in zenoss2opsgenie.

Optional

zenoss.user

Credentials to authenticate Zenoss web server

Optional

zenoss.password

Credentials to authenticate Zenoss web server

Optional

recipients

Recipients field is used to specify who should be notified for the Zenoss 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 Zenoss integration, 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.

Optional

teams

Teams field is used to specify which teams should be notified for the Zenoss 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 Zenoss integration, Advanced Settings page.

Optional

tags

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

Optional

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 Zenoss 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 Zenoss Plugin
  • Marid should be running with web server enabled ( http or https configurations enabled )
  • Marid can run on a seperate host server, the communication between zenoss2opsgenie & Marid is done with basic http.
  • Helps Zenoss server to consume less time when sending data to OpsGenie by letting Marid do the long task with an async approach.

Optional

logPath

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

Optional

zenoss2opsgenie.http.proxy.enabled

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

Optional

zenoss2opsgenie.http.proxy.host

It is the host of the proxy.

Optional

zenoss2opsgenie.http.proxy.port

It is the port of the proxy.

Optional

zenoss2opsgenie.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.

Optional

zenoss2opsgenie.http.proxy.username

It is the Proxy authentication username.

Optional

zenoss2opsgenie.http.proxy.password

It is the Proxy authentication password.

Optional

opsgenie.api.url

If you're using OpsGenie from another domain(eg. EU, sandbox), you should update this configuration.

Optional

There are three ways to configure golang-executable file:

  1. "Configuring from conf file": Configure from /etc/opsgenie/conf/opsgenie-integration.conf file. Configuring from conf file overwrites the configurations made in the script.
  2. "Configuring by using Golang Flags": Configure by entering flags to command of the notification created in Zenoss, which is described in "Configure Triggers in Zenoss" section. Use -apiKey flag for your apiKey.

To send additional custom arguments, add them after the flags as: customArgName1 customArgValue1 customArgName2 customArgValue2
Parse custom arguments by adding {{_payload.customArgName}} to wherever is needed on the input fields.
For more information about using raw parameters please visit Dynamic Fields document.

  1. "Configuring from script": Configure apiKey zenoss2opsgenie.go script. If choosing this option, build the script again and put the new executable to /usr/bin directory. Find information about the location of the zenoss2opsgenie.go and how to build a go script in the "Source" section.

Configure Triggers in Zenoss

Before creating a notification:

  1. Select Events > Triggers from the Navigation menu
  2. Create a trigger named opsgenie.

After creating the trigger, follow the steps below:

  1. Select Events > Triggers from the Navigation menu.
  2. Select Notifications from the left panel.
  3. Create a notification.
  1. Choose the notification created previously and click Edit.
  2. under the "Notification" tab, enable the notification, set "Send Clear" as checked and add the trigger named "opsgenie" from the trigger list and click Add.
  1. Under the "Content" tab, put the following into "Command" and "Clear Command" fields. Add optional -eventState=close to Clear Command, zenoss2opsgenie executable does not try to get event details from Zenoss and directly closes the event's alert in OpsGenie.

/usr/bin/zenoss2opsgenie -evid=${evt/evid}

  1. Under the "Subscribers" tab, choose the subscribers and click SUBMIT.

Configure OpsGenie to Zenoss Integration (Optional)

The plugin uses Marid utility (included in the plugin) to update the state of alerts in Zenoss when they get updated in OpsGenie. For example, when users acknowledge/close an alert from their mobile devices using the OpsGenie app, the alert gets acknowledged/closed in Zenoss. Marid subscribes to alert actions in OpsGenie and reflects these actions on Zenoss using Zenoss JSON API.

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

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 check the "Send Alert Actions To Zenoss" checkbox in OpsGenie Zenoss Integration.

Ensure that JAVA_HOME environment variable is set. If it is not, set it by removing the comment at the beginning 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 execute actions in Zenoss, Marid gets the configuration parameters from /etc/opsgenie/conf/opsgenie-integration.conf file.

Configuration Parameters

zenoss.command_url

URL to update Zenoss events when alerts get acknowledged, closed, etc.

zenoss.user

Credentials to authenticate on Zenoss web server.

zenoss.password

Credentials to authenticate on Zenoss web server.

If the error "JAVA_HOME not defined" occurs in /var/log/opsgenie/zenoss2opsgenie.log, define it in /etc/opsgenie/profile shell script.

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

Zenoss integration package does not support SSL v1.0. If your Zenoss Server has SSL v1.0, we suggest upgrading the SSL server.

FAQ and Troubleshooting

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

1. Zenoss 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/zenoss2opsgenie -test

  • If you're getting a "Trace/breakpoint trap" error occurs It means the zenoss2opsgenie plugin isn't compatible with the server distribution. Follow the "Source and Recompiling zenoss2opsgenie" section below and rebuild the zenoss2opsgenie.go according to the specific server environment.
  • If the alert is created in OpsGenie: It means the integration is installed correctly. The problem might be that Zenoss is not notifying the OpsGenie contact for alerts. Check your Zenoss alert notifications log.
  • If not: Check the logs at /var/log/opsgenie/zenoss2opsgenie.log. Look for the following errors in the log file:
    • If "RestException[Could not authenticate.]" occurs in the logs, it means OpsGenie couldn't identify the API key. Check if the API key is set correctly, as explained in "OpsGenie Plugin Configuration in Zenoss" above.
    • If unsure 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/zenoss2opsgenie.log file, or there are no logs in it, check the following:
    1. First, make sure the zenoss 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 zenoss:opsgenie /var/log/opsgenie
    2. Now check the Zenoss server logs at /opt/zenoss/log/zeneventd.log. See if there are error logs regarding zenoss2opsgenie, and contact us with them.

Setting zenoss2opsgenie plugin's log level to DEBUG:
Change the line zenoss2opsgenie.logger=warning to zenoss2opsgenie.logger=debug in /etc/opsgenie/conf/opsgenie-integration.conf file.

2. The Zenoss alert is not acknowledged when the alert is acked in OpsGenie:

  1. First, check the alert logs.
    • If "Posted [Acknowledge] action to Zenoss.." is not in the log, it means OpsGenie didn't send the Acknowledge action to Zenoss. Check the integration configuration, it might not have matched the alert action.
    • If "Executed [Acknowledge] action via Marid with errors." occurs in the log, it means the zenossActionExecutor.groovy script in your Marid has encountered an error. Check the logs at /var/log/opsgenie/marid/script.log for error logs.
    • If only the "Posted [Acknowledge] action to Zenoss.." log occurs 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.
  2. If unsure 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.

Source and Recompiling zenoss2opsgenie

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

For installing go, refer to http://golang.org/doc/install. Note that the executable in the plugin is built for linux/386 systems.

Zenoss Integration

Zenoss is an open-source application, server, and network management platform.