iksaif / opsgenie-notification

Rundeck notification plugin for OpsGenie
3 stars 5 forks source link

Rundeck v3 compatibility? #5

Open AikedeJongste opened 4 years ago

AikedeJongste commented 4 years ago

Is this plugin compatible with Rundeck version 3.2.0? I have installed it but when a job fails the notification to OpsGenie also fails. This is the error: [2019-12-27 07:30:10.740] ERROR NotificationService --- [eduler_Worker-7] Error sending notification: Notification{eventTrigger='onfailure', type='OpsGenieNotification', content='{"source":"${job.href}","message":"${job.status} [${job.project}] \"${job.name} \"","alias":"${job.id}","description":"${job.status} [${job.project}] \"${job.name}\" run by ${job.user} (#${job.execid}) [ ${job.href} ]"}'}: class groovy.lang.MissingPropertyException: No such property: system for class: OpsGenieNotification

rcapliez commented 4 years ago

To fix that issue, edit the file OpsGenieNotification.groovy and update with following lines :

/Lib import / import java.lang.* import com.dtolabs.rundeck.plugins.notification.NotificationPlugin import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper import java.net.URL import java.util.Scanner

/ URL Line 44/45/ static String OPSGENIE_URL = 'https://api.eu.opsgenie.com/v2/alerts'

/ call of system function / if (response_code != 202) { System.err.println("Unexpected response from OpsGenie API: ${response_code}") }

amankhare94 commented 4 years ago

Getting the same error but this solution doesn't work for me. Also, I guess the value of static String OPSGENIE_URL depends on the location of hosting of datastore.

Is there any other way to fix this ?