How to create chart node for each item in array?

I have a comma delimited string of device names, I split this, loop per payload defined on split, this works great. In the split loop, if you will, I ping each device, report ping result to debug, send email if failed ping, all good so far.

Now, for the question in the topic title, I want to create a chart for each ping result per device, i.e. a chart per device. If I add a chart node, in the split loop, the same existing chart object is used over and over. Not what I want. I want to create a unique chart option per item in the array as noted above.

I can't seem to find a qualified example of this or similar via google?

You either need to create a chart per device. Or you could use a single bar chart and ensure each device reports on a different topic

Or I guess write a complex function that basically creates a way to create a chart per device. I was afraid I already knew the answer to my question. For the sake of completeness, what I did was create switch node, that tests for the host name (from the ping node output), and sends ping return value to the appropriate chart. Anyone that knows what a case or switch statement is in C or Visual Basic .NET will understand how this works. It is not elegant, but easy to understand. Just have to remember is I change the device list, I have to change the list of chart nodes, add or remove as needed.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.