Search the Community

Showing results for tags 'API'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • LogicModule Exchange
    • LM Exchange
    • LM Staff Contributions
  • Product Announcements
    • LogicMonitor Notices
  • LogicMonitor Product Q&A
    • Feature Requests
    • Ask the Community
    • From the Front

Found 48 results

  1. Would it be possible to provide an API call or calls that provide a 'hit count' (historical and current) against alert rules and escalation chains? Ideally it would allow a filter to be assigned for alert levels of interest. This would help in providing metrics around how many alerts are being generated, and to what areas of responsibility, and help drive additional questions around configuration and maintenance. I know there is a report to extract thresholds and their destinations, but these metrics are not available currently, it seems. Many Thanks ~Nick
  2. I hope someone here can help, Using powershell and the rest API I would like to do a lookup of selected collectors find which has the least amount of devices on it then add the a new device . I have the script for adding the device and that works great just need the collector lookup, has anyone done something similar. Thank you in advanced for all help provided Paul
  3. Does anyone have any scripts that remove datasource instances using LM's API?
  4. Fetching A Specific Dashboard URL

    Hello all, I am currently researching the possibility of running an integration between ServiceNow, an application my company utilizes, and LogicMonitor. I have a request from an end user to open a specific dashboard (this dashboard is different depending on certain conditions, but it is the same type of dashboard) when a link is clicked on the ServiceNow side. After looking at the REST API for LogicMonitor, specifically the API for getting information about a dashboard, I haven't found anything that points to the ability to grab the dashboard URL. I am able to craft a hyperlink such that it opens to ALL the dashboards for my company, but since the dashboards don't seem to follow a set pattern in their URL end-tags, I haven't been able to find a way to make the link dynamically specific to the dashboard that the end user wants. For reference, the desired dashboard URL will resolve to https://companyname.logicmonitor.com/santaba/uiv3/dashboard/#dashboard=XXXXX, I need to know how to get either the entire URL or the dashboard number at the end (which is DYNAMIC), if possible. Any input you may be able to offer is appreciated. Thank you for your time!
  5. I'm trying to clean up datasources that are in our account that do not have any instances associated with them and likely never will. Currently I have to do this manually by inspecting each datasource in the GUI. It would be really great if the datasource instance count was returned as a property. Even better would be if the instances and associated device ID's were returned as well, but for now I'd be happy with just the device/instance counts.
  6. Hey guys, I've looked through the API documentation but can't see a way to enable/disable datasources at the group level (as you can do via the UI via the checkboxes on the alert tuning tab). You can do group level thresholds via the API, which is close but not the same. Am I missing something or is this not possible?
  7. API - Device Data Aggregation

    On the Get Device Data endpoint we'd like to be able to aggregate the data that comes back in some sort of time window. There is currently the ability to pass the period parameter in order to specify how far back you'd like to pull data from. But we would like to have two extra parameters. One to specify the type of aggregation(SUM, AVG, MIN) and another to specify the time window that we'd like that aggregation to roll up on(1min, 60min). So if we were to request data with a period of 2(hours), an aggregation of AVG, and roll_up_window of 1(min) then we'd expect to get back 120 rows, each representing the average of the values for each minute.
  8. view integration strings

    Hello, We are using custom HTTP Integrations towards Servicedesk Plus from Manage Engine. When creating these we need to know what information we are sending to our ticket system so that we are able to see what we need to change to make it work. What we need is some tool to view the complete request we send to Servicedesk Plus. That would be a great help for us. When we test our integrations we just get the answer from the receiving system. Is it possible to have that kind of solution?
  9. Introduction Postman is widely used for interacting with various REST APIs such as LogicMonitor's. However, there is no out-of-the-box support for the LMv1 authentication method which we recommend as a best practice. This document describes how to configure Postman to use LMv1 authentication when interacting with our REST API. Overview Postman's pre-request script functionality provides the ability to generate the necessary Authorization header for LMv1 authentication. As the name suggests, the pre-request script runs immediately before the request is made to the API endpoint. We set the pre-request script at the collection level in Postman so that it will run automatically for every request that is part of the collection. The script requires three input parameters: a LogicMonitor API token (or ID), its associated key, and the full request URL. These parameters are made available to the script by creating a Postman environment and setting the values as environment variables. If you need to access multiple LogicMonitor accounts (portals), create a separate environment for each to store the applicable API and URL information. Since all API requests to a given account use the same base URL (https://<account>.logicmonitor.com/santaba/rest) it is convenient to store this as an environment variable. The output of the script is the value of the Authorization header. The script writes the header value to an environment variable which is then inserted as the Authorization header value in the request. Instructions 1. Download and install Postman. 2. Launch Postman and create a new collection that will be used for all LogicMonitor API requests. 3. In the create collection dialog, select the "Pre-request Scripts" section and paste in the following code. // Get API credentials from environment variables var api_id = pm.environment.get('api_id'); var api_key = pm.environment.get('api_key'); // Get the HTTP method from the request var http_verb = request.method; // Extract the resource path from the request URL var resource_path = request.url.replace(/(^{{url}})([^\?]+)(\?.*)?/, '$2'); // Get the current time in epoch format var epoch = (new Date()).getTime(); // If the request includes a payload, included it in the request variables var request_vars = (http_verb == 'GET'||http_verb == 'DELETE') ? http_verb + epoch + resource_path : http_verb + epoch + request.data + resource_path; // Generate the signature and build the Auth header var signature = btoa(CryptoJS.HmacSHA256(request_vars,api_key).toString()); var auth = "LMv1 " + api_id + ":" + signature + ":" + epoch; // Write the Auth header to the environment variable pm.environment.set('auth', auth); 4. Create a new environment. Create the environment variables shown below. You do not need to provide a value for the "auth" variable since this will be set by the pre-request script. Be sure to use the api_id, api_key, and url values appropriate for your LogicMonitor account. 5. Create a request and add it to the collection with the pre-request script. A sample request is shown below with the necessary parameters configured. 1. Set the environment for the request, 2. Set the HTTP method for the request. 3. Use {{url}} to pull the base URL from the environment variable. Add the resource path and any request parameters your API request may require. 4. Add the Authorization header and set the value to {{auth}} to pull the the value from the environment variable. 5. POST, PUT, and PATCH requests only: if your request includes JSON data, be sure to select the Body tab and add it. 6. Press Send to send the request. The response will appear below the request in Postman. Troubleshooting You receive the response "HTTP Status 401 - Unauthorized" Confirm the following: • The proper environment has been specified for the request. • The necessary environment variables have been set and their values are correct. Note that the script relies on the specific variable names used in this document: "api_id", "api_key", "url", and "auth". • The request is a member of the collection configured with the pre-request script. Postman reports "Could not get any response" or "There was an error in evaluating the Pre-request Script: TypeError: Cannot read property 'sigBytes' of undefined" Make sure you have set the proper environment for the request and all necessary environment variables and values are present.
  10. IFTTT is a free SaaS platform that helps you "do more with all your apps and devices" - by providing an integration point between commonly used services and platforms. In the following example, we're using the IFTTT Applet webhooks "trigger" to activate a Philips Hue wireless lighting "action" - blinking the lights of the connected Hue platform as a result of a LogicMonitor alert! Other things you might be able to do with LogicMonitor alerts, through IFTTT (lots of untested possibilities!) : Change lighting colors based on alert status (red for new, green for cleared, etc.) Receive alert notifications to connected systems like Skype, Twitter, Evernote, or Google. Play music on a connected Sonos system after triggering an alert. Turn on a connected Smart Plug like the Wemo from Belkin. The Finished Result The following tutorial assumes that you have an IFTTT account created and permissions to add an integration to your LogicMonitor account. Step 1: Log into your IFTTT account and create a new 'Applet' Step 2: Search for and choose the 'Webhooks' service. Step 3: Choose the 'Receive a Web Request' trigger. Step 4: Configure (and remember) the event name that will be recognized by the incoming webhook to trigger the event. Step 5: Configure the 'Action' that will be taken when this event is triggered in IFTTT - lots of intriguing possibilities! Step 6: Once you've added and configured the 'Action,' review the applet settings and click 'Finish' to save the Applet. Step 7: Select 'Services' from the account dropdown - we will be looking up the incoming webhook URL for our account so we know where to send our alerts. Step 8: Search for the 'Webhooks' service and select it to proceed. Step 9: Select the 'Documentation' link from the 'Webhooks' services page. Step 10: Copy the incoming Event trigger URL along with the key for your account. You will replace {event} in the URL with the one you configured above. Step 11: Moving to your LogicMonitor account, navigate to 'Settings -> Integrations' and add a new 'Custom HTTP Delivery' integration using the event name from Step 4 and the URL (with key) from Step 10 : Step 12: IFTTT allows you to include an (optional!) payload - which will show in the 'Activity Log' of the IFTTT Applet. Step 13: Test Alert Delivery and you should see output similar to below in the IFTTT Activity Log. Step 14: Save your integration, assign it to an Escalation Chain, and assign the Escalation Chain to an Alert Rule - and now we've configured a simple integration between LogicMonitor and IFTTT that could form the basis of a handful of interesting alert actions!
  11. HTTP Authentication Required?

    I have two sets of code. 1 pulls all 'Services' or Website groups. The other is supposed to just pull the group name and id. The first works, the second doesn't. I am using the base PowerShell script laid out in the documentation. If I remove the ?fields=name,id it works without issue. If I add it back it gives me this error "HTTP Status 401 - Unauthorizedtype Status reportmessage Unauthorizeddescription This request requires HTTP authentication.LogicMonitor Technical Operations". Any help would be awesome. <# request details #> $httpVerb = 'GET' $resourcePath = '/service/groups?fields=name,id' $status = $null $body = $null $response = $null <# Construct URL #> $url = 'https://' + $company + '.logicmonitor.com/santaba/rest' + $resourcePath
  12. Hello, Is there a method to pull all the services [websites] from a group ? I have created a group "TEST" under services, and added 50 websites for monitoring, I need to pull a list of services from TEST group. thanks
  13. widget status via API

    One of the most disappointing things encountered during a system review meeting with clients is to find widgets reporting "no data" because something changed or silently stopped producing results. In many other API endpoints, I have found there is a ton of state data embedded, but widgets have really nothing other than the lastUpdated* fields. I would like to see at least a field that indicates there is no data for some or all datapoints, just like you would see in the UI. Then we could generate reports on faulty widgets and be able to remain proactive. Thanks, Mark
  14. Creating dynamic group

    Hi All I am trying to create groups with a python script which read a CSV file. my txt file has following information {"name":1","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"} {"name":2","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"} {"name":3","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"} {"name":4","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"} when I run the script bellow I receive Invalid JSON body message Response Status: 200 Response Body: b'{"data":null,"errmsg":"Invalid json body","status":1007}' I can create the group if I assign value directly like data ='{"name":1","parentId":462,"appliesTo": "Type==\\"Test Server\\\"\"}' Script is
  15. API/Script

    Hi I want to create device group named as "Fileserver" in /device/serversThis is the first time I am running the script, so could you please check if my script is ok. Alsoplease let me know how I run this script. I am sharing the script with you. #!/bin/env python import requests import json import hashlib import base64 import time import hmac #Account Info AccessId ='TBA' AccessKey ='TBA' Company = 'contoso' #Request Info httpVerb ='POST' resourcePath = '/device/servers' data = '{"name":"Fileserver"}' #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 signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest()) #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
  16. SOLR Error Logs

    W9PN3Y I thought I had already posted this one, but regardless - here it is. This does not apply to any servers by default as it can be extremely noisy if you don't have it tuned. This makes an API call to solr to pull error and severe logs and then formats them so that LogicMonitor can understand them. Before applying this, it's not a bad idea to review those logs manually to make sure something isn't repeatedly triggering (as is common with SOLR). Still - it's helped us detect and diagnose a range of issues that would have otherwise been difficult to see.
  17. SOLR JVM Stats (non-JMX)

    ANLX64 This monitors solr JVM stats via the SOLR API without the need to enable jmx. This datasource may not work on older solr versions as this particular API call was only recently introduced. Still, it should be very useful for monitoring the overall health of the JVM application.
  18. ZLPJP3 This datasource monitors the status of each solr collection without the need to enable JMX. It is done via batchscript and seems to be very efficient. The only alert set up is for cores that are recovering. Other alerts can be set up at your discretion. There are a few graphs included as well.
  19. 3Z32Z4 This datasource monitors a large amount of SOLR performance data for each SOLR collection/core. It is done via batchscript and appears to return data extremely reliably and efficiently. There are no alert thresholds set up as performance expectations may vary depending on usage. I've also set up basic overview and per-instance graphs. There are 65 datapoints here though, so I'm sure more can be added.
  20. API - GET 'Expired' SDTs

    We would like be able to query historic SDTs to determine if a device,group, or instance has recently come out of SDT via API.
  21. Hi all, I'm trying to find ideas, scripts, processes for a function our customer approached us with. In short, they want LM to place a call once per hour to the Interactive Voice Response application to ensure the IVR system answers the call, prompts are being displayed, and host database connection is established. My only is guess is to somehow create a Datasource that runs a script to interact with an API that somehow makes a phone call and then displays information as a result. I would like to know if this already part of LM or would need to be heavily developed in-house or is even remotely possible to implement. If you have had any success with this type of monitoring, I'd appreciate your insight. Thanks much
  22. I was testing the new rate limiting feature that was to be rolled out v99 and enacted in v100. Turns out Powershell throws out the headers when calling the invoke-restmethod commandlet unless an exception is thrown - this would mean I need to re-write all of my REST API scripts in another language or change to invoke-webrequest. It would make it to adapt to the rate limiting for us PowerShell users easier if this data was just included in the response content.
  23. Is there a way to capture the datasource history? I tried combining through the forums and REST API instructions, but wasn't able to find anything. I would expect something like '/setting/datasources/XXXXXX/history'. I can access this via the UI - "settings --> datasources --> [Any datasource] --> click the "Show History" button.
  24. Solr Error Logs

    This datasource monitors the solr logs via an http call to the web front end and parses the json response to output in a LogicMonitor-friendly format. This appears to work on all of the versions of Solr I have tested on (6.0+). *Note - I have disabled the applies-to on this datasource because it can be quite noisy if your logging hasn't been tuned on the Solr nodes. I did include some useful filters to strip out some of the more common noise - but I still recommend applying this with caution. W9PN3Y
  25. Solr 6.6+ JVM

    967XA7 This datasource queries the new Solr metrics API to gather JVM performance data without having to actually enable jmx on the solr node. This will only work on Solr nodes running version 6.6 or higher. Feedback always appreciated.