Having trouble with OpsGenie intergration

I’m having trouble getting Sensu to send alerts to OpsGenie. I wonder if I simply don’t have the correct files in the correct places.

I have the handler in place, and the integration setup in OpsGenie, however I might think I don’t have the config files in the correct places. Could that be the place? When an alert happens in Sensu, nothing is simply sent to OpsGenie. No problems with using the Slack handler.

OpsGenie Documentation: Integrate Opsgenie with Sensu | Opsgenie | Atlassian Support
Plugin used: GitHub - sensu-plugins/sensu-plugins-opsgenie: Sensu plugins for OpsGenie

Apologies if I’ve missed some necessary information.

Hey Daniel, :wave:

Welcome to the Sensu Community forum! I am one of the volunteers helping out in the community. First, can you provide any logging of what happens when an event fires? Specifically, I’m curious if you have any logs indicating what happens when the handler executes and specific errors around that. A few additional items that may be helpful:

  • Resource configuration for your opsgenie handler. (please obfuscate anything confidential)
  • Which version of Sensu Go are you using?

I think we can get closer to finding the issue with this info.

Also, there is a Go version of the handler that I’ve been using successfully in my environment:

Hi,

Tanks for the link. The one you have provided is deprecated, but links to another one:

Having added that with this handler:

type: Handler
api_version: core/v2
metadata:
 name: opsgenie
 namespace: default
spec:
 type: pipe
 command: sensu-opsgenie-handler
 env_vars:
 - OPSGENIE_TEAM=Operations
 - OPSGENIE_APIURL=https://api.opsgenie.com
 timeout: 10
 runtime_assets:
 - nixwiz/sensu-opsgenie-handler
 filters:
 - is_incident
 secrets:
 - name: OPSGENIE_AUTHTOKEN
   secret: opgsgenie_authtoken

And this secret:

---
type: Secret
api_version: secrets/v1
metadata:
  name: opsgenie_authtoken
spec:
  provider: env
  id: OPSGENIE_AUTHTOKEN 

I get this in my logfiles now:

sensu sensu-backend[3548980]: {“component”:“secrets”,“error”:“key /sensu.io/api/enterprise/secrets/v1/secrets/default/opgsgenie_authtoken not found”,“level”:“error”,“msg”:“unable to retrieve secret from provider”,“provider”:“”,“secret”:“opgsgenie_authtoken”,“time”:“2023-06-23T10:50:51+02:00”}

sensu sensu-backend[255685]: {“check_name”:“Check”,“check_namespace”:“default”,“component”:“pipeline/legacy”,“entity_name”:“server”,“entity_namespace”:“default”,“error”:“invalid secret info: opgsgenie_authtoken”,“event_id”:“xxxxxxxx-2f73-494e-9977-ccea3fcd0efb”,“handler_name”:“opsgenie”,“handler_namespace”:“default”,“level”:“error”,“msg”:“failed to retrieve secrets for handler”,“pipeline”:“legacy-pipeline”,“pipeline_workflow”:“legacy-pipeline-workflow-opsgenie”,“time”:“2023-06-23T10:43:19+02:00”}

I’ve tried adding the token with both of these two:

echo SENSU_BACKEND_OPSGENIE_AUTHTOKEN=<the token> | tee -a /etc/default/sensu-backend
echo OPSGENIE_AUTHTOKEN=<the token> | tee -a /etc/default/sensu-backend

Any and help is appreciated!

Bump on this one. Had not had much time to look into it, but the error still is the same.