none
[Need Customer Help]Alert patterns in your DPM environment RRS feed

  • Question

  • Hi,

    We want to understand the kind of alerts in your DPM production environment to offer you a better experience with DPM 2012 Centralized monitoring feature by consolidating. For example if your recovery point creation jobs fails because of an agent communication issue you will see a single alert on your SCOM for the same root cause instead of all the backup failed alerts. We want to identify such alert patterns which can be consolidated. Please help us by doing the following 6 simple steps.

    1. On one of your DPM 2010 or later version server copy the following powershell script to a ps1 file say gatheralerts.ps1 and save it under C:\foo

     

    #------------------------------------------Beginning of script------------------------------------------
    
    #Initialization section
    
    #Global variables
    
    $ConfirmPreference="High"
    
    $dpmServerList=$args[0]
    
    $RunID=get-date -format "MM/dd/yyy hh:mm:ss"
    
    $logDir= gc env:programfiles
    
    $logDir= $logDir+"\DPMAlerts"
    
    $filename=$logDir+"\DPMV3AlertHistory.CSV"
    
    $logfile=$logDir+"\DPMV3AlertHistory.errlog"
    
    $programfiles= gc env:programfiles
    
    $dpmInstallPath = $programfiles+"\Microsoft DPM\"
    
    
    #Functions and Filters Section
    
    
    #This function gets the list of DPM servers monitored by SCOM server
    function InitDPMServerList()
    {
     write-host "Input dpm server:"$dpmServerList
    
            if($dpmServerList -eq $null)
     {
     Write-host "Inside InitDPMServerList" 
     $script:dpmServerList=get-content machines.txt
     Write-host "DPM servers list..."
     foreach($dpmserver in $dpmServerList)
     {
      Write-Host $dpmserver
     }
     Write-host "Exiting InitDPMServerList"
     }
    
    }
    
    #This function returns the alert property value for the given alert
    
    function GetAlertProperty
    {
    
     Param([Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.Alert] $current_alert, [String] $currentProperty)
     
     $idMethod1 =[Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.Alert.ReplicaAlert].getmethod("get_"+$currentProperty)
     $result = $idMethod1.Invoke($current_alert, "instance,public", $null, $null, $null) 
    
     Write-host "Value of property:"$currentProperty+" is:"$result
    
     $result
    
    }
    
    
    #This function logs alerts on DPM server to CSV file
    function LogDPMAlerts()
    {
    
     Write-host "Inside LogDPMAlerts"
    
     $dpmInstallPath = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Microsoft Data Protection Manager\Setup" | ForEach-Object {Get-ItemProperty $_.InstallPath}
     
     WRITE-HOST $dpmInstallPath
    
     $dpmBinPath = $dpmInstallPath.ToString() + "bin"
    
     WRITE-HOST "Adding paths"
    
     WRITE-HOST "DPM BIN PATH:"$dpmBinPath
     Add-Type -Path $dpmBinPath\ObjectModelCmdlet.dll
     Add-Type -Path $dpmBinPath\TraceWrapper.dll
     Add-Type -Path $dpmBinPath\FileSystem.dll
     Add-Type -Path $dpmBinPath\Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.Exchange.dll
     Add-Type -Path $dpmBinPath\Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.SQL.dll
     Add-Type -Path $dpmBinPath\Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.SharePoint.dll
     Add-Type -Path $dpmBinPath\Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.GenericDatasource.dll
     Add-Type -Path $dpmBinPath\Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.ClientDatasource.dll
     Add-Type -Path $dpmBinPath\Utils.dll
     Add-Type -Path $dpmBinPath\CommonControls.dll
     Add-Type -Path $dpmBinPath\serviceproxy.dll
     Add-Type -Path $dpmBinPath\EngineUICommon.dll
     Add-Type -Path $dpmBinPath\ObjectModel.dll
    
     #Writing header
     if(!(test-path $filename))
     {
      $line="`"" + "RunID" + "`"`t" +"`"" + "DPM Server" + "`"`t" +"`"" + "AlertID" + "`"`t" + "`"" + "AlertType" + "`"`t" + "`"" + "DetailedErrorCode"+ "`"`t" + "`"" + "Severity"  + "`"`t"+ "`"" + "OccuredSince"+ "`"`t"+ "`"" + "Resolution"+ "`"`t"+ "`"" + "IsResolved" + "`"`t"+ "`"" + "ResolvedDateTime" + "`"`t"+ "`"" + "AffectedArea" + "`"`t"+"`"" + "ServerName" + "`"`t"+ "`"" + "IsResumeBackupsDefined" +"`"`t"+ "`"" + "TargetObjectType" + "`"`t"+ "`"" + "PGName" + "`"`t"
      $line>>$filename
     }
    
    
     #For each dpm server
    
     
     foreach ($current_server in $dpmServerList)
     {
    
      Write-Host "Disconnecting existing DPM server..."
    
      disconnect-dpmserver
    
      Write-Host "Disconnecting done."
    
      $alerts=$null
    
      Write-Host "Connecting DPM server:"$current_server
      
      $dpmServer = connect-dpmserver $current_server
      
      Write-Host "Getting and writing alerts of DPM server " $current_server -foregroundcolor "Green"
      if($dpmServer -eq $null)
      {
       $errorline="Time:"+$RunID+"Unable to process:"+$current_server 
       write-host $errorline -foregroundcolor "Red"
       $errorline>>$logfile
       
      }
      else
      {   
    
    
       Write-Host "Refreshing alerts"
    
       $dpmServer.AlertController.RefreshAlerts($true,$false)
    
       Write-Host "Waiting for refresh"
    
       Start-Sleep -s 120
    
       Write-Host "Refreshing done"
    
       $activeAlerts = $dpmServer.AlertController.ActiveAlerts.Values
       
       Write-host "# of active alerts:"$activeAlerts.Count  
    
         
       write-host "Writing active alerts..."
       
    
       foreach($current_alert in $activeAlerts)
       {
     
        if($current_alert.Type -eq "BackupToTapeFailedAlert")
        {
         $fr=$current_alert.GetFailureReasons()
      
         foreach($failure in $fr)
         {
    
          $failureinfo=$failure.failureerrorinfo
    
          $line= "`"" + $RunID + "`"`t" +"`"" + $current_server + "`"`t" +"`"" + $current_alert.AlertId + "`"`t" + "`"" + $current_alert.Type + "`"`t" + "`"" + $failureinfo.Code + "`"`t" + "`"" + $current_alert.Severity+ "`"`t"+ "`"" + $current_alert.OccurredSince + "`"`t"+ "`"" + $current_alert.Resolution + "`"`t"+ "`"" + $current_alert.IsResolved + "`"`t"+ "`"" + $current_alert.ResolvedDateTime + "`"`t"+ "`"" +  $failure.datasourcename + "`"`t"+ "`"" + $current_alert.ServerName + "`"`t"+ "`"" + "NA" + "`"`t"+ "`"" + "NA" + "`"`t"+ "`"" + $current_alert.PG.FriendlyName + "`"`t"                                
                                 
         }
        }
        else
        {   
        
         $line= "`"" + $RunID + "`"`t" +"`"" + $current_server + "`"`t" +"`"" + $current_alert.AlertId + "`"`t" + "`"" + $current_alert.Type + "`"`t" + "`"" + $current_alert.DetailedErrorInfo.Code + "`"`t" + "`"" + $current_alert.Severity+ "`"`t"+ "`"" + $current_alert.OccurredSince + "`"`t"+ "`"" + $current_alert.Resolution + "`"`t"+ "`"" + $current_alert.IsResolved + "`"`t"+ "`"" + $current_alert.ResolvedDateTime + "`"`t"+ "`"" + $current_alert.AffectedArea + "`"`t"+ "`"" + $current_alert.ServerName + "`"`t"+ "`"" + "NA" + "`"`t"+ "`"" + "NA" + "`"`t"+ "`"" + $current_alert.PG.FriendlyName + "`"`t"                              
        }
    
                             $line>>$filename
       
       }   
    
       $resolvedAlerts = $dpmServer.AlertController.ResolvedAlerts.Values
    
       Write-host "# of resolved alerts:"$resolvedAlerts.Count
       
       
       write-host "Writing inactive alerts..."
    
    
       foreach($current_alert in $resolvedAlerts)
       {    
        
        if($current_alert.Type -eq "BackupToTapeFailedAlert")
        {
         $fr=$current_alert.GetFailureReasons()
      
         foreach($failure in $fr)
         {
    
          $failureinfo=$failure.failureerrorinfo
    
          $line= "`"" + $RunID + "`"`t" +"`"" + $current_server + "`"`t" +"`"" + $current_alert.AlertId + "`"`t" + "`"" + $current_alert.Type + "`"`t" + "`"" + $failureinfo.Code + "`"`t" + "`"" + $current_alert.Severity+ "`"`t"+ "`"" + $current_alert.OccurredSince + "`"`t"+ "`"" + $current_alert.Resolution + "`"`t"+ "`"" + $current_alert.IsResolved + "`"`t"+ "`"" + $current_alert.ResolvedDateTime + "`"`t"+ "`"" +  $failure.datasourcename + "`"`t"+ "`"" + $current_alert.ServerName + "`"`t"+ "`"" + "NA" + "`"`t"+ "`"" + "NA" + "`"`t"+ "`"" + $current_alert.PG.FriendlyName + "`"`t"                                
                                 
         }
        }
        else
        {   
        
         $line= "`"" + $RunID + "`"`t" +"`"" + $current_server + "`"`t" +"`"" + $current_alert.AlertId + "`"`t" + "`"" + $current_alert.Type + "`"`t" + "`"" + $current_alert.DetailedErrorInfo.Code + "`"`t" + "`"" + $current_alert.Severity+ "`"`t"+ "`"" + $current_alert.OccurredSince + "`"`t"+ "`"" + $current_alert.Resolution + "`"`t"+ "`"" + $current_alert.IsResolved + "`"`t"+ "`"" + $current_alert.ResolvedDateTime + "`"`t"+ "`"" + $current_alert.AffectedArea + "`"`t"+ "`"" + $current_alert.ServerName + "`"`t"+ "`"" + "NA" + "`"`t"+ "`"" + "NA" + "`"`t"+ "`"" + $current_alert.PG.FriendlyName + "`"`t"                              
        }
    
                             $line>>$filename
       
       } 
      }
     }
    
     Write-host "Disconnecting DPM server"
     
     Disconnect-DPMserver
    
     Write-host "Exiting LogDPMAlerts"
      
     
    
    }
    
     
    
    #Main Processing Section
    
    InitDPMServerList
    
    [IO.Directory]::CreateDirectory($logDir)
    
    LogDPMAlerts
    
    exit
    
    #------------------------------------------End of script-------------------------------------------------
    
    


    2. Create file machines.txt and save it under C:\foo on the same machine

    3. Add the DPM servers in your environment to C:\foo\machines.txt seperated by new line

    4. Open DPM management shell and go to C:\foo

    5. Run gatheralerts.ps1 script

    6. After the script ran e-mail the .csv files under %programfiles%\DPMAlerts to vborra@microsoft.com

    Note: Prereq for running this script is the user running the script should be an administrator on the DPM servers and DPM should be of 2010 or later.

    If you run in to any issues or any queries please e-mail to vborra@microsoft.com

    Thank you very much for your help in advance!


    -- Thanks Venkata Praveen[MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.


    Monday, September 19, 2011 6:26 AM

Answers

  • Closing for housekeeping

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, September 3, 2013 9:12 PM
    Moderator