Forum Discussion
Because with batchscript, the script runs for all instances. Which instance's wildvalue did you expect back? You can only do instanceProps.get("wildvalue") on script, not batchscript.
I believe there is a way to grab from the deviceDatasourceProps the list of wildvalues, but i haven't been able to relocate the code where i saw that done.
It would be nice if someone from LM who knew how to do it chimed in here. Maybe someone from the ME team...
- skylaurman6 months ago
Employee
Here is a way to get a list of the wild values:
def listOfWildValues = datasourceinstanceProps.values().collect { it.wildvalue }
Here is a way to do as you wish with the wild values:
datasourceinstanceProps.each { instance, instanceProperties -> instanceProperties.each { it -> def wildValue = it.wildValue // Do something with wild value } }
- Anonymous6 months ago
This is the right answer. Could someone at LM please put in a DOC ticket to get this published into the support documentation or the dev guide?
- skylaurman5 months ago
Employee
Documentation has been updated to include examples: https://www.logicmonitor.com/support/logicmodules/datasources/data-collection-methods/batchscript-data-collection
- manthena20206 months ago
Advisor
To test this . I Have Executed against my server. Iam not getting any output .sample print test on collection script
- manthena20206 months ago
Advisor
My Active Discovery Print statement: println("${a}##${aa}######instance=${instanceName}")
Related Content
- 2 years ago
- 2 years ago
- 5 months ago
- 10 months ago
- 2 years ago