cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 13

customizing numeric format in alerts

Jump to solution

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!

1 Solution

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?

View solution in original post

19 Replies

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

- Jez Marsh
0 Kudos

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

0 Kudos

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

0 Kudos

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.

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?

- Jez Marsh
0 Kudos

${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.

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.

- Jez Marsh

${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.

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

- Jez Marsh

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.

"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.

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?

View solution in original post

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

- Jez Marsh

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.

Hey akhasheni‌,

Would you mind posting the ticket number here? Thanks!

0 Kudos

Would you mind posting the ticket number here? Thanks!

815825, maria.bungau‌.

I must re-iterate that my issues are not with support but with Solarwinds' product development. Support - no matter how good - can only do so much about atrocious bugs, inadequate functionality and UI inconsistencies introduced in new versions or ignored for years. Solarwinds' support people have always been polite and mostly professional. There were a few cases when they were not fully professional, failing to do basic checks of their own and wasting quite a bit of my time.

I understand and I appreciate your feedback.

As for the ticket number, it's always good to have it as a reference for other folks who might have the same issue or a similar one.

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

VolumePercentUsed:

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

Thanks Lada - yes, I am using this already - it was suggested earlier in the thread. Thank you for chiming in.

0 Kudos