Thursday, December 19, 2024

Premises vs. Premise

  • One theory or idea is a premise.
  • Two or more theories or ideas are premises.
  • Premises is also a plural noun referring to a piece of land with a set of buildings.

Thursday, December 12, 2024

Using Python Virtual Environments

tl;dr:

Setup:

mkdir my-new-project
cd my-new-project
python -m venv env

Linux Usage:

source env/bin/activate

Powershell Usage:

./env/Scripts/Activate.ps1

Either usage

pip install requests # and anything else you need

Exit

deactivate

Friday, December 6, 2024

Accessing LM with a bearer token through Postman

I'm a day late on this one, but at least it's good info:

Original content is here for now.
  1. Download and install Postman, or use http://postman.com
  2. Launch Postman and create a new collection that will be used for all LogicMonitor API requests:
    1. In Postman, click Import and paste https://www.logicmonitor.com/swagger-ui-master/api-v3/dist/swagger.json. This should start the import process. 
    2. Before clicking the import button, click the gear to view import settings. 
    3. Make sure "Always inherit authentication" is checked on.
  3. Configure Authentication:
    1. Go to the collection root and select the auth tab.
    2. Change the auth type to "Bearer Token" and put {{bearer}} as the token.
    3. Go to the scripts tab and add this to the pre-request script:
      pm.request.headers.add({key: 'X-Version', value: '3'})
    4. Save the collection.
  4. Create a new environment with the following variables. You just need one for the bearer token. You should set the type to 'secret' for sensitive credentials.
    1. url – https://<portalname>.logicmonitor.com/santaba/rest
      1. If you want to work with the LM Ingestion API, duplicate this environment and change the url to 'https://<portalname>.logicmonitor.com/rest' (without "santaba")
    2. bearer – secret – For the current value, be sure to prepend the token with "bearer " (with space)
And that should do it. You should be able to open any request already defined in the collection you imported and run it.