Forum Discussion

sinewave's avatar
4 years ago

different payloads for datasource in same resource

Hello, I have a script I run against multiple resources (virtual servers and servers), but that script can take multiple payloads to monitor different things against the same resource. I created a datasource with the script, but when I apply it to a resource, I'm unable to use different payloads as the custom property I create for that resource only has one value. Is there a different way to approach this problem that would allow me to run this script against a resource with different payloads? Or do I need to create a datasource for each payload and assign specific property name/values for each instance?

 

5 Replies

  • Anonymous's avatar
    Anonymous

    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

     

  • Interesting. I'm pretty new at LM and wasn't able to follow that explanation, but found success in creating a datapoint for each payload and creating property/values for each payload on each host. It seems to work. Not sure if it's the most elegant solution, but I'm getting results :)/emoticons/smile@2x.png 2x" title=":)" width="20" />

  • Anonymous's avatar
    Anonymous

    Of course, if you're getting results, that's good. I think it would be to your advantage to try for some of that "elegance". If you want to leave it alone, just let me know and I'll drop it. 

    Otherwise, let's talk about what data you're gathering and how we might make things easier for you in the long run. Generally, what do the different payloads represent? Different functions on the target device? Different micro-services? Different hardware components? Multiple instances of the same thing, just with different names/purposes/responses? The answers to these questions will help drive toward which elegance, if any, we can build into your solution.

    Either way, it might help you to take a look at our eLearning around building DataSources. Getting to the eLearning requires that you first log into your LM portal and click the training link to establish your session. Then the link should work.

  • I'm sending a soap request to both servers and f5 vips to collect response times for fulfilling the request. The soap request are slightly different for each instance. I've defined the property and value with a unique name in each resource and that seems to be working.

  • Anonymous's avatar
    Anonymous

    Ah, ok. So the main thing you want to track is not necessarily the content of the response, but the actual response time. Cool. Might be more elegant to even use internal website checks instead, but that's a bigger leap.

    So, do you have the servers and the VIPs in LM as distinct devices?  Sounds like one payload with multiple destinations.  Is that the case or is it multiple payloads to each of multiple destinations?