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


PRTG Python Library Documentation?

Votes:

0

Your Vote:

Up

Down

Hi,

I've successfully created a test Python script for PRTG however I faced a few problems along the way. The documentation in the KB (https://www.paessler.com/manuals/prtg/custom_sensors) seems to be focused on everything other than Python.

Specifically, I'm looking for information about the functions in the PRTG Python library. The example script located within the PRTG installation imports two functions (prtg.sensor.result.CustomSensorResult and prtg.sensor.units.ValueUnit) but are there more? Does documentation exist for the two functions mentioned?

Using CustomSensorResult.add_primary_channel(), I wanted to define a "CustomUnit" but I don't know the syntax. The KB article linked above lists the XML equivalent but nothing for Python.

Any help would be greatly appreciated.

Thanks!

custom-sensor python python-script-advanced-sensor

Created on Jun 5, 2020 8:49:05 AM by  MediumToast (50) 1 1



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hi,

I did some digging and found documentation exists within the PRTG .py files in the installation directory: %Program Files (x86)%\PRTG Network Monitor\python\Lib\site-packages\prtg

To answer my specific question regarding CustomUnits, I found this: @param unit: The sensor value's unit. If the unit is not a known PRTG unit, the unit is set to CUSTOM and the custom unit is set to the string in unit. Default is CUSTOM with custom unit set to '#'. @type unit: ValueUnit or str I also realised after posting, the value of "unit" is only read on the first scan. I was able to define the value in the PRTG management interface afterwards.

Thanks

Created on Jun 8, 2020 6:23:33 AM by  MediumToast (50) 1 1



2 Replies

Votes:

0

Your Vote:

Up

Down

Hi there,

we have no documentation from more functions build in our Python library. However, we have an guide how to import modules in python scripts which will access you to write modules or import existing one to receive more function.

Created on Jun 8, 2020 6:01:46 AM by  Moritz Heller [Paessler Support]



Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hi,

I did some digging and found documentation exists within the PRTG .py files in the installation directory: %Program Files (x86)%\PRTG Network Monitor\python\Lib\site-packages\prtg

To answer my specific question regarding CustomUnits, I found this: @param unit: The sensor value's unit. If the unit is not a known PRTG unit, the unit is set to CUSTOM and the custom unit is set to the string in unit. Default is CUSTOM with custom unit set to '#'. @type unit: ValueUnit or str I also realised after posting, the value of "unit" is only read on the first scan. I was able to define the value in the PRTG management interface afterwards.

Thanks

Created on Jun 8, 2020 6:23:33 AM by  MediumToast (50) 1 1



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.