SQL Monitor 13

Automated installation and updates

Installation and updates of SQL Monitor can be automated by using msi files and Microsoft’s System Centre Configuration Manager (SCCM), custom scripts, or any other standard way of managing upgrades in your organization.

Legal notice

Running an unattended installation means that you consent to Redgate's SQL Monitor EULA found at https://red-gate.com/sqlmonitor/eula.

When running msi installers you need to agree to the EULA by setting a parameter I_AGREE_TO_THE_EULA=yes.

Obtaining msi installers

Website

  1. Download the exe installer file (e.g. SQLMonitorWeb_12.0.0.1234.exe) from https://download.red-gate.com/checkforupdates/SQLMonitorWeb/.
  2. Extract the msi from it by running: SQLMonitorWeb_12.0.0.1234.exe /IAgreeToTheEULA extract web.msi

The latest stable version can be downloaded from https://download.red-gate.com/SQLMonitor.exe, which can be automated with:

curl -L https://download.red-gate.com/SQLMonitor.exe -o SQLMonitor.exe

Base Monitor

  1. Get the base monitor exe installer file (SQLMonitorBaseMonitorInstaller.exe)
  2. Extract the msi from it by running: SQLMonitorBaseMonitorInstaller.exe /IAgreeToTheEULA extract base.msi

The SQLMonitorBaseMonitorInstaller.exe can be obtained in the following ways:

  1. From the Website UI as described in Running the Base Monitor Installer
  2. From the Download folder of an installed Website, %ProgramFiles%\Red Gate\SQL Monitor\Web\wwwroot\Download by default
  3. Extracted from the web.msi, e.g. using lessmsi utility by running lessmsi x web.msi SQLMonitorBaseMonitorInstaller.exe

Configuration parameters

The easiest way to obtain the configuration parameters is to copy them from the UI installer by clicking the Help me automate this link in the Summary page:


Website

INSTALLDIR

string

Installation directory

Default%ProgramFiles%\Red Gate\SQL Monitor\Web

Optional for new installs and upgrades.

SERVICETYPE

local | user | gmsa | IIS

Hosting method and web service account type:

  • local- Self-hosted with a Windows Service using Kerstel running as LocalService (renamed from network in SQL Monitor ver. 12.1.17)
  • user - Self-hosted with a Windows Service using Kerstel running as a specified user account - see SERVICEUSERNAME and SERVICEPASSWORD
  • gmsa - Self-hosted with a Windows Service using Kerstel running as a gMSA account - see SERVICEUSERNAME 
  • IIS - Hosted on IIS

Default: local

Optional for new installs. Must be set for upgrades if default is not used.

SERVICEUSERNAME

string

User to run Windows Service as.

Default: (not set)

For SERVICETYPE=user|gmsa only.

SERVICEPASSWORD

string

Password for the Windows Service user.

Default: (not set)

For SERVICETYPE=user only.

SERVICEPORTNUM

int

Port for accessing the Website when self-hosted.

Default: 8080

Optional for new installs. Must be set for upgrades if default is not used.

WEBSITE

string

Installation directory for Website

Default: (none)

Must be set if SERVICETYPE=IIS. Must be set for upgrades if default is not used.

SERVICERPCHOSTNAME

string

Network name of the host where base monitor is installed

For collocated Website and Base Monitor localhost can be provided. Stored in BaseLocation.config.

Default: (none)

Optional for new installs. SQL Monitor will prompt for an address on first run if not set.
Optional for upgrades. Use PRESERVECONFIG=yes to keep existing settings for upgrades.

SERVICERPCPORTNUM

int

TCP port for communication with base monitor

Default: (none)

Optional for new installs. SQL Monitor will prompt for an address on first run if not set.
Optional for upgrades. Use PRESERVECONFIG=yes to keep existing settings for upgrades.

PRESERVECONFIG

yes | no

Whether the BaseLocation.config file should be preserved on update

Default: no

BaseLocation.config is stored in %ProgramData%\Red Gate\SQL Monitor\BaseLocation.config.

I_AGREE_TO_THE_EULA

yes | 1

Providing this parameter means that you consent to Redgate's SQL Monitor EULA found at https://red-gate.com/sqlmonitor/eula.

Default: (none)

Mandatory.

Base Monitor

INSTALLDIR

string

Installation directory

Default%ProgramFiles%\Red Gate\SQL Monitor\BaseMonitor

Optional for new installs and upgrades.

DATACONNECTION

string

Connection string for base monitor.

Saved to %ProgramData%\Red Gate\SQL Monitor\Red Gate\SQL Monitor\RedGate.SqlMonitor.Engine.Alerting.Base.Service.exe.settings.config.
Cleared on uninstall.

Mandatory

SERVICETYPE

user | local | gmsa

Defines how Windows Service should be configured.

Default: local

Mandatory

SERVICEDOMAIN

string

Domain that a user to run Windows Service as belongs to.

Default: (not set)

For SERVICETYPE=user|gmsa only.

SERVICEUSERNAME

string

User to run Windows Service as.

Default: (not set)

For SERVICETYPE=user|gmsa only.

SERVICEPASSWORD

string

Password for the Windows Service user.

Default: (not set)

For SERVICETYPE=user only.

SERVICERPCPORTNUM

int

TCP port for communication with base monitor.

Default: 7399

Should be the same as used in the Website installer, or set in BaseLocation.config (manually or using the Web UI to register a new base monitor).

I_AGREE_TO_THE_EULA

string

Providing this parameter means that you consent to Redgate's SQL Monitor EULA found at https://red-gate.com/sqlmonitor/eula.

Mandatory

Executing the installation 

You can run the msi directly or run it with msiexec.exe, providing additional parameters if needed, e.g. msiexec.exe /i base.msi /qn /norestart DATACONNECTION="..."

Website Installation and Update

Both installation and update of the website use the same command-line options.

Example: Installing the website (self-hosted) using the Windows command prompt:

web.msi I_AGREE_TO_THE_EULA=yes

Example: Installing the website (self-hosted) using PowerShell:

.\web.msi I_AGREE_TO_THE_EULA=yes

Example: Installing the website (IIS) using the Windows command prompt:

web.msi I_AGREE_TO_THE_EULA=yes SERVICETYPE=IIS WEBSITE="C:\Program Files\Red Gate\SQL Monitor\Web\"

Example: Installing the website (IIS) using PowerShell

Start-Process ".\web.msi" -ArgumentList @"
I_AGREE_TO_THE_EULA=yes SERVICETYPE=IIS WEBSITE="C:\Program Files\Red Gate\SQL Monitor\Web\"
"@

Base Monitor Installation and Update

Both installation and update of the base monitor use the same command-line options.

Example: Installing the base monitor using the Windows command prompt:

.\base.msi I_AGREE_TO_THE_EULA=yes SERVICETYPE=user SERVICEDOMAIN=my-domain SERVICEUSERNAME=my.user SERVICEPASSWORD=ThisIsSecret DATACONNECTION="Server=.;Database=RedGateSqlMonitor;Trusted_Connection=True"

Example: Installing the base monitor using PowerShell:

Start-Process ".\base.msi" -ArgumentList @"
I_AGREE_TO_THE_EULA=yes SERVICETYPE=user SERVICEDOMAIN=my-domain SERVICEUSERNAME=my.user SERVICEPASSWORD=ThisIsSecret DATACONNECTION="Server=.;Database=RedGateSqlMonitor;Trusted_Connection=True"
"@



Do you have any feedback on this documentation?

Let us know at sqlmonitorfeedback@red-gate.com


Didn't find what you were looking for?