To obtain a report from LM of datasources and how many devices are using those datasources.
Do we have a way to obtain a report from LM of datasources and how many devices are using those datasources, like datasources and AppliedTo Combined
Arjuna
Posted 4 years ago·Last reply 4 years ago
9 comments
LM User
·4 years agoAFAIK, this is the most graceful way.
Adam_sims
·4 years ago@Arjuna You might be able to use the module mentioned in this thread
/topic/1581-datasources_list-propertysource/Then you could run an inventory report and add that property to the report.
Hijacking the thread a bit...
@Stuart WeenigDo you have an example on how to access the return headers when using the SDK? I've been tinkering with it and have hit the rate limit a few times but couldn't figure out how to get the headers using the base functions. I ended up calling the subfunctions in each class that returns the tuple object instead of the actual object class, but I feel like there's a better way. For instance, instead of using add_device_group() I used add_device_group_with_http_info() then I could access the headers.
mnagel
·4 years agoI never really think about that since we built in paging support in our module from the beginning. I have seen some of the LM modules also use hardcoded page sizes and it makes me sad. Still waiting for library support within the module system...
LM User
·4 years agohttps://www.logicmonitor.com/swagger-ui-master/dist/
https://www.logicmonitor.com/support/rest-api-developers-guide/overview/using-logicmonitors-rest-api
There's also a course in the training portal about the API: https://logicmonitor.skilljar.com/api-course. (You need to already have an active session in Skilljar for this link to take you directly there. To get an active session, log into your portal and click the "Training" link in the top right corner. Then the link will work.)
Arjuna
OP4 years agoCan you please direct me to helpful API document and Articles!
LM User
·4 years agoThis would need logic to handle portals with more than 1000 devices in it since the first api call only gets the first 1000 devices. The subsequent calls would also need to take into consideration rate limiting and probably introduce some throttling.
LM User
·4 years agoJust realized i left an errant print statement in there. Fixed.
LM User
·4 years agoSame. Although I used the SDK (references my custom lm library)
mnagel
·4 years agoI would use the API to walk the list of devices, then scan devicedatasources for each device and tabulate the results. AFAIK there is no builtin report for this.