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

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 Download

Top Tags


View all Tags

Problems mixing float and non-float values in XML/EXE sensor

Votes:

0

Your Vote:

Up

Down

I'm using a powershell script to generate XML output for a custom sensor (EXE/Script Advanced), and it seems I've found a small issue. I'm unable to mix float and non-float channels in the same sensor - if I have any channels where the value returned "looks like" a float but the channel is not set with float=1, then the value is ignored and channel is set to 0.

For example, my XML contains: <prtg> <result> <channel>Test1</channel> <value>212894.00</value> <unit>Custom</unit> <customUnit>#</customUnit> </result> <result> <channel>Test2</channel> <value>257160.00</value> <unit>Custom</unit> <customUnit>#</customUnit> <float>1</float> </result> <result> <channel>Test3</channel> <value>257160</value> <unit>Custom</unit> <customUnit>#</customUnit> </result> </prtg>

In the above set, channel "Test1" displays as "0" in PRTG, Test2 is ok (displays as a float), and Test3 is also ok (displays as an integer).

It seems PRTG cannot convert the string "212894.00" to an integer even though it should be able to convert it...

Is this a known issue? I have put in a (fairly ugly) workaround in my powershell script to get around this, but would like to know if there's a better approach.

Thanks.

custom-sensor exexml prtg xml

Created on Mar 10, 2014 7:06:06 PM by  alexism (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

This is intended. The return value must be in the proper format. An integer value which contains a decimal point is not considered an integer even if the decimal places are all zero.

If the value cannot be parsed because it is not an integer by format, the default ("0") will be used.

Created on Mar 11, 2014 1:50:49 PM by  Arne Seifert [Paessler Support]



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.