-
Re: SNMP String to Float
thyrsus Nov 7, 2014 12:21 PM (in response to thyrsus)Looking closer, the parse() function takes a string, but then it appears to return a string. Am I wrong? Is there a different document I should look at? E.g., something describing just how much C# I can stuff into the parse() arguments (I'll learn C# if I have to)? Something that would describe how to store the result in the database as a float? Or is best practice to scale the value into an integer?
-
Re: SNMP String to Float
thyrsus Nov 13, 2014 1:46 PM (in response to thyrsus)To this point, I've been using the web console to create the poller; it appears there may be more options available in the native application Universal Device Poller creation; I'll update once I get access to that.
-
Re: SNMP String to Float
thyrsus Nov 19, 2014 4:01 PM (in response to thyrsus)The "Universal Device Poller" program on the SolarWinds server did not provide any further alternatives. I've also found a thread UnDP: Parsing Substrings? indicating that the *only* valid parse function is "(?<result>\d+)" (the variable "result" may differ) and that it must therefore process an integer. That doesn't get me to a float. It means, even assuming the SNMP string value *always* started with "0.", I wouldn't be able to distinguish "0.003" from "0.00003".
-
Re: SNMP String to Float
thyrsus Dec 18, 2014 2:22 PM (in response to thyrsus)I think I'm getting closer: after studying the SolarWinds Lab video #7, one can transform the result of a Universal Device Poller using SQL, so when my SNMP poller delivers a string like "-0.000000039 s", I can do something like
${SQL:select cast(substring(CustomPollerStatus.Status, 1, length(CustomPollerStatus.Status) - 2) as float) as result from (CustomPollerStatus inner join CustomPollerAssignmentView on (CustomPollerStatus.CustomPollerAssignmentID = CustomPollerAssignmentView.CustomPollerAssignmentID)) where CustomPollerAssignmentView.AssignmentName like 'cntpOffsetToCDMAReference on %' and NodeID = 1942)} + (0*{cntpStratum})
Right now, what I'm having two problems: although the above syntax works in Microsoft SQL Server Management Studio, whenever I include the function "substring(...)" in the ${SQL: ...} contents, the transform comes back as Error. I'm pretty baffled at that.
Second, I don't know how to substitute into the transform SQL query string the value for NodeID. My attempt to use "NodeID = {NodeID}" just came back as an unspecified error.
-
Re: SNMP String to Float
thyrsus Dec 19, 2014 11:39 AM (in response to thyrsus)I am well and truly baffled by my inability to use SQL string functions. I can replace "cast(substring(CustomPollerStatus.Status, 1, length(CustomPollerStatus.Status) - 2) as float)" with "count(CustomPollerStatus.Status)" and it works, but if I try to do "count(replace(CustomPollerStatus.Status, ' s', ''))" - which, like all the variants mentioned, works just fine in Microsoft SQL Server Manager Studio - in UnDP Transform, I get an unspecified "Error".
-
-
-
-