This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Relationship between device and group exposed in xml?

Hi,

 

Ive written a c# app to take a clone of a servers monitors rewrite the xml to modify the server/ip/fqdn etc properties and write it back which works really well. However i want to be able to read the members of a group i.e. put a set of devices in a templates group and use those as the basis for my cloning.

What i cant do is find a way to determine the parentid of a device as it always seems to be 0, so i cant read determine what devices belong to a specific group. There doesnt seem to be a soap call that returns a list of groups within a group either which would have been my preference.

So is there another way to find a devices parent? or group membership?

 

Regards

 

Joe

  • Hi Joe,

    The reason devices always have a parentid of 0 is they can belong to multiple groups.  You have to look in the xml of the group itself to see what devices belong to it.

    So for instance if you look at the xml for a group called "test" that has 2 devices within you would see 2 items under the "col" branch that represent the device id's (7903989331242 and 293306577447 ). To add more devices to the group you would just add more <u#> branches under the <col> branch for each device you want to include.

    Example of <col> branch:

     <col>
    <u0>7903989331242</u0>
    <u1>293306577447</u1>
    </col>


    Regards,
    Matt
  • Many thanks Matt,

    I knew it had to be there somewhere.

    Regards

     

    Joe