question

Manish P. avatar image
Manish P. asked ·

Dynatrace list of incident rules

Hi

Is there a list available for all Dynatrace incident rules that can be exported and

once can choose incident rules that he is interested in to configure

Thanks

6.5
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

James K. avatar image
James K. answered ·

The only thing even close at present that I am aware of is in the systemprofile xml files on the server there will be the xml for the incidents included if you have a way of parsing this to pull out the incidents, but there is no easy way to export and modify them. Would be a good RFE/Idea to post as I would find this very useful as well.

James

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

HIMANSHU m. avatar image
HIMANSHU m. answered ·

hello @James K. , have we received any updates on this in latest version?

Is there a way now to pull List of incidents rules configured in a system profile?

1 comment Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

Hey Himanshu,

I recently did this, just import all the system profiles to a local directory. Inside the system profile XML are the incident rules defined. Powershell Script below gets all the incident rules with a mail action, and exports them to a Excel file.

Kind regards.

$filepath = "C:\System profiles"
$excel = New-Object -ComObject excel.application
$excel.visible = $False
$workbook = $excel.Workbooks.Add()
$diskSpacewksht= $workbook.Worksheets.Item(1)
$diskSpacewksht.Name = "Data Set"
$xindex = 1

Get-ChildItem $filepath -Filter *.xml | 
Foreach-Object {
    $_.BaseName
   [xml]$xml = get-content $_.FullName
   foreach($incidentrule in  $xml.dynatrace.systemprofile.incidentrules.incidentrule){
      $diskSpacewksht.Cells.Item($xindex,1) = $_.BaseName
      $diskSpacewksht.Cells.Item($xindex,2) = $incidentrule.id
      $diskSpacewksht.Cells.Item($xindex,3) = $incidentrule.description
      foreach ($actie in $incidentrule.actions.actionref){
        if ($actie.type.Contains("mail")){
            [string]$mails = $actie.property.value 
            $mails = $mails.replace("`n",", ").replace("`r",", ")
            if($mails -ne ""){
            $mails
                $diskSpacewksht.Cells.Item($xindex,4) = $mails
            
            }
        }
      
      }
      $xindex++
   }

}
$excel.DisplayAlerts = 'False'
$ext=".xlsx" 
$path="C:\System profiles\newAllIncidents$ext" 
$workbook.SaveAs($path)  
$workbook.Close
$excel.DisplayAlerts = 'False'
$excel.Quit()
0 Likes 0 · ·