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

Advanced Script/EXE string return

Votes:

0

Hello, I have written a PowerShell script that let me count the number of Remote Desktop sessions that are UP on a specified server. I would like this sensor to also return sessions informations such as Name and ID of the session, but it seems like Script sensors only accept numeric values.

Is there a way to show informations in string or Array format inside my sensor or my device?

custom-sensor format powershell script text

Created on Feb 4, 2022 10:44:24 AM



1 Reply

Votes:

0

Hello,

Thank you for your message.

Regarding what you would like to achieve, PRTG indeed only support numerical (integer, float) values which it can monitor. Nevertheless, you have the possibility to display a string in the sensor message field by following the format of your sensor: https://www.paessler.com/manuals/prtg/custom_sensors.

For the EXE/Script sensor, you can return a string with the value as follow: "<value>:<message>". However, with the EXE/Script Advanced sensor, you need to use the "text" key such as illustrated below:

  • XML
<prtg>
<result>
<channel>Channel</channel>
<value>Value</value>
</result>
...
<text>STRING</text>
</prtg>
  • JSON
{
     "prtg": {
         "result": [
             {
                 "channel": "Channel",
                 "value": Value
             }
         ],
         "text": "STRING"
     }
}

If you have questions, do not hesitate.

Regards.

Created on Feb 7, 2022 6:48:46 AM by  Florian Lesage [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.