"instanceProps.get()" only works on script because in batch mode, which instance's props would be fetched.
That DS "cheats" a little to get the instance props by using this function to grab the props:
/*******************************************************************************
* © 2007-2020 - LogicMonitor, Inc. All rights reserved.
******************************************************************************/
/**
* Capture instance props for the interface.
* @param hostName
* @param dsName
* @return instanceProps
*/
static def getInstanceProps(hostName, dsName) {
def instanceProps = [:]
CollectorDb.getInstance().hostEntries.each { device ->
if (device.getHostName() == hostName) {
device.getDataSourceInstances().each { instance ->
if (instance.getName().startsWith(dsName + "-")) {
def props = [:]
instance.properties.each { k, v ->
props[k] = v
}
instanceProps[instance.wildValue] = props
}
}
}
}
return instanceProps
}