Hello,
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:

110:SSLVPN_Sessions

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


Article Comments

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


Apr, 2020 - Permalink

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


Aug, 2020 - Permalink

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


Aug, 2020 - Permalink

Hi Thiago,
Please replace:

exit $output

With:

exit 0

Or one of the other values as listed below:

Value	Description
0	OK
1	WARNING
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


Aug, 2020 - Permalink