Kerry DeVilbiss

LogicMonitor Custom HTTP Integrations

Recommended Posts

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:

Edited by Kerry DeVilbiss
formatting

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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}"
}

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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.  image.thumb.png.5a6b8c51ecaabd5edf7d37f76eb09d11.png

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...

 

 

Share this post


Link to post
Share on other sites

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.

 

image.png.7239667c94c9ce18c91aa85df95318fc.png

Then we put these lines in the custom http delivery integration

image.png.df22323af85855680a87d497f42967d4.png

 

Good Luck!

Mike

 

image.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.