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

Dashboard for alerting profile last change date

vishnu_kumar
Participant

Hi,

Is it possible to get the last updated date for an Alerting Profile or Problems Integration and display it in Dynatrace dashboard?

We need to monitor who and when of the alerting profile modification under a particular management zone in that dashboard

4 REPLIES 4

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

You can revision history here:
AntonPineiro_0-1706011554511.png

AntonPineiro_1-1706011614093.png

But I think adding that information to a dashboard is not possible.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

yes was looking same in Dashboard.

Seems we can have the DT API for this:
https://{environmentid}.live.dynatrace.com/api/v2/settings/objects?schemaIds=builtin%3Aalerting.profile&scopes=environment&fields=modified%2CmodifiedBy&pageSize=500 

If not Dashboard, is it possible to use a Workflow and run the API to get that data?

Hi,

I would say yes since you can execute JavaScript code, you can create your custom script.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

vishnu_kumar
Participant

I was able to achieve this with a Javascript running in Workflow.

On the first task, I ran a HTTP Request on Settings API to collect all Alerting Profiles data.

Followed by the code to check if there was any Alerting Profiles not edited in last 32 days:

// optional import of sdk modules
import { execution } from '@dynatrace-sdk/automation-utils';

export default async function ({ execution_id }) {
// your code goes here
// e.g. get the current execution
const ex = await execution(execution_id);
const result = await ex.result("http_request_1");
const userList = [];
console.log('Automated script execution on behalf of', ex.trigger);
console.log('Total Configured: ',result.json.totalCount)
const curDate = new Date();
const oldDate = new Date();
oldDate.setDate(oldDate.getDate() - 32);
console.log(curDate.getTime());
console.log(oldDate.getTime());
for (var item of result.json.items){
if(item.modified < oldDate.getTime())
{
console.debug("Old for" + item.value.name +" Author:"+ item.author )
const curData = {"AP Name":item.value.name, "Author":item.author};
userList.push(curData);
}
//console.debug(JSON.stringify(item.value.filters)+" "+JSON.stringify(item.value.filters).length + "<br />");
}
//const userStr = userList.toString();
return JSON.stringify(userList);
}

 HTH

Featured Posts