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

Can't "Enable alerting based on limits" via Script

Votes:

0

Hello,

I can't seem to enable "Enable alerting based on limits" via my script.

As far as I'm concerned, you have to set <LimitMode>1</LimitMode> to do so. LimitMaxWarnings and LimitMaxError are written to the channel just fine.

Here is my script: Write-Host "<?xml version="1.0" encoding="UTF-8" ?>" Write-Host "<prtg>" Get-ChildItem "MY PATH" -Recurse -include *.nsf | Where-Object {($_.Length -gt "5e+10")} | ForEach-Object { [string]$filename = $_.Name [float]$filesize = $_.Length Write-Host "<result>" Write-Host "<Channel>$filename</Channel>" Write-Host "<Value>$filesize</Value>" Write-Host "<CustomUnit>GB</CustomUnit>" Write-Host "<VolumeSize>GigaByte</VolumeSize>" Write-Host "<Float>1</Float>" Write-Host "<DecimalMode>Auto</DecimalMode>" Write-Host "<LimitMode>1</LimitMode>" Write-Host "<LimitMaxWarning>53687091200</LimitMaxWarning>" Write-Host "<LimitMaxError>64424509440</LimitMaxError>" Write-Host "</result>" } Write-Host "</prtg>"

As a result I get separate channels for all .NSF files above 50 GB with their filesize in GB as value for the given PATH.

e.g.:

But in the channel settings Value Lookup and Limits is set to

Although when I manually switch it to Enable alerting based on limits LimitMaxWarning and LimitMaxError are set correctly:


My question is, how can I Enable alerting based on limits by default via my script?

Thanks in advance! lukas_sch

channel limitmode powershell prtg script

Created on Mar 16, 2018 3:01:14 PM



Best Answer

Accepted Answer

Votes:

0

Issue has been resolved with the following update:

Created on Mar 21, 2018 12:57:39 PM



3 Replies

Votes:

0

Hi there,

I am sorry for all the work you put into the explanation above, but the answer is simple. It is currently a bug due to the change of the alerting. So in the next version which will be released in the next weeks, the Limits will work again from Custom Scripts.

Sorry for the hassle. :(

Best regards.

Created on Mar 16, 2018 5:24:17 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hey Dariusz,

thanks for the quick reply! :)

~ lukas_sch

Created on Mar 19, 2018 7:29:57 AM



Accepted Answer

Votes:

0

Issue has been resolved with the following update:

Created on Mar 21, 2018 12:57:39 PM




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.