mzball-dt / dynatrace-pwsh

Script utilities for making life easy
2 stars 9 forks source link

Dynatrace API Scripts

API Interfaces

A Powershell interface to Dynatrace Monitoring environments, in a similar way to the default powershell cmdlets that provide: Get-Process, Get-<item>, Set-Service, Set-<item> et al.

All scripts will:

Script Details
get-tenantMonitoredEntity.ps1 For retrieving entities currently monitored in a Dynatrace Environment

Usecases:

  • Exploration of a monitoring environment via the API
  • Reporting on how many X in an environment
  • To collect information required for further scripts (piping further into a chain)
get-tenantToken.ps1 For auditing Tokens available in a given Dynatrace

Usecases:

  • Reviewing users that have created tokens
set-tenantToken.ps1 For configuring tokens in a given Dynatrace Tenant. Created to function with the output directly from get-tenantTokens or via a filtering step

Usecases:

  • Programmatically create new tokens
  • Revoke tokens belonging to a certain user
  • Update names for tokens
  • Remove problematic scopes from tokens found in Dynatrace tenants
get-tenantTokenDetail.ps1 For when you only want information about a specific tenant token

Usecases:

  • Checking scopes assigned to a token
  • Checking scopes of tokens listed for use by run-clusterwide.ps1.
get-tenantDashboard.ps1 For auditing or reporting of who has created/shared dashboards in a given Dynatrace Tenant

Usecases:

  • Reviewing users that have created Dashboards
  • Reviewing the sharing of dashboards
  • Accessing user dashboards to support configuration
get-tenantHostGroupDetail.ps1 For reporting on all hosts in an environment, particularly for HU consumption by HostGroup

Usecases:

  • What is the distribution of HU in my environment?
  • What is the newest and oldest Agent version running in my environment?
  • What Host Groups have the oldest agent version?
get-tenantProblemFeed.ps1 For reporting on all problems in an environment, particularly

Usecases:

  • What are the problems report for an enviornment in the last X period?
Invoke-USQLRequest.ps1 Powershell script for saving or viewing USQL queries as PS Tables or CSV files

Usecases:

  • Extract USQL data from a tenant in a standard format
Export-TenantConfig.ps1 Powershell script that exports all (or a filterable subset) of the config accessible through the Dynatrace Configuration API

Usecases:

  • Backing up an in the case of disaster
  • Exporting a Tenant's configuration for re-use in another tenant
  • Exporting a Tenant's configuration for use with Dynatrace's Monitoring as Code Tool

Other Scripts

copy-dashboard.ps1

Powershell script for moving Dynatrace Managed Dashboards between Managed clusters or tenants

Use case:

set-defaultDashboard.ps1

Script that creates or updates a Dynatrace Managed Dashboard based on a different/pre-existing. Designed for nightly executions that update 'client-facing', published dashboards from a template.

Use case:

assign-syntheticClusterLocation.ps1

Powershell script for assigning a Synthetic Location to a Dynatrace Managed Synthetic Cluster Node. This needs to be converted to set-clusterSyntheticLocation.ps1

Use case:

run-clusterWide.ps1

Powershell script for running arbitary code against a collection of Dynatrace tenants.

Use case:

measure-HUperProperty.ps1

Pipeline script for performing simple (but irritating to type out) calculations on Host Meta-data

Use case:

export-tenantConfig.ps1

For exporting tenant configuration to disk for archiving or other purposes.

Use case:

templateScaffold.ps1

Template for new scripts

Use case: