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

EXE/Script Customer Sensor - passing value not working



I've got a PowerShell script that grabs a count of SSL-VPN sessions from a Sonicwall.
The script runs fine, and when it exits, it exits as follows:


{other script statements up here....}\\

$intLine ++

$retmsg = "SSLVPN_Sessions"
$output = ("{0}:{1}") -f $intLine,$retmsg
Write-Host $output
exit $output

The EXE/Script sensor doesn't throw any errors, but always displays a value of '1' in the Value channel (I named the channel SSLVPN_Sessions with a type of Integer).

When I run the script manually, it outputs the count that I want as follows:


The count changes each time the script fires (as it should), but the Channel value on the sensor never changes from '1'. It never changes to reflect the actual count returned by the script.

Any idea what I could be doing wrong?

Thanks in advance

powershell script sensor

Created on Apr 24, 2020 9:11:50 PM

Last change on Apr 27, 2020 9:45:09 AM by  Birk Guttmann [Paessler Support]

4 Replies



Hi there,

For an easier troubleshooting, I would recommend to write the results this script gets to a file. Please enable "Write result to disk" in the sensor's "Settings" tab. With the next scan it will write one or several result-files into C:\ProgramData\Paessler\PRTG Network Monitor\Logs\Sensors of your PRTG server (or on the Remote Probe if applicable). All files have the sensor's numeric ID in their filenames. The sensor ID can be found on the sensor's "Overview" tab. ​ Please let us know if you can find the issue there. ​

Kind regards,
Birk Guttmann, Tech Support Team

Created on Apr 27, 2020 9:49:20 AM by  Birk Guttmann [Paessler Support]



Gentlemen, Did it work? I need to apply this Script to my PRTG as well. Can you validate?

Created on Aug 13, 2020 4:39:53 PM



Hi Thiago,

I'm afraid, the whole script was not shared by the customer here. You need to write your own one. If you need help to implement the script to PRTG accordingly, we can assist here.

Kind regards,
Birk Guttmann, Tech Support Team

Created on Aug 14, 2020 8:50:06 AM by  Birk Guttmann [Paessler Support]



Hi Thiago,
Please replace:

exit $output


exit 0

Or one of the other values as listed below:

Value	Description
0	OK
2	System Error (e.g. a network/socket error)
3	Protocol Error (e.g. web server returns a 404)
4	Content Error (e.g. a web page does not contain a required word)

Sensors | Multi Channel Sensors | Tools | Notifications

Kind regards,

[[http://prtgtoolsfamily.com]] PRTG Tools Family

Created on Aug 14, 2020 1:38:29 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.