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

PowerShell Script Output Value Showing as 0%

Votes:

0

I have a Powershell script that is doing some free space calculation. In PRTG is shows the last channel value as 0%, min and max also at 0%.

I have enabled the debugging on the sensor and have it output being written to disk. Here is the output

<result> <channel>Space Remaining (%)</channel> <unit>Percent</unit> <value>23.96</value> </result>

If I changed the script to not multiple the value by 100 (not sure if PRTG does that since its unit is Percent) I get the output below, but the value is still 0% in PRTG.

<result> <channel>Space Remaining (%)</channel> <unit>Percent</unit> <value>0.24</value> </result>

custom percent powershell

Created on Apr 22, 2022 5:23:08 PM



2 Replies

Votes:

0

Hi,

Since your value is a float value you will need to define this in your xml. Otherwise PRTG will display 0. For this just add following:

<Float>1</Float>

The default is 0 (no). If set to 1 (yes), PRTG will show your values.

If you want, you can also define the decimal places with the <DecimalMode> element.


Kind regards

Felix Wiesneth - Team Tech Support

Created on Apr 26, 2022 7:27:24 AM by  Felix Wiesneth [Paessler Support]



Votes:

0

Ah I see, I just went and adjusted the Powershell script to round the numbers instead and all is coming out as expected. Thanks!

Created on Apr 26, 2022 4:43:55 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.