Get Devices
You can use LogicMonitor's REST API to programmatically get information about your LogicMonitor devices. With the devices resource, you can:
- Get information about all devices in your LogicMonitor account
- Get information about a specific device in your LogicMonitor account
As with all of our API calls, authentication is required.
Get a list of Devices
Returns a list of devices
Get information about a particular device
Returns details for a particular device
Examples
The following Python examples illustrate retrieving device information in the account api.logicmonitor.com:
- Example Request 1: GET devices
- Example Request 2: GET certain fields for all devices
- Example Request 3: GET one device
- Example Request 4: GET certain fields for one device
- Example Request 5: GET devices that have a specific property value
- Example Request 6: GET all devices
- Example Response
Example Request 1: GET all Devices
The following Python script will return a list of all devices in the api.logicmonitor.com account.
Example Request 2: GET Devices
The following Python script will return a list of devices in api.logicmonitor.com whose display name contains 'ip-172-31':
Example Request 3: GET information for one device
The following Python script will return the details for the device whose id is 39.
Example Request 4: GET information for one device
The following Python script will return the id, displayName, and custom properties for the device with id 39.
Example Request 5: GET devices that have a specific property value
The following Python script will return the id, displayName and custom properties for devices that have a property named snmp.version and a property with value v2c:
Example Request 6: GET all devices
The following Python script will iterate through all devices, 1000 at a time, to return all devices in the account api.logicmonitor.com:
Example Response
The following illustrates an example response for one of the above example requests to the device/devices resource: