I am trying to create a new Python sensor. This sensor should output a value based on a custom lookup file (https://www.paessler.com/manuals/prtg/define_lookups). This documentation doesn't show this function to be available in Python sensors.

I found the documentation for the CustomSensorResult function in "C:\Program Files (x86)\PRTG Network Monitor\python\Lib\site-packages\prtg\sensor\result.py". Here I also am missing a way to include this option in the JSON I present to PRTG.

Is there a way for me to make this work? Or should this be a feature request for a future release?


Article Comments

Hi there,

Did you also checked the file located here: "C:\Program Files (x86)\PRTG Network Monitor\python\Lib\site-packages\prtg\sensor\result.py"

In this file, you can read the following:

        @param value_lookup: ID of a lookup file to use, e.g. to convert integer
                             status return values into actual names. Default is
                             None.

Therefore, you should be able to use lookup files via this parameter


Nov, 2020 - Permalink

Thanks for the quick reply. I have found the reference and indeed, if I add "value_lookup='prtg.customlookups.###'" the lookup file is used.

This will help me out in designing more sensors with less performance impact than the PowerShell sensors.


Dec, 2020 - Permalink