Kurt Huffman

LogicMonitor Staff
  • Content Count

    7
  • Joined

  • Last visited

Posts posted by Kurt Huffman

  1. Q and A Transcript

    Q: Can you please describe how a sub-account works?  Our use case is entirely in AWS, and we have our customers set up with their own VPC. If I need to segregate their performance monitoring data is there an option to do so with a sub account? We will also have a collector in each customer VPC to monitor app servers as well as AWS resources like ELB/ALB/NLB and RDS.

    A: Will be answered in followup reply to this post
                
    Q: I am working on figuring out how to move us from the older 'snmp64-If_' datasource to the new, preferred 'SNMP_Netowork_Interfaces'.   Does the interface.description.alert_enable property still operate the same?

    A: Will be answered in followup reply to this post

    Q: Can you give us a walkthrough of LM Logs key features?

    A: LM Logs was the main focus of our virtual LevelUp keynote. Recording and info available here: https://communities.logicmonitor.com/topic/6254-2020-oct-13-virtual-level-up-product-keynote/
    We’ll be doing more training on the technical details of it once the general release happens.

    Q: How do you disable alerts while retaining the collection of data at the various levels,  device, technology, company for example?  I can do it at the device level by toggling the alerting to "off" and enabled to "on", but if I want to do it at the higher levels (technology or company) as there could be 100s of devices.                

    A: Answered at 09:32
                
    Q: Question re: Application performance monitoring…using a Collector to monitor Tomcat webapps, we are seeing great info and data, but wondering if you have some suggested baseline threshold levels we should consider for our alerting? For example - JVM memory pools. Can you suggest thresholds to raise awareness to potential problems?

    A: Answered at 17:36

    Q: Dynamic Thresholds require enterprise plan? We are only on Pro level.

    A: Correct, dynamic thresholds are only available with an Enterprise package. 

    Q: For root cause analysis to work, topology should be fully mapped, correct? In case LM isn't able to map everything on its own, would it be possible in future to manually create uplink/downlinks for topology mapping?

    A: Answered at 27:04

    Q: We have a rich set of Properties across most Resources, and we'd like to be able to filter Reports based on those Properties. Is there any way other than creating lots and lots of Dynamic Groups to do such a thing? (We are reaching a point of Dynamic Group overload because of so many that operate on very specific AppliesTo functions.) It's many of the different types, but primarily Inventory Reports. Exactly - the only other work-around we have is dumping tons of data into CSV and filtering in Google Sheets. We have some folks who can use the API for those things, but that's a minority. Lots of folks really are only comfortable using Reports. All sorts of Properties - OS, memory, disk, apps, etc. - you name it. Also related to that... other than using the API, is there any way to do a Report on what Resources and/or Websites are on a given Collector?

    A: Answered at 39:37

    Q: In a few different previous Office Hours sessions there's been mentions of unsupported API calls that can be exposed by using browser developer tools / site inspection. How often do currently-unsupported API calls get reviewed to be added to the supported list? Also what's the lifecycle of the SDKs? They seem to have not been updated in a while.

    A: Answered at 45:38

    Q: There's a big push towards Observability that was mentioned at the LevelUp and most recently at Splunk .conf20. Can you describe Observability and why LM is a great choice?                

    A: https://www.logicmonitor.com/resource/the-more-you-monitor-what-is-observability

    Q: Have you heard of any issues with the new Slack integration that rolled in v141 or v142? (I forget which)  We have 40+ Slack channel Integrations so we want to make sure any kinks are worked out before we migrate so many.

    A: We are not currently aware of any issues with the new Slack integration. If you run into any issues, please contact technical support for assistance.

    Q: When is integration for MS Teams coming? :)

    A: All we can share at the moment is that this on our Product team's radar, but we cannot provide an ETA.

  2. Thanks for sharing. Your pre-request script looks good. But "[object Object]" in the request variables suggests that there is no data in the body of your request. POST requests require some body data, most often in JSON format.

    Here is example data for a POST to /sdt/sdts taken from https://www.logicmonitor.com/support/rest-api-developers-guide/v1/sdts/add-sdts/:

    {"sdtType":1,"type":"ServiceSDT","serviceId":47,"startDateTime":1469134752000,"endDateTime":1469144995000}

    In Postman, it would look like this:

    postman_body.png.d94e65052f603e36b4b3982ed1a7d4da.png

    Confirm that your request contains properly formatted JSON data in the body. If it does, and you're still getting this error, I'll be happy to take a closer look.

  3. If GET works but POST does not, there may be something wrong with the request variables in the script. Make sure the code in your script generating the request variables (request_vars) matches the code in the example.

    You can add a line to the relevant section of the script to inspect the request variables in the Postman console:

    // 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;
    console.log(request_vars)

    After saving the change to the pre-request script, open the Postman console then send the request.

    request_vars for a GET request is just GET+timestamp+resource_path like this:

    GET1553268441890/device/groups

    request_vars for a POST request must include the body data between the timestamp and the resource path and so should look like this:

    POST1553267947762{"name":"Postman"}/device/groups

    I hope this helps. If not, feel free to share your POST request and I'll be happy to take a look.

  4. LMv1 (token-based) authentication relies on a dynamically generated signature in the Authorization header. Current time is one of the inputs for generating the signature which is why the pre-request script must be run for each request.

    While we recommend using LMv1 authentication due to its greater security, basic authentication (user-password) is supported for v1 of our API and is easily implemented when dynamic generation of the Authorization header is not possible. You can find more information about authenticating with our API here: Using LogicMonitor's REST API

  5. 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. 1. Download and install Postman.
       
    2. 2. Launch Postman and create a new collection that will be used for all LogicMonitor API requests.
       
    3. 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.

    postman_manage_enviroment.png.22308ab1f541cb4e67638269f16af79f.png

    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.      1. Set the environment for the request,
        2.      2. Set the HTTP method for the request.
        3.      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.      4. Add the Authorization header and set the value to {{auth}} to pull the the value from the environment variable.
        5.      5. POST, PUT, and PATCH requests only: if your request includes JSON data, be sure to select the Body tab and add it.

    postman_request.png.99c498cad6947e23d15b27032aa5badd.png

     

    6. Press Send to send the request. The response will appear below the request in Postman.

    postman_response.png.34f41380ab54db71c39970488f12bd17.png

     

    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.