Forum Discussion

David_Bond's avatar
2 years ago
Solved

Complex Groovy DataPoint access to Script/Batchscript output

I need access to Script/Batchscript output in a Complex Groovy DataPoint.

This is a rather fundamental omission.

It should be trivial to permit the output[“datapoint”] approach supported for other collection types.

Make it so!

8 Replies

  • I need to add a complex datapoint to SNMP_Network_Interfaces, but don’t want to mess with the Collection Script.

  • I need to add a complex datapoint to SNMP_Network_Interfaces, but don’t want to mess with the Collection Script.

    That I totally understand not wanting to touch that script. That script is overly complex. That makes it worth it to me to request it too.

  • mray's avatar
    mray
    Icon for LM Conqueror rankLM Conqueror

    Yeah I think Stuart is on the right track as to speculating why this was never implemented. But this is probably the only use case I can definitely understand.

    Can the Complex Datapoint work with an expression instead of a script? https://www.logicmonitor.com/support/logicmodules/datasources/datapoints/complex-datapoints

    These are pretty powerful, but the functional syntax make really complicated expressions sort of difficult to construct and understand.

  • I think the reason they did that is that they couldn’t think of a use case where you’d want to do scripting in the collection and also scripting in a datapoint. My guess is they thought you’d just do all the scripting together in the collection script. 

    What is your use case? Using one language for collection and you want to use Groovy for something else?

  • @Michael Raymond,

    The Complex Datapoint cannot access Custom/Instance-Level Properties, so no.

  • @Michael Raymond.

    I need the following to work, and you’re right, it doesn’t if you try to save it using the UI:

    if(ne("##interface.type##", "radioMAC") && gt(InDiscards,50) && gt(InTotalPkts,0), (InDiscards/InTotalPkts)*100, 0)

    However, this just seems to be policed with Javascript on the front end.  I’ll try to change it via the API instead.

  • mray's avatar
    mray
    Icon for LM Conqueror rankLM Conqueror

    I haven’t tested via the API. There may still be some backend code that prevents this from working. I’m curious to know how that goes!