RPC API: Get the datasource instances for a Device

Note that LogicMonitor does have an available REST API equivalent for this API call.

LogicMonitor’s RPC API enables you to get the datasource instances for a particular device with getDataSourceInstances.

Note: As with all our APIs, authentication is required.






Request Parameters: You can include the following as query parameters in a getDataSourceInstances request:




hostId Integer Required if hostDisplayedAs is not given. The unique Id of the Host

To get a hostId in the UI: navigate to the device & select the focus icon – the id is in the URL as d-##.

hostDisplayedAs String Required if hostId is not given. The unique display name of the Host
dataSource  String Required. The Name (not the Display Name) of the datasource


All outputs will be in the format: { [status], [data], [errmsg] }, where status is the status of the response, errmsg is the error message associated with the response, and the data object includes an object for each instance, where the following data is included in each object instance:



dataSourceDisplayedAs The display name of the datasource
enabled whether the instance is currently enabled
hasUnConfirmedAlert whether the instance has any alerts currently active and unconfirmed
hasAlert whether the instance currently has any active alerts
hostId the ID of the host the instance is associated with
wildalias the displayed name of the instance
dataSourceId unique identifier of the datasource
id unique identifier of this specific instance
alertEnable whether alert evaluation is enabled on this instance
description The assigned or discovered instance description
name Complete name of the instance
wildvalue2 if two-dimensional Active Discovery was used, this will contain the second wild value (identifier used to collect the data)
wildvalue the identifier used to collect data about this instance (e.g. SNMP OID instance number)




curl "https://apiAccount.logicmonitor.com/santaba/rpc/getDataSourceInstances?c=apiAccount&u=apiUser&p=example&hostId=186&dataSource=AWS_EC2"


  "status": 200,
  "data": [{
    "enabled": true,
    "hasUnConfirmedAlert": false,
    "hasAlert": false,
    "hostId": 186,
    "wildalias": "",
    "discoveryInstanceId": 1997,
    "dataSourceId": 678,
    "id": 1989,
    "alertEnable": true,
    "present": true,
    "description": "",
    "name": "AWS_EC2",
    "wildvalue2": "",
    "hostDataSourceId": 4828,
    "wildvalue": "",
    "hasGraph": false,
    "dataSourceDisplayedAs": "EC2"
  "errmsg": "OK"

In this Article: