We will be writing some scripts to create Groups through the API and would like to base the members of those Groups on Dynamic Query results like you can do through the web interface.
I did take a look at Groups.ps1 but it does not provide any examples for using a Dynamic Query.
I see in the database where individual members of a Group are stored in Orion.ContainerMemberSnapshots even when I Dynamic Query is used. I did not find where the actual Dynamic Query is stored in the database.
Can anyone help me with the following:
Solved! Go to Solution.
DQ's are defined in the
containermembers containermemberdefinition* table.
The best way to understand how to build a DQ for inserting directly in is to build an example of what you need and then tweaking in variables. I'll warn you that the GUI gets weird if you insert a DQ definition that is not EXACTLY structured the way it wants. Capitalization and white space has to be exactly right.
@mesverrum I guess I do have another question.
You stated that the DQs are stored in the containermembers table. In that table I do see individual entries for the results of the DQs but not the DQ statements themselves, or I am missing something. Wouldn't be the first and probably not the last time I missed something ;). Do you know where the actual DQ statements are stored?
My mistake, was going from memory they are actually in containermemberdefinition
This SWQL query gets you the DQ's themselves
SELECT TOP 1000 DefinitionID, ContainerID, Name, Entity, FromClause, Expression, Definition
where definition like 'filter%'
Breezed through your script and it looks like it will do what we need. Will be a while before we can actually implement but doing some research upfront.
I also learned a few other things I didn't know in the process. Thanks for the assist and I will keep in mind what you said about the syntax being picky as well.
Just gotta love this community!!!
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.