What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

PRTG API - Business Process Specific Settings



Hi everyone,

I need to modify a business process sensor through API. In that business process sensor we have a business process specific settings section and we don't manage to change object id value for a specific channel name :


In this case, we would like to change #3938 by #4561 for example.

We tried a lot of things such as :


Thanks for your help

api businessprocess channelsettings prtg

Created on Aug 14, 2019 1:35:18 PM

6 Replies

Accepted Answer



Business Process channel definitions are stored by PRTG using JSON under the businessprocessdefinitions property. As such, if you want to modify any part of these definitions the easiest way to do this is to retrieve the existing definition, modify it as required and then resubmit it back to PRTG.

The following API call retrieves the businessprocessdefinitions property of the object with ID 2101


Example output:


You can then modify this as desired, URL encode this and resubmit it back to PRTG via the editsettings endpoint


It's not exactly a smooth process, however it can be relatively straight forward using PowerShell with PrtgAPI

$sensor = Get-Sensor -Id 2101
$original = $sensor | Get-ObjectProperty -RawProperty businessprocessdefinitions_
$new = $original -replace "someChannelName","newChannelName"
$sensor | Set-ObjectProperty -RawProperty businessprocessdefinitions_ -RawValue $new -Force



Created on Aug 15, 2019 9:30:20 AM



Thank you lordmilko, very useful :)


I didn't succeed to replace values with URL Encode :

editsettings?id=2101&businessprocessdefinitions_=%5B%7B%22objects%22%3A%5B%5D%2C%22warningthreshhold%2 2%3A75%2C%22errorthreshhold%22%3A50%2C%22channelname%22%3A%22channel1%22%7D%2C%7B%22objects%22%3A%5B%5D%2C%22warningthres hhold%22%3A75%2C%22errorthreshhold%22%3A50%2C%22channelname%22%3A%22newchannel2%22%7D%5D

I use this decoded url :


Encoded in this way :


To use in this way (i'm on PowerShell 6.2) :

Invoke-WebRequest "https://$($properties.server)/api/editsettings%3Fid%3D4454%26businessprocessdefinitions_%3D%5B%7B%22objects%22%3A%5B4455%5D%2C%22warningthreshhold%22%3A75%2C%22errorthreshhold%22%3A50%2C%22channelname%22%3A%22aa%22%7D%2C%7B%22objects%22%3A%5B4456%5D%2C%22warningthreshhold%22%3A75%2C%22errorthreshhold%22%3A50%2C%22channelname%22%3A%22bb%22%7D%5D%0A&username=$($properties.username)&passhash=$token" -SkipCertificateCheck

Always I get an error "Invoke-WebRequest : Unauthorized".

I'm on PowerShell so the module is really interesting :

$sensor = Get-Sensor -Id 2101 $original = $sensor | Get-ObjectProperty -RawProperty businessprocessdefinitions_ $new = $original -replace "someChannelName","newChannelName" $sensor | Set-ObjectProperty -RawProperty businessprocessdefinitions_ -RawValue $new -Force

But we use a self-signed certificate with HTTP disabled. The module works with a valid SSL certificate or with HTTP but not in HTTPS with a self-signed certificate. Even if I use -IgnoreSSL parameter I get this error :

Connect-PrtgServer : The remote certificate is invalid according to the validation procedure.

I'm going to glance at the module code but I'm not very skilled in C#.

Created on Aug 16, 2019 8:14:45 AM



If you're using a self-signed certificate you need to specify -IgnoreSSL

You also need to make sure you're connecting to the hostname of the server, not the IP Address

If you've messed with the TLS settings of your PRTG server, you'll also need to change the TLS mode to 1.2

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Ultimately, both PrtgAPI and Invoke-WebRequest are using .NET to execute their requests, so once you get it working for one you'll have an idea as to what needs to occur for it to be working for the other, however it's worth noting that PrtgAPI does not yet fully support PowerShell Core, so I would recommend using Windows PowerShell for now

Created on Aug 16, 2019 9:28:58 AM



"PrtgAPI does not yet fully support PowerShell Core, so I would recommend using Windows PowerShell for now"

  • Fair enough, it works on PowerShell 5.1 ! Thanks

On the other hand I can't change business process settings :(

$sensor = Get-Sensor -Id 4454 ID 4454 refers to the business process sensor.

$original = $sensor | Get-ObjectProperty -RawProperty businessprocessdefinitions_ $new = $original -replace '[{"objects":[4455],"warningthreshhold":75,"errorthreshhold":50,"channelname":"aa"},{"objects":[3939],"warningthreshhold":75,"errorthreshhold":50,"channelname":"bb"},{"objects":[3940],"warningthreshhold":75,"errorthreshhold":50,"channelname":"cc"}]'

IDs 4455, 3939, 3940 refer to objects ID (sensors that are used in channels).

$sensor | Set-ObjectProperty -RawProperty businessprocessdefinitions_ -RawValue $new -Force

I've no errors in PowerShell but refreshing PRTG I don't have what I expect, objects ID for each channel name in business process specific settings aren't changed :s any idea ?

Thanks a lot

Created on Aug 16, 2019 12:07:43 PM



There are two issues with this line

$new = $original -replace '[{"objects":[4455],"warningthreshhold":75,"errorthreshhold":50,"channelname":"aa"},{"objects":[3939],"warningthreshhold":75,"errorthreshhold":50,"channelname":"bb"},{"objects":[3940],"warningthreshhold":75,"errorthreshhold":50,"channelname":"cc"}]'

1. The idea of using -replace is that you simply specify a single known value in the unknown JSON string you want to replace (such as an object ID, channel name, etc). Specifying the whole entire string defeats the purpose

2. Your syntax to the -replace parameter is incorrect. The syntax for using -replace is -replace <original>,<new>, however it appears to me in your line you simply wrote -replace <original> - replace it with what!

I successfully changed the ID of a Business Processes sensor channel from 2058 to 2059 by performing the following

# Get the sensor, and get the original definition
C:\> $sensor = get-sensor -id 2101
C:\> $original = $sensor | get-objectproperty -RawProperty businessprocessdefinitions_

# Inspect the original definition for good measure
C:\> $original

# Update the definition somehow and inspect our changes for good measure
C:\> $new = $original -replace 2058,2059
C:\> $new

# Update the sensor
C:\> $sensor | set-objectproperty -rawproperty businessprocessdefinitions_ -rawvalue $new -force

# Inspect the result for good measure
C:\> $sensor | get-objectproperty -RawProperty businessprocessdefinitions_



Created on Aug 16, 2019 2:17:48 PM



Thanks for your explanation it works !

Created on Aug 21, 2019 5:32:10 AM

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.