cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

Dynatrace list of incident rules

mapawar
Newcomer

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

3 REPLIES 3

JamesKitson
Dynatrace Leader
Dynatrace Leader

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

himanshu_mor
Advisor

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?


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()