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

PowerShell XML Custom EXE/Script Sensor return 0

Votes:

0


Hello everyone,

I am quite stuck on this one,
I made a PowerShell script that parse a table from a web page to an array in order to render the result on PRTG.

The end of the script is as follow :

$value = $MyArray['value:']
$valueint = [int]$value

write-host "<prtg>"
           "<result>"
           "<channel>Number of Value</channel>"
           "<value>$valueint</value>"
#          "<warning>1</warning>"
           "</result>"
#          "<text>The number of Value on the Web Page is $valueint</text>"
           "</prtg>"

When I create the sensor, the channel gets created but the value is 0
The warning and text are working, but it’s written “..Web Page is 0”.
The executionpolicy is set as unrestricted on the server where the remote probe is running.
When I run the script on the server, I get the actual value.
The credentials for the device in PRTG are from the same domain admin that I use to do the test on the server.

I have seen that if the variable is not an integer, PRTG will just get 0 as a result but I think that it's not the case here
What am I missing ?

0 custom exe-script powershell return sensor xml

Created on Aug 4, 2018 2:38:45 PM



1 Reply

Votes:

0

Hi there!

In order to debug this further, we need some additional log files.

Please enable "Write Results to Disk" in the sensor's setting and forward us the logfile after waiting a few minutes. Please find the log in the folder "C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)" on the probe, the sensor is running on.

Please find the right files by looking for the numerical sensor ID in the filename. You can find the ID in the sensors "Overview" page on the right. Please send us these files to [email protected], referring to the ticket "PAE1072524"

Thank you!


Andreas Günther
Tech Support, Paessler AG

Created on Aug 7, 2018 5:28:41 AM by  Andreas Günther [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.