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

Sensor/channel ID's as placeholders in python script

Votes:

0

Is it possible to use the ID's of channels and sensors as placeholders in a python script, save them in a value and then compare those values in the script?

If it is, what are the placeholders for the channel and sensor ID so that I can use those in a script?

placeholders python-script-advanced-sensor sensorid

Created on Apr 19, 2018 1:17:14 PM



6 Replies

Votes:

0

Hello there,

Thanks for your inquiry, we appreciate your contact regarding this matter!

Unfortunately, those placeholders are not available, but you can run API calls in the script to get live data from specified sensors. You can find a manual for those calls in "Setup > API > Live Data".

Please let me know, if that fits your requirements.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Apr 20, 2018 12:47:39 PM by  Birk Guttmann [Paessler Support]



Votes:

0

Hello,

thanks for the reply. Too bad the placeholders do not exist, I had hoped to use those to make the script dynamic and maybe save it in a device template.

Hardcoding the API link means making a different script for every single device or changing the API url whenever the script needs to run on a different device.

Is there no way to dynamically get sensor/channel ID's into a python script? This would also be great in relation to templates/Auto-Discovery.

Created on Apr 20, 2018 1:33:53 PM



Votes:

0

Hello there,

You can use the set placeholders in the corresponding API calls to make it more dynamic.

You can find a list of placeholders in this KB post.

Please let me know, if that fits your requirements.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Apr 23, 2018 10:00:37 AM by  Birk Guttmann [Paessler Support]



Votes:

0

Hello,

The placeholders you linked are unfortunately not what I am looking for. Since I want to use the script in a template it will need more work than just getting a sensor OID. I need to compare the sensors names that are in the template or something.

I think I need to go through the API and look at the sensors listed under the device that was just configured through auto-discovery and get the sensors with specific names and their corresponding OIDs. I could then concatenate those sensor IDs to the API request and get the live data I need.

Created on Apr 23, 2018 12:25:11 PM



Votes:

0

Please let us know, if you need further information.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Apr 24, 2018 1:53:15 PM by  Birk Guttmann [Paessler Support]



Votes:

0

Hello,

I do not need more information, as I have decided to leave the Python script as it is. I will document it for later use, it might be interesting for other applications.

Created on Apr 25, 2018 6:54:28 AM




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.