Forum Discussion

Eric_Singer's avatar
8 years ago

API call, get ALL devices

Hi,

I have a teammate working on some API calls to help us manage our environment a bit better.  One thing he noted is that LM doesn't allow us to make a single API call which returns all devices?  Wanted to see if there was a way to accomplish this, or if this is a limitation that's going to be lifted?

Thanks,

Eric

  • Hi Sarah,

    We have the same use case, however, our CMDB is in ServiceNow and the way we would like to meet the use case would be to have  way to provide LogicMonitor with the CI class and a CI fieldname to query, then perform the cross reference and alert if there are any missing CIs from LogicMonitor.  Since all alerts in LogicMonitor are against a device, this task could be assigned to a Collector.

  • Hi Sarah,

    I don't think LM is inherently alone in your thought process. LDAP for example only returns the first 1k results in a search, and both exchange and active directory powershell cmdlets also limit the default results returned.  However, their parameters support a specific number of devices defined by the user or they support an "unlimited" parameter to return all results.  That is what I'd like to see.  Have a default of 300, but make a parameter where I can enter an integer of my choosing or "unlimited" to retrieve all devices.  I as a user would know if I'm saying return all devices that it might take a while.

    The use case is simply for auditing and comparisons.  For example, I want to make sure all servers in my vmware system are monitored, or I want to make sure all systems in my active directory are monitored.  The only other way to do that is loop through an array of devices and make individual queries, as opposed to comparing to arrays.

    We have found a way to work around, seems you guys support a device count and you support an index location.  So we've kind of kludged together a work around, but its not ideal.

  • Sarah_Terry's avatar
    Sarah_Terry
    Icon for Product Manager rankProduct Manager

    Hi Eric,

    The limit for devices per request is 300, but you can make multiple requests to get more than that.  This limit is intended to balance ease of use and application performance -you don't want to have to make 10k, 25k, or 50k requests, but you also don't want to have to wait for an extended response for a request for 50k devices.  It depends on how many devices you have, but I do recognize that a limit of 300 might seem a bit low if you have thousands of devices.  While we don't have any immediate plans to change this limit, if you can provide us with more detail about your specific use case we can consider adding an increase to the roadmap.  We can also add an example script to our API documentation for this case.

    I'll additionally note that we are working on an SDK for our REST API, which will ideally make this easier - we will definitely consider adding the ability to get all devices.

    Thanks,

    Sarah