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.
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

Using Lookups output in Python sensor

Votes:

0

Your Vote:

Up

Down

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?

json lookups python

Created on Nov 18, 2020 12:07:54 PM by  Rein Leen (23) 1



2 Replies

Accepted Answer

Votes:

1

Your Vote:

Up

Down

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

Created on Nov 19, 2020 9:04:56 AM by  Moritz Heller [Paessler Support]



Votes:

0

Your Vote:

Up

Down

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.

Created on Dec 8, 2020 2:50:22 PM by  Rein Leen (23) 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.