Forum Discussion

domenicbetters's avatar
2 years ago

Is there a way to set custom property values from your groovy script in your datasource?

Hey there.  I’m relatively new to logic monitor and I received a request from a client.   The request is as follows.   They wanted us to be able to provide not only blocked processes alerts for the...
  • Stuart_Weenig's avatar
    2 years ago

    Ok, well, it can’t be through any of the built in methods since they will only allow you to output numerical data. So, unless you can somehow map the value of “blocker” to a number, your best bet will be to write a block of code that takes the value of “blocker” and either writes it as a property or the instance description or something. We’re back to this. You’ll need to write a block of code to go in the collection script to PATCH each instance with the property/value of “blocker”. 

    LM has pretty good Python and Go SDKs, but they don’t have an SDK for their native Groovy language, so you’ll have to write this all out on your own. Even the examples on their website mostly use Python instead of Groovy to access their own API. (Ug, why isn’t python natively supported in LM yet?) You might put in a ticket to support to see if they have examples in Groovy that they can point you to. I gave up trying to get Groovy to work and most of my custom datasources are written in python.

    I realize this doesn’t help that much, but it’s the direction you’ll probably have to go.