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

Please add parent, children and dependency info to API call for device / sensor info

Votes:

1


Want this feature implemented, too? Please upvote by clicking Thumbs up!


User Story

As a PRTG User, I want to easily find children, parent objects when I request all info on an object (sensor, device and group) with an API call.

As a PRTG User, I want to to able to get the dependency option chosen and if applicable I want to see what object it is dependent off.

Details of User Story

We're working on compliancy scripts to check if all objects in PRTG are set to our standards. These scripts are necessary because our environment is too big to check it by manual means. For this we would like to have a value parent, children and dependency with information we can filter on to check if everything is set as it's supposed to be.

We're thinking that a json or xml array would be easiest for usage ("sensor name":"id"}. So if device JUNOS-SWITCH has 3 sensors it would have something like to following:

Parent: '{"LAN":18721} ' Children: '{ "Ping":18723, "Temperature":18724, "Uptime":18725}'

In the case of dependency it is for the same reason but there is more variety in options, but I think it's easily solvable like:

Dependency: '{ "Option":"Select Object", "Ping":18723} Dependency: '{ "Option":"Master of parent"}

api compliancy-scripting prtg

Created on Jun 28, 2019 6:49:00 AM



4 Replies

Votes:

1

Hi twanvansomeren,

You don't need new functionality added to PRTG to achieve that - you can do this fairly easily using PrtgAPI

$devices = Get-Device -Tags junos

foreach($device in $devices)
{
    $sensors = $device | Get-Sensors

    # Check you have all the desired sensor types and maybe generate a PSCustomObject to be used for generating a CSV report
}

Paessler did a blog post about PrtgAPI a few months ago demonstrating a script that adds notification triggers to desired sensor types. You can see in the provided screenshots that part of this involves alerting on when a required child sensor is not present on a given device (highlighted in magenta). See the attached sample files on the blog post for more details on how these checks are being done in a proper manner

Regards,

lordmilko

Created on Jun 28, 2019 8:20:32 AM



Votes:

0

Hi Lordmilko,

I was aware of the C#/powershell interface but we're working with Python and the HTTP request side of the API. I could work in the C# / Powershell commands but that still leaves the dependency part. After inspecting the network calls the browser makes to prtg it is collected via html and filtering it is absolutely horrible, isn't this a good option to add to the information you can collect over API?

Regards,

Twanvansomeren

Created on Jun 28, 2019 10:54:58 AM



Votes:

0

All the properties found on the Settings page of an object can only be returned via HTML, which PrtgAPI does have to clean up to provide a clean interface to the user.

Dependency properties can be retrieved directly using the setobjectproperty.htm function

api/getobjectproperty.htm?id=2062&name=dependency&username=prtgadmin&passhash=12345678

2071

api/getobjectproperty.htm?id=2062&name=dependencytype&username=prtgadmin&passhash=12345678

1

A dependency type of 1 means "object"

Created on Jun 28, 2019 11:22:31 AM



Votes:

0

With this I'll know what is set at the moment, I won't be able to check if its the correct setting according to our design because no other information is given and I cannot connect it to a parent of child (even after getting al info from the ID that's given back) Also, if no object is set (option Master of Parent) the information field remains empty. I get that the information can be retrieved but it isn't in an efficient way. It's a lot more workable if all information is in 1 main field, in the field of the object (sensor, device or group shouldn't matter).

Created on Jun 28, 2019 12:04:32 PM




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.