Submit a ticketCall us

Training ClassSign up for Network Performance Monitor (NPM) and Scalability instructor-led classes

Attend our instructor-led classes, provided by SolarWinds® Academy, to discuss the more advanced monitoring mechanisms available in NPM as well as how to tune your equipment to optimize its polling capabilities. NPM classes offered:
NPM Custom Monitoring and Polling
Orion Platform Scalability

Reserve your seat.

Home > Success Center > Server & Application Monitor (SAM) > SAM - Knowledgebase Articles > 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