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:

Mark_Hensler
Posted 3 years ago·Last reply 3 years ago
18 comments
Unavailable member
·3 years agoI had to use the embed feature to get it to move. I checked their support site and this is apparently functioning as designed, but many others are saying that it works “sometimes”. I used the embed on this one.
https://giphy.com/gifs/nbc-Ie2uEsMmLfZociAbw0?utm_source=media-link&utm_medium=landing&utm_campaign=Media%20Links&utm_term=LM User
·3 years agoWhen you copied, it didn’t get the gif unless there’s something i have to do to get it to move.
Unavailable member
·3 years agoI just copied the image above and pasted it here, or below I used the Embed Media, I noticed that if you try to right click and copy the image address it does not seem to like that, so I had to open the image in a browser and copy the URL. I’ll ask their support community what the issue is with that!
https://giphy.com/gifs/M150USA-yes-yesssss-it-is-IG96zGc6JIoBGBpEI6LM User
·3 years agoI’m sourcing via API
I’d be surprised if the API is giving you a counter. Most don’t do that. You typically only see them in SNMP mibs these days. They don’t make computer scientists like they used to.
LM User
·3 years agoDang it. @A11ey , please allow giphy.com as a domain so we can insert gifs.
Mark_Hensler
OP3 years agoI’m sourcing via API
LM User
·3 years agohttps://media.giphy.com/media/Ie2uEsMmLfZociAbw0/giphy.gif
Mark_Hensler
OP3 years agoOooh. Parallel datapoints is a great idea!
LM User
·3 years agoFWIW: counter/derive datapoints will never show up right in a poll now because they don’t have the previous polls’ data and the time between it and a non-existent poll is non-existent. You might setup parallel datapoints that are counter with the same source and watch it over time to see what you get and which one makes more sense.
LM User
·3 years agoIf you set them as gauge and you are getting the number you expect in the unit you expect, you’d just set a threshold for that number.
LM is only as good as the underlying data that is provided to it. I’d dig deeper into the documentation to see if the bytes are actually counters or if they’re defined as integers with a unit of time associated with it.
Are you sourcing from SNMP or an API or something else?
Mark_Hensler
OP3 years agoGauge 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?
LM User
·3 years agoI’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 Chacko
·3 years agoStill 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.
Mark_Hensler
OP3 years agoI’m currently polling every 15 minutes. Could the issue be that I need a more frequent polling period?
LM User
·3 years agoOk, 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).
Mark_Hensler
OP3 years agoI 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.
LM User
·3 years agoThis is a multi-instance DS. Is it using script or batchscript mode? What does your datapoint definition look like?
Ajay Chacko
·3 years agoHi Mark,
You probably need to use metric type Gauge instead of Derive. Have you tried that ?
Doc: https://www.logicmonitor.com/support/logicmodules/datasources/datapoints/normal-datapoints