Delphix Products

 View Only
  • 1.  Alert Profile - Notification for job refresh

    Posted 04-08-2021 02:00:00 AM
    Hi 
    Is there a way to setup email alert when db refreshes?
    I managed to setup alert for informational but for each refresh it sends 4 alerts 
    1. ORACLE_UPDATE_REDOLOGS
    2. SOURCE_STOP
    3. DB_SYNC
    4. DB_REFRESH
    I would like to filter down to one for DB_REFRESH only but it seems like there is no filter on properties eventDescription.

    delphix alert profile > create
    delphix alert profile create * > ls
    set actions.0.type=AlertActionEmailUser
    set filterSpec.type=AndFilter
    set filterSpec.subFilters.0.type=SeverityFilter
    set filterSpec.subFilters.0.severityLevels.0=INFORMATIONAL
    set filterSpec.subFilters.1.type=EventFilter
    set filterSpec.subFilters.1.eventTypes=alert.jobs.complete.*

    ------------------------------
    Lukasz Wasylo
    Community Member
    Baillie Gifford & Co,
    ------------------------------


  • 2.  RE: Alert Profile - Notification for job refresh
    Best Answer

    Posted 04-08-2021 02:18:00 AM
    Edited by Michael Torok 04-08-2021 09:09:57 AM
    Hello Lukasz,

    Unfortunately that functionality does not currently exist.
    There are existing requests for this functionality being considered by Engineering for implementation in future releases.
    I will add Baillie Gifford to the list of interested parties.

    However, you may find you can achieve it using Hooks. I've included the following as reference. 

    https://docs.delphix.com/docs-old/delphix-administration/sql-server-environments-and-data-sources/customizing-delphix-for-sql-server/hooks-for-sql-server/cookbook-of-common-scripts-for-hooks-on-sql-server/example-powershell-script-for-email-notification

    Alternatively, using API.

    API Cookbook: List Alerts and List Jobs

    Best regards.

    ------------------------------
    Luke Moss
    Senior Support Engineer
    Delphix
    ------------------------------



  • 3.  RE: Alert Profile - Notification for job refresh

    Posted 04-08-2021 02:27:00 AM
    Hi Luke
    Thank you for quick reply.
    Please do add as to the list , this would be very usefull.

    Cheers
    Lukasz

    ------------------------------
    Lukasz Wasylo
    Community Member
    Baillie Gifford & Co,
    ------------------------------



  • 4.  RE: Alert Profile - Notification for job refresh

    Posted 04-12-2021 08:28:00 AM
    If you're running SQL Server, you can potentially do this via PowerShell. Below is a sample of the code we use for this sort of email. We add this sort of thing to our VDBs under the Configure Clone hooks.

    #Run postscripts
    $postscript = "`"
    USE $database

    DECLARE @subject1 VARCHAR(200),
    @DatbaseName VARCHAR(200)
    SET @DatbaseName = DB_NAME()
    SET @subject1 = 'Delphix Restore has completed on '+ @@Servername +' database: '+ @DatbaseName
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'AGENT' ,
    @recipients = 'Lukasz@Wasylo.com' ,
    @subject = @subject1
    GO`""
    $cmd = "sqlcmd -S $server -Q $postscript -d $database -m -1 -I"
    Invoke-Expression $cmd

    ------------------------------
    Mark McKibben
    Senior Database Administrator
    United Fire Group
    ------------------------------