New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


EXE/Script Customer Sensor - passing value not working

Votes:

0

Your Vote:

Up

Down

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

powershell script sensor

Created on Apr 24, 2020 9:11:50 PM by  epgalli (10) 1

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



4 Replies

Votes:

0

Your Vote:

Up

Down

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]



Votes:

0

Your Vote:

Up

Down

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 by  Thiago Ferreira Patricio (0) 1



Votes:

0

Your Vote:

Up

Down

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]



Votes:

0

Your Vote:

Up

Down

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

Created on Aug 14, 2020 1:38:29 PM by  PRTG Tools Family [prtgtoolsfamily.com] (13,163) 3 4



Please log in or register to enter your reply.


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.