nixwiz / sensu-opsgenie-handler

Sensu Go Opsgenie Handler https://sensu.io
MIT License
1 stars 3 forks source link

Team selection not working since version 0.8.0 #16

Open crypted256 opened 3 years ago

crypted256 commented 3 years ago

If I specify a team on the CLI or via the OPSGENIE_TEAM environment variable the team is not forwarded to OpsGenie. To recreate this issue I've created a test event and send it to opsgenie like this:

cat /tmp/test-alert-no-override.conf | sensu-opsgenie-handler --priority P5 --region eu --team Test --auth $APITOKEN

In the OpsGenie Debug Logs I can see that the event was received but the responders are empty

{
  "_result": {
    "alertAction": "create",
    "integrationName": "Sensu plain",
    "integrationActionName": "Create Alert"
  },
  "alertLogOwner": "Alert API",
  "alertId": "7897c3ee-4b3d-49df-8a65-f505a268c8ad-1616143833003",
  "_incomingData": {
    "_parsedData": {
      "note": "null",
      "-responders": [],
      "-actions": [],
      "-tags": [
        "xxxxxxxxxxxxxxxx.xxxxxxxx.net",
        "R5R8_I-oben",
        "default",
        "proxy"
      ],
      "alias": "xxxxxxxxxxxxxxxx.xxxxxxxx.net/R5R8_I-oben",
      "description": "SNMP CRITICAL - R5R8_I-oben *10* A | R5R8_I-oben=10;7;9",
      "source": "Sensu Go",
      "message": "xxxxxxxxxxxxxxxx.xxxxxxxx.net/R5R8_I-oben",
      "priority": "P5",
      "user": "Alert API",
      "_extraProperties": {
        "occurrences": "1",
        "output": "SNMP CRITICAL - R5R8_I-oben *10* A | R5R8_I-oben=10;7;9",
        "occurrences_watermark": "3811",
        "proxy_entity_name": "xxxxxxxxxxxxxxxx.xxxxxxxx.net",
        "state": "failing",
        "command": "check_snmp",
        "status": "2"
      },
      "entity": "xxxxxxxxxxxxxxxx.xxxxxxxx.net"
    },
    "integrationType": "Sensu",
    "integrationName": "Sensu plain",
    "incomingDataId": "15d0d66b-baf4-4fc0-a4f0-5d801092847c"
  },
  "alertLogType": "system"
}

with Version 0.7.0 of your plugin the Team selection was working as intended for us.

cynici commented 3 years ago

FWIW, this specific issue has been fixed over here https://github.com/betorvs/sensu-opsgenie-handler/issues/15 Use version 1.0.2!