3 Replies Latest reply on Jun 9, 2015 4:17 PM by dhanson

    Variables in Advanced Alert Manager

    wyko

      I am trying to compose an alert email that shows the last time the node was polled in my local time (EST).

       

      The following query works great to show the time 4 hours earlier than right now:

      ${SQL:Select DATEADD(hh,-4,GETDATE())}

       

      However, that's not what I want. I need the last system uptime, which is found in the variable ${LastSystemUpTimePollUtc}. So I tried the following variations:

       

      • ${SQL:Select DATEADD(hh,-4,${LastSystemUpTimePollUtc})}
      • ${SQL:Select DATEADD(hh,-4,{LastSystemUpTimePollUtc})}
      • ${SQL:Select DATEADD(hh,-4,LastSystemUpTimePollUtc)}
      • ${SQL:Select DATEADD(hh,-4,LastSystemUpTimePollUtc())}


      Respectively, I got the following result in the test email:

       

      "

      MACRO SQL ERROR - Incorrect syntax near '5'.

      ${SQL:Select DATEADD(hh,-4,{LastSystemUpTimePollUtc})}

      MACRO SQL ERROR - Invalid column name 'LastSystemUpTimePollUtc'.

      MACRO SQL ERROR - 'LastSystemUpTimePollUtc' is not a recognized built-in function name.

      "

       

      Does anyone have an idea?