Zabbix is an open-source monitoring solution for network servers, devices, services and other IT resources. The integration makes it possible to receive alerts from Zabbix.

Verified integration version

Zabbix 6.4.11

OpsRamp Configuration

  1. From All Clients, select a client.
  2. Navigate to Setup > Account.
  3. Select the Integrations and Apps tab.
  4. The Installed Integrations page, where all the installed applications are displayed. Note: If there are no installed applications, it will navigate to the Available Integrations and Apps page.
  5. Click + ADD on the Installed Integrations page. The Available Integrations and Apps page displays all the available applications along with the newly created application with the version.
  6. Search for the application using the search option available. Alternatively, use the All Categories option to search.
  7. Click ADD on the Zabbix tile.

Inbound (Optional):

Zabbix - Inbound configuration

To configure the inbound, follow these steps:
Authentication:

  1. Select the Authentication Type as either Webhook or OAuth2.

    • Webhook: By default, Webhook is selected as the Authentication Type.
      Make a note of Tenant ID, Token and Webhook URL.
      These details are used while creating an HTTP Request template during Zabbix configuration.

    • OAuth2: Select OAuth2 from the dropdown and click on Generate Key to generate the Key and Secret.
      Note: Keep a copy of the token as the information will not appear again. Read information about the Access Key.

  2. Map Attributes: Map OpsRamp entity attributes with Zabbix attributes.

    1. Click +Add from the Map Attributes section.

    2. From the Add Map Attributes window, enter the below information:

      • OpsRamp Entity: Select Alert from the dropdown.
      • OpsRamp Property: Select the OpsRamp property from the dropdown.
      • Zabbix Entity: Enter the Zabbix entity value in the box and click the +value from the dropdown to add it. You can add multiple values.
      • Zabbix Property: Enter the Zabbix property.

      Parsing Condition:

      1. Click +Add and provide the parsing condition:
      2. Select an operator from the dropdown and enter a value in the fields accordingly. Based on the operator selected, the fields vary.
      3. Click Save. Click +Add to add more conditions.

      Property Values:

      1. Click +Property Value.
      2. Enter a value in the Zabbix Property Value box and select the appropriate value from the OpsRamp Property Value dropdown.
        The options in the OpsRamp Property Value dropdown appear based on the OpsRamp Property selected.
      3. Click Save.
      • Click +Property Value to add more property values.

      Default Value: Alternatively, you can enter/select a default value in the box.

      Note: To map more attributes, click +Entity.

    3. Click Add Map Attributes. The mapped attributes list is added.

      • Click the three dots icon at the end of each row to edit or remove the map attributes.
      • Use the Filter option to filter the map attributes.

  3. Additional Settings: Select the Drop alerts from unmanaged resources checkbox if you do not want to trigger alerts from unmanaged resources.

  4. Enrich and Create Alert: Select a process definition from the dropdown. You can customize the incoming alerts according to the properties defined in the process definition.

  5. Click Finish.

The following table shows attribute mappings:

Third-Party EntityOpsRamp EntityThird-Party PropertyOpsRamp PropertyThird-Party Property ValueOpsRamp Property Value
AlertAlertStatealert.currentStateInformationInfo
WarningWarning
HighCritical
OKOK
AlertAlertMetricalert.serviceName
AlertAlertDescriptionalert.description
AlertAlertHost_Namealert.deviceName
AlertAlertIPalert.resource.ipAddress
AlertAlertEventIDalert.extAlertId
AlertAlertSubjectalert.subject

Zabbix configuration

The following steps describe how to configuring media types and actions.

Step 1: Configure media types

  1. Log into Zabbix Admin UI.
  2. Navigate to Alerts > Media Type and click Create Media Type.
  3. Enter the following required details and click Add.
    • Name: Any name for media type (For example, OpsRamp Alert Webhook)
    • Type: Webhook
    • Parameters: Enter the parameters:
  4. Click Add. The Media Type is added.

Parameter descriptions

The following table provides parameter descriptions for configuring media types.

NameValue
Subject{ALERT:SUBJECT}
Message{ALERT:MESSAGE}
OpsRampURLwebhook URL copied from OpsRamp (For example: https://{yourdomain}:/integrations/alertsWebhook/client_1/alerts?vtoken={token}
HTTPProxy(Optional, needed when zabbix is configured for a proxy network) http://{proxy IP}:{port}

Script

The following is a script for posting alert data to OpsRamp:

try {
	Zabbix.Log(4, 'opsramp webhook script value=' + value);
	var result = {
			'tags': {
				'endpoint': 'opsramp'
			}
		},
		params = JSON.parse(value),
		req = new HttpRequest(),
		alertPayload = {},
		resp;
	postAlertToOpsRamp();
	/**

	- Function to post alert data to OpsRamp
	*/
	function postAlertToOpsRamp() {
		req.addHeader('Content-Type: application/json');
		req.addHeader('Accept: application/json');
		if (typeof params.HTTPProxy !== 'undefined' && params.HTTPProxy !== '') {
			req.SetProxy(params.HTTPProxy);
		}
		var res = req.post(params.OpsRampURL, prepareOpsRampAlertPayload());
		res = JSON.parse(res);
                Zabbix.Log(4, 'Response : ' + JSON.stringify(res));
	}
	/**
	- Function to prepare required OpsRamp alert payload to send
	*/
	function prepareOpsRampAlertPayload() {
		alertPayload.Subject = params.Subject;
		var msg = params.Message;
		var msgLines = msg.split('\r\n');
		for (var i = 0; i < msgLines.length; i++) {
			var field = msgLines[i].split(':');
			alertPayload[field[0]] = field[1];
		}
		alertPayload.State = alertPayload['Status'];
		if (alertPayload['Status'] == 'PROBLEM') {
			if (alertPayload['Trigger_Severity'] == 'Information' || alertPayload['Trigger_Severity'] == 'Not classified') {
				alertPayload.State = 'Information';
			} else if (alertPayload['Trigger_Severity'] == 'Average' || alertPayload['Trigger_Severity'] == 'Warning') {
				alertPayload.State = 'Warning';
			} else if (alertPayload['Trigger_Severity'] == 'High' || alertPayload['Trigger_Severity'] == 'Disaster') {
				alertPayload.State = 'High';
			}
		} else if (alertPayload['Status'] == 'OK') {
			alertPayload.State = 'OK';
		}
		return JSON.stringify(alertPayload);
	}
	return "OK";
} catch (error) {
	Zabbix.Log(4, 'OPSRAMP issue creation failed json : ' + JSON.stringify(alertPayload));
	Zabbix.Log(4, 'OPSRAMP issue creation failed : ' + error);
	result = {};
}
return JSON.stringify(result);

Step 2: Configure actions

  1. Navigate to Alerts > Actions > Trigger Actions and click Create action.

    Zabbix Integration
  2. For the Action tab, enter:

    • Name: Enter any name (For example, OpsRamp Alert Webhook Action)
    • Conditions: Leave default
    • New Condition: Leave default
    • Enabled: Select the checkbox.

  3. For the Operations tab, enter:

    • Operations: Click Add and enter:

      • Steps: Leave default value
      • Step duration: Leave default value
      • Operation Type: Select Send message
      • Send to User groups: Select user group to notify.
      • Send to Users: Select user to notify.
      • Send only to: Select the media type created (For this example, OpsRamp Alert WebhooK)
      • Select the Custom message checkbox.
      • Default subject: Problem: {EVENT.NAME}
      • Default message: Description:{TRIGGER.NAME} Status:{TRIGGER.STATUS} Host_Name:{HOSTNAME} IP:{IPADDRESS} EventID:{EVENT.ID} Trigger_Severity:{TRIGGER.SEVERITY} Event_Severity:{EVENT.SEVERITY} Metric:{ITEM.KEY} Date:{EVENT.DATE} Time:{EVENT.TIME} Item_Name:{ITEM.NAME}
      • Conditions: Leave default
      • Click Add to save.
    • For the Recovery operations, enter:

      • Operations: Click Add and enter:
        • Operation type: Select Notify all involved
        • Send to User groups: Select user group to notify.
        • Send to Users: Select user to notify.
        • Select the Custom message checkbox.
        • Default subject: Resolved: {EVENT.NAME}
        • Default message: ResolvedTime: {EVENT.RECOVERY.TIME} Description:{EVENT.NAME} Status:{TRIGGER.STATUS} Host_Name:{HOSTNAME} IP:{IPADDRESS} EventID:{EVENT.ID} Trigger_Severity:{TRIGGER.SEVERITY} Event_Severity:{EVENT.SEVERITY} Acknowledged: {EVENT.ACK.STATUS} Metric:{ITEM.KEY} Date:{EVENT.DATE} Time:{EVENT.TIME} Item_Name:{ITEM.NAME}
        • Click Add to save.
    • For the Update operations, enter:

      • Operations: Click Add and enter:
        • Operation type: Select Notify all involved
        • Send to User groups: Select user group to notify.
        • Send to Users: Select user to notify.
        • Select the Custom message checkbox.
        • Default subject: Updated problem:: {EVENT.NAME}
        • Default message: Problem updated at:{EVENT.UPDATE.ACTION} Problem name:{EVENT. UPDATE.DATE} {EVENT.UPDATE.TIME}.{EVENT.UPDATE.MESSAGE} Host_Name:{HOSTNAME} IP:{IPADDRESS} Description:{EVENT.NAME} Trigger_Severity:{TRIGGER.SEVERITY} Event_Severity:{EVENT.SEVERITY} Metric:{ITEM.KEY} EventID:{EVENT.ID} Current_Status{EVENT.STATUS} Acknowledged: {EVENT.ACK.STATUS} Item_Name:{ITEM.NAME}
        • Click Add to save.

  4. Click Add. Action details are added.

Example Payload

{
"Subject": "Problem: vsftpd service is down on zabbix-agent",
"Description": "vsftpd service is down on zabbix-agent ",
"Status": "PROBLEM",
"Host_Name": "zabbix",
"IP": "159.65.159.89",
"EventID": "3387",
"Trigger_Severity": "Disaster",
"Event_Severity": "Disaster",
"Metric": "proc.num\[vsftpd\]",
"Date": "2020.01.17",
"Time": "10",
"Name": "vsftpd",
"State": "High"
}

Next steps

View alerts:

  1. From Command Center menu, click on Alerts and search using Zabbix as the Source name. This displays related alerts.
  2. Click Alert ID to view.
Zabbix Integration