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

21.3.69.1333 upgrade seemed to break some Custom Sensors EXE scripts used to query AWS

Votes:

0

After upgrade from 21.2xxxxxxx It seems like PRTG is no longer processing some aws cli commands inside powershell scripts that are run on a probe server. These were working before the upgrade.

We verified that our prtguser account is able to run these commands/scripts correctly when logged in to the probe and return accurate values. However, when we test cycle a sensor from the PRTG GUI to update results, the Aws cli commands are not returning values, so the sensor either fails or returns a 0.

Mostly hoping we are not the only ones having this issue.

aws aws-cli powershell prtg

Created on Jul 28, 2021 8:11:32 PM



5 Replies

Votes:

0

Hi there,

Please let me know whether you use "Write-host" or "Write-Output" in your script? Due to security hardening, "Write-host" does not work properly. Therefore, please use "Write-Output"

Created on Jul 30, 2021 1:42:37 PM by  Moritz Heller [Paessler Support]



Votes:

0

Hello Moritz, I was really hoping that would be the answer! I tried it and the output is similar, but I am still having other errors on sensors:

\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\get-average_cpu_running_webapi.ps1:22 char:5 + $avgvalue=[math]::Round($avg) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], ArgumentExceptio

Also, I noticed that the output is slightly different using write-output:

with write-host, the output is

15 :ok

with writeoutput the output is

16
:ok

snipet from powershell

 PS C:\Windows\system32> C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE\get-average_cpu_running_webapi.ps1
3
checking metrics for i-0a2f18952c91c1d53
checking metrics for i-0bdebe74e9fc39bd5
checking metrics for i-045b1226f40f06f65
15 :ok

PS C:\Windows\system32> C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE\get-average_cpu_running_webapi.ps1
3
checking metrics for i-0a2f18952c91c1d53
checking metrics for i-0bdebe74e9fc39bd5
checking metrics for i-045b1226f40f06f65
16
:ok

Created on Aug 2, 2021 12:57:27 PM

Last change on Aug 2, 2021 3:11:14 PM by  Felix Wiesneth [Paessler Support]



Votes:

0

Hi John,

Thank you for the update. It seems like that the issue is located in the script code itself. Therefore, I cannot help much here. Did you validate that the script works in a 32bit Powershell?

Created on Aug 3, 2021 12:13:41 PM by  Moritz Heller [Paessler Support]



Votes:

0

Hello Moritz, Thank you for your reply. The issue may be in the script, but the script was working until the PRTG update. I am not familiar with difference of Powershell 32 bit versus 64 bit. Can you please elaborate to help me understand the difference as it relates to PRTG sensors? Our Probe servers do not show that there are 2 versions of Powershell I can use (we use Powershell ISE running as admin when testing our scripts, no 32 bit or 64 bit is specified in the GUI) . How would you specify to use a 32 bit version to test running the scripts?

Created on Aug 3, 2021 12:40:56 PM



Votes:

0

Hi there,

Please note that I cannot support custom script code. Therefore, I can only troubleshoot issues with PRTG related features.

Every up-to-date Windows OS has Powershell 32bit and Powershell 64bit available. If you search the ISE you should find a (x86) version and a "normal" version which is 64bit.
In addition, in the PRTG version "21.2.67.1562" we increased the security of Powershell scripts in PRTG:

We fixed an issue with the parameter handling of custom EXE/Script sensors that occurred when the experimental feature PowerShell Security Enhancement was enabled. The issue could lead to non-functional EXE/Script sensors in some cases.

Created on Aug 4, 2021 6:46:00 AM by  Moritz Heller [Paessler Support]




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.