Submit a ticketCall us

Have You Auto Renewed? If not, you're missing out.
The SolarWinds Renewal Program comes with a host of benefits including the most recent product updates, 24/7 technical support, virtual instructor-led training and more. Experience all of this with the convenience of Auto Renewal, and never worry about missing any of these great benefits. Learn More.

Home > Success Center > Server & Application Monitor (SAM) > Convert alert value from bytes to GB in alert email

Convert alert value from bytes to GB in alert email

Table of contents

Updated January 10, 2018


Some of the alerting variables are returned in bytes. However, you might want the value displayed in the email to be in either MB or GB. Displaying a computed value can be done with a SQL statement.  


  • All versions of Orion
  • All versions of SAM


  1. Edit the alert email and click where you would like to put the value in the message or subject line.
  3. At the bottom of the pop-up box, check the box "Define SQL/SWQL Variable (Advanced)".  It opens another box where you can put in a SQL or SWQL query.  In this instance, ensure that the SQL radio button is selected.
  4. Enter the SQL to make the conversion. To put the variable name into the SQL, place the cursor where you want the variable name. Search for the variable in the above area, and press the + next to the variable name to add it to the SQL/SWQL.

    For instance, to convert the memory that a process is using from bytes to GB on a component alert, the SQL query in the box would look similar to:  

    SELECT CAST(${N=SwisEntity;M=ComponentAlert.MemoryUsed}  / 1073741824.0E AS DECIMAL(10, 2))
  6. The display return to the email and the following is shown.  Keep all the extra characters that have been added:

    ${SQL: SELECT CAST(${N=SwisEntity;M=ComponentAlert.MemoryUsed}  / 1073741824.0E AS DECIMAL(10, 2))}
  7. Finish the alert email as usual.
  8. Simulate the alert email to validate the computation.






Last modified