Submit a ticketCall us

AnnouncementsSystem Monitoring for Dummies

Tired of monitoring failures disrupting the system, application, and service? Learn the key monitoring concepts needed to help you create sophisticated monitoring and alerting strategies that can help you save time and money. Read the eBook.

Get your free eBook.

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