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?


Article Comments

Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.

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.


Feb, 2022 - Permalink