Washington DC Endpoint Management User Group

 View Only
  • 1.  Monitor Tasks - Email the correct party

    Posted Jan 30, 2013 12:16 PM

    Right now we have a standard set of monitor policies that run on all servers that emails just about everyone on the server team like when a server is down. Is it possible to right a conditional task rule that would only email our DBA's when the server is a SQL server and not email them when it's a differnt type of server? I already have a nother table that stores assigned server roles and even IT owners of those servers. Could I use that info in a token or something in a Monitor policy and conditional task?



  • 2.  RE: Monitor Tasks - Email the correct party

    Posted Jan 31, 2013 12:54 PM

    Yes, the e-mail task should send To: the e-mail token.  I created a test table that used computer name and joined to vComputer, so my token query looked like this: SELECT sot.OwnerEmail FROM vComputer vc JOIN ServerOwnerTable sot ON sot.ServerName=vc.Name WHERE vc.[Guid] = %COMPUTERID%

    When the task fires for the monitor policy it will send to the e-mail address pulled from the token.  Create an exception report that e-mails you weekly for any computers with Monitor Plug-in Installed whose names are not in your custom table (e.g. ServerOwnerTable), so that you always have owners defined for the monitor e-mails.

    So if your custom token is %ServerOwnerEmail%, as mine was, then you would put this in the task in the To: field.



  • 3.  RE: Monitor Tasks - Email the correct party

    Posted Feb 26, 2013 06:15 PM

    So I tried the following but the Token generator doesn't seem to like + being used. Any ideas around that?

     

    Select
     CASE
      WHEN pu.Email IS NULL THEN 'AllTechsGroup@company.com'
      WHEN su.Email IS NULL THEN pu.Email
      ELSE pu.email + '; ' + su.Email
     END AS EMAILS
    From vComputer cmp
     LEFT OUTER JOIN dbo.Inv_ACAS_Role AS rl
      ON CMP.Guid = rl._ResourceGuid
     LEFT JOIN [dbo].[Inv_Naming_Convention_Details] AS NC
      ON rl.Symbol = NC.Symbol AND NC._ResourceGuid = 'A9F7D44E-0E40-4D0C-8077-E2F5569CD77D'
     LEFT JOIN vUser AS PU ON PU.Guid = NC.[Primary Owner]
     LEFT JOIN vUser AS SU ON SU.Guid = NC.[Secondary Owner]
    Where cmp.Guid = '%COMPUTERID%' 



  • 4.  RE: Monitor Tasks - Email the correct party

    Posted Feb 27, 2013 01:31 PM

    Figured out a way around it using STUFF and REPLACE.

    STUFF(Replace(pu.email,'.com','.com; ;'), LEN(Replace(pu.email,'.com','.com; ;')),1,su.email)
     



  • 5.  RE: Monitor Tasks - Email the correct party

    Posted Feb 27, 2013 04:12 PM

    Problem... ComputerID is the GUID of the TASK server. Not the server that has the problem. Can you use %!MONITOR_RESOURCE_GUID!% for the computer ID in the token?