• Posts

  • Joined

  • Last visited


1 Neutral

About Javier

  • Rank
  1. When any server is down, I can see alarms reported by Ping and Host Status LogicModules, but I can also see other alarms reporting some missing data. Is there any method to automatically acknowledge (or tag) those missing data alarms reported when a server is simply down? It looks like a "Host Status" alarm should silence all other alarms from that server. Should this make sense?
  2. I finally changed my code to use the SDK. I recognize I didn't use it at the first time as it looked somehow complicated. When I saw this example code I realized it was really simple to use. Now my code works perfectly! Thanks a lot for your help!
  3. I am trying this and found several problems. When using on the header, the "Content-Type" spec, I always get an error 500 with an "Unknown error" message. I tried removing it and it looks to work better. Now I am getting a clear "Authentication failed" error message. I think the problem I have now is creating the correct authentication string. As this string is build with, among others, the request details, I don't know how to correctly append this "files" variable (a dictionary object) to the request variable using this piece of code: #Concatenate Request details requestVars = httpVerb + epoch + data + resourcePath #Construct signature signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) #Construct headers auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch headers = {'Authorization':auth} In this case, "data" is not a string, but a dictionary containing a file object. How authorization string should be built for this particular case? I will have a look at the SDK anytime, as suggested.
  4. Hi again, I prepared my script to programmatically create the XML file to define new EventSources. I test it successfully from the UI, using "Add" - "From File". Now I would like to use the API to make such a call. According swagger documentation here, it looks like I need to provide this file as a parameter, but I don't have a clear idea on how to provide that. I tried several methods, but none of them worked so far: Adding a parameter named "file" to the URL. Something like: "https://XXXXXX.logicmonitor.com/santaba/rest/setting/eventsources/importxml?file=toimport.xml" Adding a JSON payload like: { "file": "toimport.xml" } Adding the XML content to the payload: { "file": "<?xml version="1.0" encoding="UTF-8" ?>......" } Using any of these methods, I always get an error "HTTP 415 Unsupported Media Type". What am I doing wrong?
  5. Thanks for the clue!! I solved the problem with my python script. The solution was to include ?v=2 as the first parameter: https://xxxxx.logicmonitor.com/santaba/rest/setting/eventsources?v=2 I also found that option to export an eventsource to a XML file using the UI. I hope I can work with that pretty well. Thanks a lot for your help!
  6. I am trying to get eventsources information using REST API, as documented here. I am using a small python script to try to get any results, but can only get this output: ('Response Status:', 406) ('Response Body:', '<!doctype html><html lang="en"><head><title>HTTP Status 406 \xe2\x80\x93 Not Acceptable</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 406 \xe2\x80\x93 Not Acceptable</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Not Acceptable</p><p><b>Description</b> The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation.</p><hr class="line" /><h3>LogicMonitor Technical Operations</h3></body></html>') Did anybody get this type of call working anytime? Apart from this, I would like to add new eventsources using the REST API. It looks like there is only an import method to get this, using a XML file. Are there any examples or templates of that XML file? Thanks and regards.