Forum Discussion

Kerry_DeVilbiss's avatar
6 years ago

LogicMonitor Custom HTTP Integrations

In a little bit of a low profile announcement, we released the ability to import and export Custom HTTP integrations in LogicMonitor v.118!

Using the collective available knowledge, I've sanitized and exported a handful of them as examples and/or starting points for anyone looking to utilize these solutions.

See my 'LogicMonitor Integrations' Github repository to review and download the .JSON files for import to your LogicMonitor portal.

Currently published integrations include:

  • On 10/16/2019 at 5:04 PM, irievibe said:

    Yes. We are able to update components and have them show degraded and resolve them as well.
    We add the componentid to the info of the resource.

     

    Then we put these lines in the custom http delivery integration

     

    Good Luck!

    Mike

     

     

    I think it is also helpful to have an example of what is in the Alert Data when using incidents, but also wanting to provide an update to a component:

    Cleared

    {
      "incident": {
        "message":"Alert From LogicMonitor: ##HOST## CLEARED",
        "status":"resolved",
        "name":"Alert From LogicMonitor: ##HOST##",
        "body":"string",
        "components": {"##StatusPage.Prod.ComponentId##":"operational"}
        }
    }

    Active

    {
      "incident": {
        "impact_override":"critical",
        "message":"Alert From LogicMonitor: ##HOST## has an alert",
        "status":"identified",
        "name":"Alert From LogicMonitor: ##HOST##",
        "body":"string",
        "components": {"##StatusPage.Prod.ComponentId##":"degraded_performance"}
        }
    }

     

  • Yes. We are able to update components and have them show degraded and resolve them as well.
    We add the componentid to the info of the resource.

     

    Then we put these lines in the custom http delivery integration

     

    Good Luck!

    Mike

     

  • Blake, 

    If I understand you correctly, I think you are talking about something similar to what we do on status hub not status page but I think you could handle it with a similar process.  We have our different products with multiple services under each sometimes.  

    These services are all updated independently by creating the generic webhook integration in statushub.  We then create a property on the webcheck or device - statushub.token=#######.    When an alert is triggered it posts to the webhook and appends the token that references the service in status hub.

    payload={
      "title": "This service is currently experiencing issues and we are investigating.",
      "message": "We apologize for the inconvenience!",
      "type": "investigating",
      "status": "down",
      "service_token": "##statushub.token2##"
    }

    This should work pretty much the same way using the component api that they offer when I took a quick glance at their docs.  You would just append the token in the API component Url that you use to post.  Maybe this will help you or at least give you an idea of how you could solve it...

     

     
  • On 7/2/2019 at 5:09 PM, irievibe said:

    This is great! 

    I'll drop by statuspage.io integration json in here as well:

    {
        "enabledStatus": [
            "active",
            "clear"
        ],
        "parseMethod": "jsonPath",
        "name": "StatusPage.IO Demo",
        "ack": null,
        "clear": {
            "headers": [
                {
                    "Authorization": "********"
                }
            ],
            "password": "********",
            "method": "patch",
            "payload": "{\"incident\":{\"message\":\"Alert From LogicMonitor: ##HOST## CLEARED\",\n\"status\":\"resolved\",\n\"name\":\"Alert From LogicMonitor: ##HOST##\"} }",
            "payloadFormat": "json",
            "url": "https://api.statuspage.io/v1/pages/##statuspage.io.pageID##/incidents/##EXTERNALTICKETID##.json",
            "username": ""
        },
        "description": "",
        "active": {
            "headers": [
                {
                    "Authorization ": "********"
                }
            ],
            "password": "********",
            "method": "post",
            "payload": "{\"incident\":{\"impact_override\":\"critical\",\n\"message\":\"Alert From LogicMonitor: ##HOST## has an alert\",\n\"status\":\"identified\",\n\"name\":\"Alert From LogicMonitor: ##HOST##\"} }",
            "payloadFormat": "json",
            "url": "https://api.statuspage.io/v1/pages/********/incidents.json",
            "username": ""
        },
        "update": null,
        "type": "http",
        "parseExpression": "$.id",
        "uiDetails": "{\"includeIDInHttpResponse\":true,\"groupInfo\":[[\"clear\"],[\"active\"]],\"multipleMode\":true}"

    Thanks!

    Mike

    Mike, I was able to get LM to update Statuspage.IO as far as Incidents go. But we have some Componets where we are monitoring internal/external websites. Were you able to get LM to update the actual components to show Degraded, etc?

  • This is great! 

    I'll drop by statuspage.io integration json in here as well:

    {
        "enabledStatus": [
            "active",
            "clear"
        ],
        "parseMethod": "jsonPath",
        "name": "StatusPage.IO Demo",
        "ack": null,
        "clear": {
            "headers": [
                {
                    "Authorization": "********"
                }
            ],
            "password": "********",
            "method": "patch",
            "payload": "{\"incident\":{\"message\":\"Alert From LogicMonitor: ##HOST## CLEARED\",\n\"status\":\"resolved\",\n\"name\":\"Alert From LogicMonitor: ##HOST##\"} }",
            "payloadFormat": "json",
            "url": "https://api.statuspage.io/v1/pages/##statuspage.io.pageID##/incidents/##EXTERNALTICKETID##.json",
            "username": ""
        },
        "description": "",
        "active": {
            "headers": [
                {
                    "Authorization ": "********"
                }
            ],
            "password": "********",
            "method": "post",
            "payload": "{\"incident\":{\"impact_override\":\"critical\",\n\"message\":\"Alert From LogicMonitor: ##HOST## has an alert\",\n\"status\":\"identified\",\n\"name\":\"Alert From LogicMonitor: ##HOST##\"} }",
            "payloadFormat": "json",
            "url": "https://api.statuspage.io/v1/pages/********/incidents.json",
            "username": ""
        },
        "update": null,
        "type": "http",
        "parseExpression": "$.id",
        "uiDetails": "{\"includeIDInHttpResponse\":true,\"groupInfo\":[[\"clear\"],[\"active\"]],\"multipleMode\":true}"

    Thanks!

    Mike

  • Irievibe, 

    This is what we use for integrating with our on-prem Jira instance.  Should just need to update the things I blanked out with ### and the correct "field ID's" for your setup and import it.  Should give you a starting point if nothing else.

    {
        "enabledStatus": [
            "active",
            "update",
            "clear"
        ],
        "parseMethod": "jsonPath",
        "name": "jira-###",
        "ack": null,
        "clear": {
            "headers": [],
            "password": "********",
            "method": "post",
            "payload": "{\n  \"update\": {\n    \"comment\": [\n      {\n        \"add\": {\n          \"body\": \"Alert cleared, auto-closing ticket.\"\n        }\n      }\n    ]\n  },\n  \"transition\": {\n    \"id\": \"171\"\n  }\n}",
            "payloadFormat": "json",
            "url": "https://jira.####.com/rest/api/2/issue/##EXTERNALTICKETID##/transitions",
            "username": "###service_account###"
        },
        "description": "integration to generate tickets for alerts for ###",
        "active": {
            "headers": [],
            "password": "********",
            "method": "post",
            "payload": "{\n  \"fields\":{\n    \"project\":\n    {\n      \"key\": \"HOST\"\n    },\n    \"summary\": \"##LEVEL## - ##HOST####WEBSITE## - ##INSTANCE##\",\n    \"description\": \"##HOST####WEBSITE##\\nDatasource: ##DATASOURCE##\\nDatapoint: ##DATAPOINT##\\nLevel: ##LEVEL##\\nStart: ##START##\\nDuration: ##DURATION##\\nThreshold: ##THRESHOLD##\\nValue: ##VALUE##\\nURL: ##URL##\\nAlert URL: ##AlertDetailURL##\",\n    \"customfield_17567\": {\n      \"self\": \"https://jira.#####.com/rest/api/2/customFieldOption/22162\",\n      \"value\": \"Medium - Inconvenienced\",\n      \"id\": \"22162\"\n    },\n    \"customfield_17568\": {\n      \"self\": \"https://jira.#####.com/rest/api/2/customFieldOption/30804\",\n      \"value\": \"Automated Alert\",\n      \"id\": \"30804\"\n    },\n    \"customfield_18861\": [\n      {\n        \"value\": \"####\"\n      }\n    ],\n    \"issuetype\": {\n      \"name\": \"Request\"\n    }\n  }\n}",
            "payloadFormat": "json",
            "url": "https://jira.####.com/rest/api/2/issue",
            "username": "###service_account###"
        },
        "update": {
            "headers": [],
            "password": "********",
            "method": "post",
            "payload": "{\n    \"body\": \"Logic Monitor event is now at severity level: ##LEVEL##\"\n}",
            "payloadFormat": "json",
            "url": "https://jira.####.com/rest/api/2/issue/##EXTERNALTICKETID##/comment",
            "username": "###service_account###"
        },
        "type": "http",
        "parseExpression": "key",
        "uiDetails": "{\"includeIDInHttpResponse\":true,\"groupInfo\":[[\"update\"],[\"clear\"],[\"active\"]],\"multipleMode\":true}"
    }

     

  • We were able to get a basic HTTP integration started for StatusPage.io

    We are also looking for a Jira integration if anyone is working on that

    I submitted the .json file to the GitHub repository. If Kerry gives it his blessing, maybe add it in and share the link?

    Cheers!

    Mike

  • @Blake - not yet for the API, unfortunately. I've looked around but haven't been able to find anything yet; will be sure to update the repository if/ when that happens and make sure someone reaches out.

    I believe that they can also ingest LogicMonitor alert emails, but acknowledge that's less than ideal.

  • Thanks Kerry! Do you have anything for StatusPage.IO? Got half way there between the two API's but having issues with the components.