19 Replies Latest reply on Apr 27, 2018 12:58 PM by micahcox

    customizing numeric format in alerts

    akhasheni

      An old style ${VolumePercentUsed} variable has a two-digit precision while the new ${N=SwisEntity;M=VolumePercentUsed} - six-digit.

      Screen Shot 2015-06-02 at 11.37.15 PM.png

      Don't see a "format output" option in alert configuration either.

       

      Not sure why there are two variables for the same value - but assume that the old style will eventually go away, as these old-style variables aren't listed in "select variable" tables.

       

      Is there a way to format the output of those newer-style variables to a two-digit precision, e.g. "15.18%" ?

       

      Thanks!

        • Re: customizing numeric format in alerts
          silverbacksays

          Take a look at the appendix section of the NPM Administrator's Guide from page 831 it explains the variables and the modifiers available.

            • Re: customizing numeric format in alerts
              akhasheni

              Which one, "Cooked"?

               

              So ${N=SwisEntity;M=VolumePercentUsed} would turn into ${N=SwisEntity;M=Cooked(VolumePercentUsed)}?

               

              That didn't work, regretfully, doesn't resolve.

              Screen Shot 2015-06-03 at 2.57.49 AM.png

               

              Did find an old thread, Re: Advanced Alerting:

              jbaulsir wrote:

               

              Try this:

              Alert: ${FullName} is ${SQL:Select Round ('${VolumePercentUsed}',0) from Volumes WHERE VolumeID='${VolumeID}'} Percent Utilized

                • Re: customizing numeric format in alerts
                  akhasheni

                  This one ended up working for "Percent Used": ${SQL:Select Round ('${VolumePercentUsed}',2)}.

                   

                  Interesting that the formula only works with ${VolumePercentUsed} but neither with ${N=SwisEntity;M=VolumePercentUsed} nor with ${VolumePercentAvailable}: "MACRO SQL ERROR - Error converting data type varchar to float." - probably because the latter is of a different type?

                   

                  Wishing for better documentation. Can't be sure the working formula won't break in the next SR.

                  1 of 1 people found this helpful
                    • Re: customizing numeric format in alerts
                      silverbacksays

                      I believe the $(Property) format is being redacted, they certainly no longer work with alerts in the newest version (according to the documentation). If you read a little further down they speak about adding F=x to specify the format of the variable. So for you it would be:

                       

                      ${N=SwisEntity;M=VolumePercentUsed;Fx}

                      Where x is the relevant format.


                      Annoyingly I cannot find a list of specific formats which are supported within the admin guide. Perhaps Integer will work, if you're not bothered about the decimal values of your volume usage?

                        • Re: customizing numeric format in alerts
                          akhasheni

                          ${N=SwisEntity;M=VolumePercentUsed;Fx}

                          Where x is the relevant format.

                          Sorry, don't get it.

                          ${N=SwisEntity;M=VolumePercentUsed,2}?

                          ${N=SwisEntity;M=VolumePercentUsed,F2}?

                          Neither one works.

                          1 of 1 people found this helpful
                            • Re: customizing numeric format in alerts
                              silverbacksays

                              No problem I'll try to explain:

                               

                              SolarWindsVariables.jpg

                              I believe the format aspect of the variable can help strip out the extraneous decimals, but I can't find the specific format types that are supported. I suggested Integer may help, but I'm not sure if it is a valid type. That would make your variable:

                               

                              ${N=SwisEntity;M=VolumePercentUsed;F=Integer}

                               

                              Again, assuming Integer is valid. Give it a try.

                              1 of 1 people found this helpful
                                • Re: customizing numeric format in alerts
                                  akhasheni

                                  ${N=SwisEntity;M=VolumePercentUsed;F=Integer}

                                   

                                  Again, assuming Integer is valid. Give it a try.

                                  Doesn't resolve. Would also prefer it rounded to a two-digit precision (or scale) rather than converted to integer.

                                  1 of 1 people found this helpful
                                    • Re: customizing numeric format in alerts
                                      silverbacksays

                                      Unfortunate... perhaps it's time to log a call with support. No doubt they'll be able to resolve pretty quickly. I would paste the link to this thread in your ticket, so they can see what has been suggested already, to expedite things even further.

                                       

                                      If you do, could you please post the resolution in this thread? I'd be very interested to see what I missed here

                                      1 of 1 people found this helpful
                                        • Re: customizing numeric format in alerts
                                          akhasheni

                                          Support responded that ${N=SwisEntity;M=VolumePercentUsed} is "string" variable, not a number, thus making any efforts to format it as a numeral - futile. They suggested to use old style variable, ${VolumePercentUsed} - which works with formulas like Round().


                                          I responded with:

                                          • This doesn't answer the question: how do I format ${N=SwisEntity;M=VolumePercentUsed} to only have two digits after the dot?
                                          • Old style variables like ${VolumePercentUsed} don't seem to be available in the new web based Alert Manager. If that's the case, why suggest to use it?

                                          We'll see where this goes.

                                          1 of 1 people found this helpful
                                            • Re: customizing numeric format in alerts
                                              akhasheni

                                              "It gets curiouser and curiouser"

                                               

                                              Variable picker does not show format output options for "Percent Used":

                                               

                                              Screen Shot 2015-06-05 at 10.00.46 PM.png

                                               

                                              It does - for "Volume Percent Available":

                                               

                                              Screen Shot 2015-06-05 at 10.03.02 PM.png

                                              What are the options, one might ask?

                                               

                                              Screen Shot 2015-06-05 at 10.05.01 PM.png

                                               

                                              Never thought "Response Time" or "Duplex Mode" applied to percentages or numerals but who am I to question Solarwinds developers?

                                              Screen Shot 2015-06-05 at 10.08.07 PM.png

                                               

                                              Interestingly, "Bytes" and "Bandwidth" modifiers produce the integer (rounded, not truncated) value...

                                              Screen Shot 2015-06-05 at 10.08.53 PM.png

                                              ...that looks like this as a variable: ${N=SwisEntity;M=VolumePercentAvailable;F=Bytes}

                                               

                                              What are the other options for F=Format modifiers? Where is this documented? Why is "M=VolumePercentAvailable" different from "M=VolumePercentUsed" where one shows "format output" options and the other one doesn't? Why do people jump in the left lane just to get on their phones and drive real slow?

                                               

                                              I'd love to know.

                                              1 of 1 people found this helpful
                                                • Re: customizing numeric format in alerts
                                                  akhasheni

                                                  Support responded with a flat out "no":

                                                  • there is no way to format the percentage with two digits after the dot using new variables, and we can't explain why
                                                  • the new variable is a string (text) with a "%" sign appended, not a number like the old one, and we can't explain why
                                                  • "Format Output Value" is not documented anywhere, you just have to look at the variable picker, see what's available, and experience the surreal joy of formatting a percentage value as a "Yes or No" - free of extra charge.
                                                  • ${N=SwisEntity;M=VolumePercentAvailable} does have a "format output value" option while its sister variable, ${N=SwisEntity;M=VolumePercentUsed} - does not, and we can't explain why.

                                                   

                                                  This would normally be hilarious yet this is something my company spent thousands of dollars on, is supposed to be an enterprise grade product with matching enterprise grade support, and something my company is supposed to be able to rely on.

                                                   

                                                  Seriously, Solarwinds?

                                                  1 of 1 people found this helpful
                                                    • Re: customizing numeric format in alerts
                                                      silverbacksays

                                                      If your text is a copy/paste from the email received from SolarWinds support, that's terrible customer service, and worthy of escalation to an official complaint, IMHO. Whilst it is apparently true that the current operation of the Web Alert Manager may have these bizarre attributes for the variable in question, setting a percentage number as a string rather than using a number type has to be an oversight.

                                                       

                                                      I also logged a support ticket, as I was curios, and had a similar response, although one which was much more professionally worded.

                                                       

                                                      One more reason for me to hold back from upgrading from NPM 11.0.1 I suppose. It's a shame that there are still plenty of bugs surfacing in NPM 11.5.x

                                                        • Re: customizing numeric format in alerts
                                                          LadaVarga

                                                          Hello,

                                                           

                                                          Before fix you can use SQL variable workaround:

                                                           

                                                          VolumePercentUsed:

                                                          ${SQL: SELECT round(VolumePercentUsed,2) FROM [dbo].[Volumes] where volumeid=${VolumeId}}%

                                                           

                                                           

                                                          VolumePercentAvailable:

                                                          ${SQL: Select round(100.00-VolumePercentUsed,2) from  [dbo].[Volumes] where volumeid=${VolumeId}}%

                                                           

                                                          This is if you create alert up to volume.

                                                           

                                                          Does it help?

                                                           

                                                          Lada

                                                          1 of 1 people found this helpful
                                                          • Re: customizing numeric format in alerts
                                                            akhasheni

                                                            If your text is a copy/paste from the email received from SolarWinds support, that's terrible customer service, and worthy of escalation to an official complaint, IMHO.

                                                            I freely paraphrased - that was not the response verbatim - would have used quotes otherwise. The response was perfectly polite - except ignoring many of my questions such as,

                                                            • why did you suggest using an old style variable if it will be deprecated and is not available via variable picker?
                                                            • what was the reason behind (a) changing the format and appearance, (b) choosing that type of a format for a variable that is numeric in nature, and (c) making it next to impossible to format?

                                                            I hold no grudges against support - they saved my bacon a few times - and they can't do much to override the company's business practices. Now the latter - I am completely stupefied by.

                                                            1 of 1 people found this helpful
                                      • Re: customizing numeric format in alerts
                                        micahcox

                                        The linked Admin guide only has 445 pages.  There's no page 8xx