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!
David Bond
Posted 3 years ago·Last reply 3 years ago
8 comments
Michael Raymond
·3 years agoI 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!
David Bond
OP3 years ago@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.
Michael Raymond
·3 years ago@David Bond Well sort of. You certainly can access custom props and ILPs within Complex Datapoints, but only if they are integer values.
So you can’t do this:
But you can pull number values and use those just fine.
https://www.logicmonitor.com/support/logicmodules/datasources/datapoints/complex-datapoints#standard
Sandbox test:
David Bond
OP3 years ago@Michael Raymond,
The Complex Datapoint cannot access Custom/Instance-Level Properties, so no.
Michael Raymond
·3 years agoYeah 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.
LM User
·3 years agoI 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.
David Bond
OP3 years agoI need to add a complex datapoint to SNMP_Network_Interfaces, but don’t want to mess with the Collection Script.
LM User
·3 years agoI 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?