VMware Operation Manager Integration with OpsGenie
Asked by xcloete:

Hi,

I was wondering if anyone has been successful at integrating vROPS with Opesgenie using the built-in webhook method supplied by vROPS.

I'm able to create tickets using curl from the vROPS appliance so the API key and headers are good. For some reason none of the alerts are reaching Opsgiene from vROPS itself.

Any ideas?

Thanks,


Answers:
author: Nick H
body: Hi [@xcloete](/t5/user/viewprofilepage/user-id/5017216) ,

I'm not sure we have any sharable examples of integrating Opsgenie with vROPS. But customers will typically leverage either an [Email integration](https://support.atlassian.com/opsgenie/docs/integrate-your-email-with-opsgenie/) or [API integration](https://support.atlassian.com/opsgenie/docs/create-a-default-api-integration/) to integration with 3rd party systems if Opsgenie does not provide a prebuilt integration.

Our [Alert API](https://docs.opsgenie.com/docs/alert-api) documentation might also be helpful with knowing what headers are needed in order to get this potentially working! There's a sample request example from that page using the [Create Alert API](https://docs.opsgenie.com/docs/alert-api#create-alert), and what headers are needed:

```
curl -X POST https://api.opsgenie.com/v2/alerts

    -H "Content-Type: application/json"

    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"

    -d

'{

    "message": "An example alert message",

    "alias": "Life is too short for no alias",

    "description":"Every alert needs a description",

    "responders":[

        {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c", "type":"team"},

        {"name":"NOC", "type":"team"},

        {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8", "type":"user"},

        {"username":"trinity@opsgenie.com", "type":"user"},

        {"id":"aee8a0de-c80f-4515-a232-501c0bc9d715", "type":"escalation"},

        {"name":"Nightwatch Escalation", "type":"escalation"},

        {"id":"80564037-1984-4f38-b98e-8a1f662df552", "type":"schedule"},

        {"name":"First Responders Schedule", "type":"schedule"}

    ],

    "visibleTo":[

        {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},

        {"name":"rocket_team","type":"team"},

        {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8","type":"user"},

        {"username":"trinity@opsgenie.com","type":"user"}

    ],

    "actions": ["Restart", "AnExampleAction"],

    "tags": ["OverwriteQuietHours","Critical"],

    "details":{"key1":"value1","key2":"value2"},

    "entity":"An example entity",

    "priority":"P1"

}'
```

comments: author: xcloete
body: I managed to figure out what the payload template in vROPs should look like.  
This will give you a working payload template. I wasn't able to find any documentation on this. I ended up using Postman to look at an example of an existing Nagios alert and figured out that my format was wrong.  

Remember to add the "$" in front of each parameter. I had to remove it here to be able to past the answer

{  
"message": "{ALERT_DEFINITION}",  
"description": "{ALERT_DEFINITION_DESCRIPTION}",  
"details": {  
"Alert Triggered On": "{RESOURCE_NAME}",  
"Object Type:": "{RESOURCE_KIND}",  
"Alert State": "{CONTROL_STATE}",  
"Alert Priority": "{ALERT_CRITICALITY}",  
"Object Impact": "{ALERT_SUBTYPE}",  
"Object Symptoms": "{SYMPTOMS}"  
}  
}


Tags: cloud