Redgate Monitor migration guide to version 14 Redgate Monitor migration guide to version 14

Redgate Monitor migration guide to version 14

Version 14 of Redgate Monitor will have some breaking changes. This means that some manual changes will be needed when upgrading. Redgate is committed to making the upgrade process as seamless as reasonably possible.

Deprecated platforms

Redgate Monitor v. 14 will no longer support the following platforms:

  • installing Redgate Monitor on Windows Server 2012 (monitoring is still supported). See Migrating Redgate Monitor.
  • monitoring Postgres 10.
  • monitoring unpatched versions of SQL Server 2008 R2 and 2012 that don't support extended events properly:
    • SQL Server 2008 R2 earlier than SP2 CU12
    • SQL Server 2012 earlier than SP1 CU6

PowerShell module name and default command prefix

  1. The name of the PowerShell module changes from RedgateSQM  to RedgateMonitor 
  2. The default command prefix changes from SqlMonitor to RedgateMonitor .

As described in PowerShell API, to integrate with the PowerShell API, the PowerShell module needs to be imported first. Up to version 13, it was done with Import-Module .\RedgateSQM\. From version 14, it is Import-Module .\RedgateMonitor\.

The change of the default command prefix means that every cmdlet in the PowerShell module has changed name. For example, the Connect-SqlMonitor, Get-SqlMonitorMonitoredObject and Add-SqlMonitorAnnotation cmdlets are now called Connect-RedgateMonitor, Get-RegateMonitorMonitoredObject and Add-RedgateMonitorAnnotation.

There are two simple approaches you can take to updating existing scripts that use the PowerShell module:

  1. Rename the cmdlets in your scripts by replacing occurrences of -SqlMonitor with -RedgateMonitor.
  2. When importing the PowerShell module, explcitly override the new default command prefix with the previous prefix, using the -Prefix parameter, like this: Import-Module .\RedgateMonitor -Prefix SqlMonitor

Note that going forward, the documentation and examples will refer to the new default command prefix of RedgateMonitor, so we strongly advise performing the one-off migration.

PowerShell module alert types

The names of the following alert types were renamed. 

Additionally, the SqlDeadlock alert type was removed completely, as it relied on a legacy mechanism of reading from the error log with trace flags 1204 and 1222 enabled. Alert Deadlock (extended event)  was renamed to Deadlock and its identifier in PowerShell was changed from SqlDeadlockXe  to Deadlock .

Consult List of alerts for more details on specific alerts.

Alert type name up to v. 13 Alert type name in v. 13 and beyond

SqlErrorLog

ErrorLogEntry

SqlServerLog

LogEntry

SqlDeadlock

removed, use Deadlock

SqlDeadlockXe

Deadlock

SqlJobCancelled

JobCanceled

SqlJobFailure

JobFailure

MachineUnreachable

HostUnreachable

SqlServerUnreachable

InstanceUnreachable

SqlBlockingProcess

BlockingProcess

SqlLongRunningQuery

LongRunningQuery

MonitoringStoppedMachineCredentials

MonitoringStoppedHostCredentials

MonitoringStoppedSqlCredentials

MonitoringStoppedInstanceCredentials

MonitoringErrorMachineDataCollection

MonitoringStoppedHostDataCollection

MonitoringErrorSqlServerDataCollection

MonitoringStoppedInstanceDataCollection

MachineInternalSqlMonitorError

InternalMonitorErrorForHost

SqlServerInternalSqlMonitorError

InternalMonitorErrorForInstance

LowDiskSpaceAlerter

LowDiskSpace

LowMemorySpaceAlerter

LowMemorySpace

PowerShell module deprecated cmdlets removal

Deprecated cmdlets that have names in plural were removed: Get-SqlMonitorTags, Add-SqlMonitorTags, Remove-SqlMonitorTags, Get-SqlMonitorSubGroups, Get-SqlMonitorMainGroups, Update-SqlMonitorAlertSettingsComments.

Use corresponding cmdlets with a singular name. For example: Get-RedgateMonitorTag

Deprecated cmdlets for retrieving specific monitored server types have been removed: Get-SqlMonitorCluster , Get-SqlMonitorLinuxMachine , Get-SqlMonitorAzureSqlServer , Get-SqlMonitorMachine , Get-SqlMonitorAmazonRdsSqlServer , and Get-SqlMonitorAzureManagedInstance .

Instead use: Get-RedgateMonitorMonitoredObject  with the -Type  parameter.

PowerShell module deprecated cmdlet parameter removal

The Add-RedgateMonitorMonitoredObject cmdlet  now only has a single -MonitoredObject  parameter.  This parameter no longer accepts a simple host name string.

Instead, you must supply one or more objects as returned by the New-... cmdlets (eg. New-RedgateMonitorWindowsHost , New-RedgateMonitorPostgreSql , etc.) 

Windows service display name

Windows service display name changed from SQL Monitor Base Monitor  to Redgate Monitor Base Monitor and from SQL Monitor Web Service  to Redgate Monitor Web Service . The underlying name of the service stays the same. 

This rename will be performed automatically during the installation, but if any automation relies on the service's display name, it must be updated.