LogicMonitor.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.66Views17likes4CommentsAccessing 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.4KViews42likes42CommentsProvisioning 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 time66Views14likes2CommentsWebsite 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' }57Views1like3CommentsTesla 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 lmLocatorHHJRD82Views12likes5CommentsTesla 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:30Views5likes1CommentAPI 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?Solved167Views9likes9CommentsUsing 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.Solved525Views12likes40CommentsHow to set up Splunk with multiple IIQ SailPoint environments with Splunk
Observing the code in the Python scripts, it appears that Splunk does not support multiple environments (s), despite what the Splunk documentation on this website claims. Version of SailPoint IIQ: 8.1p3 Version of Splunk: 8.0.9; Version of TA: 2.0.5 Upon examining the Python code known as the Splunk Plugin, which allows Splunk to read data from SailPoint, I discovered the following details: The plugin directory is Splunk/etc/apps/Splunk_TA_sailpoint, from which the plugin gets its files. The file that drew my attention was Splunk/etc/apps/Splunk_TA_sailpoint/bin/input_module_sailpoint_identityiq_auditevents.py.11Views6likes0CommentsHow to set up Splunk with multiple IIQ SailPoint environments with Splunk TA configuration using: SailPoint Adaptive Response
I noticed that the Splunk documentation on this site says that this should support multiple environments (s) - looking at the code in the python scripts though it looks like it doesn't? SailPoint IIQ version: 8.1p3 Splunk version: 8.0.9 TA version: 2.0.5 After reviewing the Splunk Plugin code (the Python code which Splunk uses to read data from SailPoint), I noticed the following bits of information: Splunk/etc/apps/Splunk_TA_sailpoint is the plugin directory where the plugin derives its files. Splunk/etc/apps/Splunk_TA_sailpoint/bin/input_module_sailpoint_identityiq_auditevents.py – this is the file in question that caught my attention.19Views5likes0Comments