Forum Discussion
Sounds like what you want is a multi-instance datasource. Each instance would represent a different payload you want your script to process. As long as the result is a similar datapoint across all the instances, then you should be good. For example, if one payload causes the CPU utilization to be returned and another payload causes disk status to be returned, you'd likely want different DataSources. This is because within a single datasource, the output should be mapped to the same set of datapoints for each instance. You wouldn't want one instance to populate the cpu_util datapoint and not populate the disk_status datapoint, while another populates disk_status and not cpu_utilization.
If you have your payloads in a property already (separated by some special character, i'd guess), then you should be able to easily add the instance display names and have the instances auto created through a discovery script that looks like this:
instances = hostProps.get("payloads").tokenize("|") instances.each{ instance = it.tokenize(",") println("${it[0]}##${it.[1]}") } return 0
Related Content
- 5 months ago
- 5 months ago