REST API Developer's Guide

Acknowledge a Collector Down Alert

You can use LogicMonitor's REST API to acknowledge Collector down alerts.

As with all of our API calls, authentication is required.

Note: This requires version 78

 

HTTP Method: POST

URI: /setting/collectors/{id}/ackdown

Request Parameters:

You must include an acknowledgement comment in your request

Property

Description

Required?

Type

comment The comment to be associated with the acknowledgement Yes String

 

Example

The following Python script acknowledges the Collector down alert for Collector 165 in api.logicmonitor.com, and leaves a comment "upgrading server":

#!/bin/env python

import requests
import json
import hashlib
import base64
import time
import hmac

#Account Info
AccessId ='YQQ75w6Mxx9zWIeAMq5H'
AccessKey ='f)!Z}%spR=6en+4^s2$t32r-3=NpdQ]2T{-deI)8'
Company = 'api'

#Request Info
httpVerb ='POST'

resourcePath = '/setting/collectors/165/ackdown'

data = '{"comment":"upgrading server"}'


#Construct URL 
url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath

#Get current time in milliseconds
epoch = str(int(time.time() * 1000))

#Concatenate Request details
requestVars = httpVerb + epoch + data + resourcePath

#Construct signature
hmac = hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()

signature = base64.b64encode(hmac)

#Construct headers
auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch
headers = {'Content-Type':'application/json','Authorization':auth}

#Make request
response = requests.post(url, data=data, headers=headers)

#Print status and body of response
print 'Response Status:',response.status_code
print 'Response Body:',response.content