REST Query no results
Hello, I'm trying to do a simple query the rest service with a filter of system.hoststatus = normal using the following parameter: systemProperties:"{'name':'system.hoststatus','value':'normal'}" so my entire post string looks like this: https://me.logicmonitor.com/santaba/rest/device/devices?filter=systemProperties:"{'name':'system.hoststatus','value':'normal'}" I'm getting a response, but its always empty: { "status" : 200, "errmsg" : "OK", "data" : { "total" : 0, "items" : [ ], "searchId" : null, "isMin" : false } } Am I fundamentally mis-understanding the syntax for the query? Thanks!55Views1like7CommentsUpdates for LogicMonitor REST API v1, v2, and v3
Hello LM Community! It’s been a little while since we last shared an update on LogicMonitor API, so we wanted to touch base, and provide you with the latest news. To catch you up to speed, in 2022, LogicMonitor began supporting LogicMonitor REST API version 3 (also known as API v3). Our goal has always been to improve our API experience. Since v3’s introduction in 2022, enhancements and fixes have solely been made to API v3 (not v1 and v2). During planning for the sunsetting of LogicMonitor REST API v1 and v2, we have had many discussions with our customers in order to better understand the various scenarios and challenges that might be faced throughout that sunsetting process. While we continue to encourage all of our customers to migrate to the upgraded API v3, we are temporarily pausing on the actual sunsetting of API v1 and v2. We will keep you updated on those sunsetting plans as they are finalized. Please continue to plan your migrations to API v3, and below you’ll find just a few of the reasons (benefits) for doing so: API v3 is an upgraded version of API v2, and it has all of the latest features and patches Any future enhancements and defect fixes will only be completed for API v3 API v3 has in-depth support documentation for you to reference For more information on LogicMonitor REST API v3, please refer to the below documentation: Using LogicMonitor’s REST API LogicMonitor REST API v3 Swagger Documentation LogicMonitor v3 SDKs Best Practices for Migrating to LogicMonitor v3 SDK LogicMonitor REST API v3 Basic filters LogicMonitor REST API v3 Advanced filters Bearer Token If you have any questions, please contact our Technical Support Team.285Views7likes0CommentsLogicMonitor.Api C# API nuget 1.191 Released
All that strongly-typed goodness can be found in the usual place: Web:https://www.nuget.org/packages/LogicMonitor.Api/ Visual Studio / VS Code: manage nuget packages for your project/solution and search for "LogicMonitor" Adding LogicMonitor.Api to your project It's THIS easy to print an inventory of all regular Resources (paging is handled automatically): Taking inventory in 25 lines or fewer We will answer your questions on this forum! Please include the word "C#" or "nuget" in your subject line.68Views17likes4CommentsAccessing the LogicMonitor REST API with Postman and LMv1 API Token Authentication
Introduction Postmanis 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'spre-request script functionalityprovides 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 installPostman. 2. Launch Postman andcreate a new collectionthat 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 variablesvar api_id = pm.environment.get('api_id');var api_key = pm.environment.get('api_key'); // Get the HTTP method from the requestvar http_verb = request.method; // Extract the resource path from the request URLvar resource_path = request.url.replace(/(^{{url}})([^\?]+)(\?.*)?/, '$2'); // Get the current time in epoch formatvar epoch = (new Date()).getTime(); // If the request includes a payload, included it in the request variablesvar 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 headervar signature = btoa(CryptoJS.HmacSHA256(request_vars,api_key).toString());var auth = "LMv1 " + api_id + ":" + signature + ":" + epoch; // Write the Auth header to the environment variablepm.environment.set('auth', auth); 4. Create anew 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 arequestand 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.3.7KViews43likes42CommentsProvisioning LDAP Application in Sailpoint IIQ
I am new to Sailpoint. I have onboarded LDAP Application, aggregated and next I want to provision a delimited file data to LDAP application. I followed the step this way --> Manage User --> Selected User --> Manage Access --> filter --> Entitlement Application --> LDAP --> Selected and proceeded further. And I get the error every time77Views14likes2CommentsWebsite Downtimes via API
Hi I'd like to use the API to gather information about the availability of my websites. I will have to gather data for monthly and yearly SLA calculation which features the exact downtimes of the website. With these requirements, I don't think the graph data can deliver accurate data enough. So I'm looking into the /website/websites/{webservice_id}/checkpoints/{checkpoint_id}/data API. Getting Data | LogicMonitor The API works fine, but obviously getting all the statuscodes for every check (every minute) for a whole Month, or even year takes a long time and produces a lot of data that I have to crunch. For me, it would be sufficient to get only the data for downtimes, so every status report which is not 1.0. Does anyone know if the API has such a feature? I already ask for only the datapoints, but this would need some additional filtering. params = {'start': start, 'end': end, 'format': 'json', 'datapoints': 'overallStatus' }59Views1like3CommentsTesla Motors LogicModule Suite
I previously published a datasource for Tesla Motors Battery Statistics - which presents compelling vehicle battery and charging information that is fetched from the Tesla REST API. To complement those efforts, I've written a few other Tesla Motors LogicModules that return a variety of different, but still interesting, datapoints - including a ConfigSource that displays configuration information about the vehicle itself (are the doors locked? Is the sunroof open?) The following is a list of all the Tesla Motors LogicModules now available (see the above-linked post for additional info on how this all works.) DataSource 'Battery Statistics' tracks battery and charger performance and health metrics Tesla Motors Battery Statisticspreviously posted to the Exchange but included here for sake of keeping everything together.) The datasource name isTeslaMotors_BatteryStatisticsand has lmLocatorDXLLKY. DataSource 'Climate Statistics' tracks inside and outside temperatures, as well as driver and passenger temperature settings. The datasource name isTeslaMotors_ClimateStatisticsand has lmLocatorYZRWXC. ConfigSource 'Car Configuration' collects textual configuration data, cleans it up and makes it easily readable (screenshot attached.) The configsource name isTeslaMotors_Configurationand has lmLocatorGRY9AE. DataSource 'Location Data' tracks compass heading, latitude and longitude, and power. The datasource name isTeslaMotors_LocationDataand has lmLocatorAYWYWA. DataSource 'Odometer Reading' does exactly what you might expect. The datasource name isTeslaMotors_BatteryStatisticsand has lmLocatorHHJRD87Views12likes5CommentsTesla Motors Battery Statistics
UPDATE: Check out the full suite of Tesla LogicModules in a more recent community post - including statistics for battery/ charging, climate, location, odometer, and configuration. Tesla Motors provides owners of their vehicles with a web portal - and an HTTP REST API - that can be used to retrieve vehicle performance and configuration data (in JSON format.) Using the embedded Groovy scripting functionality of a LogicMonitor DataSource, we can query the Tesla API - and bring that data back into LogicMonitor. Once we have the data, we can display it in meaningful ways (a dashboard for our Dashboards,) or perform calculations to create complex datapoints - like tracking "Average Energy Cost per Mile." Assuming that you’re not getting the electricity for free at a Tesla Supercharger station, that is... A little Googling will assist with the API key retrieval - there are a couple of scripts and/ or CURL commands that can be used to facilitate this process. The datasource name is TeslaMotors_BatteryStatistics and has lmLocatorDXLLKY. Screenshot of some included graphs:33Views5likes1CommentAPI Groovy HttpPatch?
Is it possible to do an HttpPatch, or to use the PATCH verb, when updating devices? I looked over on one of the LM pages for updataing devices with the API and as usual, most of the examples were in Python, but PUT did have one Groovy example, but PATCH did not. I’ve seen mention somewhere that at some point PATCH would be supported, wondering if it is or not. I ended up getting my script working with a Get (so I dont lose all my device custom settings etc) and then changing theautoBalancedCollectorGroupId value, and then doing a PUT and it worked, and I didnt lose any of my custom properties. And I have a working filter all set up to run it against a target set of devices. But still, I would rather just patch the fields I want without risk. I’m wondering if thats possible, or if GET/tweak/PUT is still the main go-to?Solved185Views9likes9CommentsUsing Postman to create multiple Websites via API & CSV?
Hi, I’m testing out creating websites (or resources) via the API. I have a standard Post working in Postman just fine. However, when I then try to do the same thing via a CSV file in the Runner section, I’m getting 401 Authorization errors. When I look at the data that’s being sent, it looks the same as what’s sent when I run it manually. Is there something special I need to do when running a Post command via the Runner vs the manual Send command? Thanks.Solved538Views12likes40Comments