Skip to content
lordmilko edited this page Jan 23, 2021 · 13 revisions

Contents

Server

After cloning the PrtgDocker repo to your computer and placing an installer under the repo path, PRTG Core Server images can be created by simply invoking New-PrtgBuild and New-PrtgContainer from the build.cmd PowerShell prompt. In some scenarios however, you may wish to customize your images using the various additional parameters that the cmdlets provide to you.

Image Creation

PRTG Core Server images can be created by simply invoking the New-PrtgBuild cmdlet. When building PRTG Core Servers, simply place a one or more PRTG Core Server installers in the PrtgDocker folder, or alternatively specify the -Path to a folder containing the installers you wish to containerize. PrtgDocker will automatically iterate over each installer provided, copying the installer to a temporary build context so that unnecessary files aren't copied each image, inflating the image size.

# Process all installers under the repo root
New-PrtgBuild
# Process all installers in a specified folder
New-PrtgBuild -Path C:\Installers

In case you only wish to process a subset of installers in the specified folder, you can specify an optional -Name, filtering the candidates to a specified wildcard pattern.

# Process all installers for PRTG 18.x in a specified folder
New-PrtgBuild *18* C:\Installers 

The following table describes the parameters that can be specified to New-PrtgBuild when creating a PRTG Core Server

Parameter Default Description
-Name * Wildcard specifying the installers to process
-Path $PSScriptRoot Path to the folder containing the installers to process
-BaseImage ltsc2019 Specifies the base image to use for the image (ltsc2016, ltsc2019, etc)
-AdditionalArgs null Specifies additional args to be specified to the call to docker build
-SkipExisting False Specifies that PRTG installers that already have images should be skipped
-Force False Specifies to force rebuild Docker images without using the build cache
-HyperV False Specifies that the image should be built using Hyper-V isolation
-PrtgEmail [email protected] Specifies the email address to use for the PRTG Administrator account
-LicenseName prtgtrial Specifies name of the user the license is assigned to
-LicenseKey Trial Key Specifies the license key to use for the installation
-Credential null Specifies the credential to use to connect to the Docker host when $env:DOCKER_HOST is specified on a remote workstation
-Repository prtg Repository to use for the image
-Server False Specifies that large files should be passed to the build over a web server (reducing the size of the image)

For most users, only the parameters -Name, -Path and -AdditionalArgs will be of interest. For a stock build on Windows Server 2019 with a single installer copied to the repo root, no parameters are required.

Container Creation

If you've only ever built an image for a single version of PRTG Network Monitor, a new PRTG Core Server container can be created as simply as follows

New-PrtgContainer

In reality, you'll probably want to specify additional configuration options (like saving the PRTG Configuration files to a persistent -Volume).

The following table describes the parameters that can be specified to New-PrtgContainer when creating a PRTG Core Server

Parameter Default Description
-Tag * Specifies the tag of the image to create a container from. Wildcards can be used, however if multiple candidates are found an exception is thrown
-Name null Specifies the name to assign the container
-Volume False Specifies that a volume should be created for the container
-Port 8080:80 Specifies the ports to expose on the host and how they should redirect to the container
-Repository prtg Specifies the repository containing the -Tag to create a container for
-Interactive False Specifies that the container should be launched in interactive mode, allowing you to see the console
-HyperV False Specifies that the container should run using Hyper-V isolation
-CustomSensorsPath null Specifies a custom UNC path to redirect the Custom Sensors folder to
-CredentialSpec False Specifies that a Credential Spec should be used for Active Directory authentication within the container
-CredentialSpecAccount null Specifies the account to use for creating a credential spec if one doesn't already exist
-AdditionalArgs null Specifies additional args to be added to the call to docker run
-RestartPolicy Always Specifies the circumstances under which the container should automatically be restarted. Possible values: Always, OnFailure, UnlessStopped, None

PRTG Core Server containers periodically check the health of the PRTG Server process, once every second. PRTG Core Server containers automatically stop when the PRTG Server.exe process is terminated and remains terminated after a 10 second delay.

When -Volume is specified, PrtgDocker automatically redirects your Custom Sensors folder to your volume (C:\ProgramData\docker\volumes\<containerName>\_data) to allow adding and persisting files from within the Docker host's filesystem. If you intend to also have a number of PRTG Remote Probes (whether containerized or not), to duplicating your custom sensors between each system it is recommended to redirect your Custom Sensors folder to a common network share. For more information on redirecting the Custom Sensors folder, please see Custom Sensors Redirection.

Clone this wiki locally