Forum Discussion

Mark_Hensler's avatar
2 years ago

DataSource recording zeroes for non-zero raw responses

I wrote a DataSource that is exhibiting a weird problem. Most of the data points are recording zeroes, but when I click "Poll Now", I see non-zero values in the Raw Response. The DataSource uses multi-line key=value pairs.

I'm not sure how to troubleshoot this. Has anyone seen this before?

Here is a screenshot to illustrate my issue:

  • Gauge worked:

    This still doesn’t feel right. I’m only considering adding alerts to the ike_session_state and/or tunnel_status.

    However, it seems like a plausible use-case for someone to desire to place thresholds for other fields. If these fields are gauge, how would you craft a threshold for anything?

  • Anonymous's avatar
    Anonymous

    I’m currently polling every 15 minutes. Could the issue be that I need a more frequent polling period?

    No, the poll rate shouldn’t matter. Especially if the datapoint type should be a gauge. Just try it out and see if you get what you are expecting. If you do, then you know you’ve got it setup right.

  • Ajay's avatar
    Ajay
    Icon for LM Champion rankLM Champion

    Still think you should try Gauge. If the result of the raw data is what you expect to see in the poll, then you should use gauge.

  • I’m currently polling every 15 minutes. Could the issue be that I need a more frequent polling period?

  • Anonymous's avatar
    Anonymous

    Ok, cool. Script it is then. That should be fine.

    Regardless of whether the documentation gives a timeframe, gauge might be the right thing to do. Derive and counter both take the delta from the previous poll and divide by the expected poll rate between them. If the result of your poll is 5960 and that’s the number you’re expecting to see, then you should use gauge. Counter would take 5960 from the current poll, and 5960 from the previous poll and find the delta (0). Then it would divide that delta by the poll rate between them, which would still give you 0. 

    tl;dr only use counter/derive if you know the metric you are reading is actually a counter (like an odometer).

  • I have not tried gauge. It doesn’t make sense to me to use gauge to count bytes across an interface. The API does not indicate that there is a time frame for a polling period (i.e. bytes in last 60 seconds).

    vdc-repo.vmware.com/vmwb-repository/dcr-public/612caf56-5bb1-4a0b-8d2b-12ccd8981904/37be75ba-aa56-42f4-99c3-f6c989ddbe57/api_includes/types_IpSecVpnTunnelTrafficStatistics.html

    The datasource is of type “script”. There too many VPN tunnels and “batchscript” times out.

  • Anonymous's avatar
    Anonymous

    This is a multi-instance DS. Is it using script or batchscript mode? What does your datapoint definition look like?