Forum Discussion
I've had a couple of stabs at doing exactly this recently.
I ended up actually doing it outside of LogicMonitor, with a script that runs each night to query the LM API for Cisco devices, then push that info back into properties on each device in the LM API.
I did also do something similar as a Property Source, but felt it was quite inefficient as it would have to query the API individually for each device. Although maybe this is a good use case for using collector cache.
I might be able to share something. What are you after? Properties with the info on a device? Or a datasource to alert on something?
- Barb4 months ago
Advisor
Thanks Dave :) I am going to write a property source to get the info on each device. Just getting the right access to the cisco apix was quite the task :)
But finally i have developer enabled.
I can get the info in postman and python now just need the time to translate that to Groovy.
- Dave_Lee4 months ago
Advisor
I found the groovy code I used for this. I've not used it for a while as I went another route, but I just tested it and it will work. I've published it as a gist in case it's of any use to you.
https://gist.github.com/davelee212/a3db0add871d9c0fe06fca7bc914ca0e
- Dave_Lee4 months ago
Advisor
Oh and I agree... it was just as difficult to get access as it was to write the code 🤣
- Cole_McDonald3 months ago
Professor
I usually have a single collector that I have access to on which I increase the timeout for scripts... and use it for this type of effort, mostly RestAPI calls to be able to perform more complex jobs. PropSources are also my preferred weapon for these tasks.