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"}
Article Comments
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
Jun, 2019 - Permalink
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"
Jun, 2019 - Permalink
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).
Jun, 2019 - Permalink
Hi twanvansomeren,
You don't need new functionality added to PRTG to achieve that - you can do this fairly easily using PrtgAPI
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
Jun, 2019 - Permalink