What I need to do, to the alert shows only 2 decimal places.
For example:
Variable: Statistic data: ${StatisticData}
Result: Statistic data: 5,84696769714355
I need that show only 2 decimal places
What I need to do, to the alert shows only 2 decimal places.
For example:
Variable: Statistic data: ${StatisticData}
Result: Statistic data: 5,84696769714355
I need that show only 2 decimal places
Check out this page. HTH
http://www.solarwinds.com/documentation/en/flarehelp/sam/default.htm#OrionAPMPHFormulaExamples.htm
Specifically this:
Truncate | Truncate({value},{number of decimal places}) | Truncates a monitored value to a designated number of decimal places. |
I think this is what you're after:
Truncate(${StatisticData}, 2)
Thanks for the answer dear
Let me explain better... I'm using the Advanced Alert Manager, when I set the Trigger Action
NetPerMon Event Log: Statistic Data: ${StatisticData} it shows Statistic data: 5,84696769714355
What I need put on the place of ${StatisticData} to show just 2 decimal places? (the complete Syntax for Advanced Alert Manager)
I try to replace with Truncate(${StatisticData}, 2), but dont worked
Sorry, I was mistaken, HERE's the page I was looking for:
http://www.solarwinds.com/documentation/en/flarehelp/sam/default.htm#OrionAPMAGConversionValue.htm
This might clear things up. For a script monitor, you can enter the formula I mentioned earlier so the output can be truncated to 2 decimal places. Hope this is what you're looking for.
In this example I used the variable ${StatisticData} to explain
${SQL: Select CAST (${StatisticData} AS Decimal(18,2))} % (for numeric)
(18,2) = number of places before and after the comma
or
${SQL:Select Substring ('${StatisticData}',1,4) AS StatisticData} % (for a string)
('${StatisticData}',1,4) = selects a substring, in this case from first to fourth character, with the comma
Did you ever figure out how to make the decimal show? The Truncate(${Statistic},1) does not work. We tried it several different ways, to no avail.
Hello,
I use this way:
${SQL: Select CAST (${StatisticData} AS Decimal(18,2))} % (for numeric)
(18,2) = number of places before and after the comma
or
${SQL:Select Substring ('${StatisticData}',1,4) AS StatisticData} % (for a string)
('${StatisticData}',1,4) = selects a substring, in this case from first to fourth character, with the comma
This will work for a message in Advanced Alert Manger.
Hi,
I tried following html format but i got following message.
<font size="4" face="Verdana"><u><b>Storage Details:</b></u></font>
Storage Manufacturer = <b>${N=SwisEntity;M=Manufacturer}</b>
Storage Status = <b>${N=SwisEntity;M=OperStatusDescription}</b>
Storage Model = <b>${N=SwisEntity;M=Model}</b>
Storage Name = <b>${N=SwisEntity;M=Name}</b>
IOPS Value = <b>${N=SwisEntity;M=IOPSTotalThreshold.CurrentValue}</b>
Throughput Value = <b>Truncate(${N=SwisEntity;M=BytesPSTotalThreshold.CurrentValue},2)</b>
Throughput Value = <b>${N=SwisEntity;M=BytesPSTotalThreshold.CurrentValue}</b>
Throughput Value = <b>${SQL: Select CAST (${N=SwisEntity;M=BytesPSTotalThreshold.CurrentValue} AS Decimal(18,2))}</b>
Throughput Value = <b>${SQL:Select Substring ('${N=SwisEntity;M=BytesPSTotalThreshold.CurrentValue}',1,4) AS StatisticData} %</b>
**************************************************************************************************************************************************************
Message Detail;
Storage Manufacturer = EMC Corporation
Storage Status = Error
Storage Model = DMX4-24
Storage Name = 000290103038
IOPS Value = 72.8887405395508
Throughput Value = Truncate(538749.8125,2)
Throughput Value = 538749.8125
Throughput Value = ${SQL: Select CAST (538749.8125}
Throughput Value = ${SQL:Select Substring ('538749.8125',1,4)} %
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.