question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get-Group -ParentID 1 | Lists to wrong Groups

See original GitHub issue

Describe the bug

We have the Core Server Object (Probe, with ID 1). In there is 1 Group with 1 Device. In there are some Sensors.

Our Script is calling the Function: get-Group -ParentID x This works with the Probe ID of e.g. “15193”. But it doesn’t work for the ID 1 (Core).

My result of my this code line includes 263 PRTG Groups. Expected is 1 PRTG Group.

Steps to reproduce

get-group -ParentID 1

What is the output of ‘Get-PrtgClient -Diagnostic’?

PSVersion      : 5.1.19041.1237
PSEdition      : Desktop
OS             : Microsoft Windows 10 Pro
PrtgAPIVersion : 0.9.16
Culture        : de-CH
CLRVersion     : 528372
PrtgVersion    : 21.3.70.1629
PrtgLanguage   : Unknown

Additional context

We got totally 402 PRTG Groups. So it isn’t listing all the groups. I couldn’t define, how this is filtered. It isn’t a wildcard filter with “1” or something like this. Because in the result are Groups with a Parent ID’s that dosn’t contain any “1” too.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mup07commented, Oct 20, 2021

@lordmilko - Update: It is confirmed, there is a Bug in the API. With the exception of the “tags” filter, every filter actually uses wildcards unintentionally. I will be informed, when the issue is solved.

0reactions
mup07commented, Oct 13, 2021

Now, the PRTG Server is on the same version as yours.

PSVersion      : 5.1.19041.1237
PSEdition      : Desktop
OS             : Microsoft Windows 10 Pro
PrtgAPIVersion : 0.9.16
Culture        : de-CH
CLRVersion     : 528372
PrtgVersion    : 21.3.71.1416
PrtgLanguage   : Unknown

Then I ran the same Query:

PS C:\> Get-Group -ParentId 1 -Verbose
VERBOSE: Get-Group: Synchronously executing request
https://[PRTG-URL]/api/table.xml?content=groups&columns=objid,name,probe,condition,fold,groupnum,devicenum,upsens,downsens,downacksens,partialdownsens,warnsens,pausedsens,unusualsens,undefinedsens,totalsens,schedule,basetype,baselink,notifiesx,intervalx,access,dependency,position,status,comments,priority,message,parentid,tags,type,active&count=*&filter_parentid=1&username=[Username]&passhash=[Hash]

And I got the same wrong result with the parameter “ParentID=1”.

The API request direct in the browser with the parameter e.g. “ParentID=12073” worked as expected. The Command “get-group” in PowerShell works here too.

So, I will open a ticket at Paessler and ask them for their input.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - LINQ query output groups and subgroups in JSON
5) For each Group, if the parent's ID is null, add the Group to the Roots list. 6) For each Group in the...
Read more >
Groups API
Get a list of visible groups for the authenticated user. When accessed without authentication, only public groups are returned.
Read more >
Incorrect "UserOrGroupId" in share object for criteria-based ...
I have a number of criteria-based sharing rules on that object, and they are properly sharing the records to the appropriate groups specified...
Read more >
Use REST API to get group SharePoint 2010
I have a group on my site - I want users to be able to add and remove themselves from this group via...
Read more >
groups_get_groups( array|string $args = '' )
groups_get_groups( array|string $args = '' ). Get a collection of groups, based on the parameters passed. Description. Parameters. $args.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found