#Custom collector issues

1 messages · Page 1 of 1 (latest)

cosmic shoal
#

Hello all, I am trying to configure a custom collector with the following API endpoint:
/api/protocols/cifs/local-groups. In Postman, the response I want to achieve is the following:
/api/protocols/cifs/local-groups?name=&members.name=
My main objective is to show members of each group in a tabulated dashboard format. I cannot get members.name to populate when I turn this collector on. Group name and svm populate with no issues though. This is my object template:

Name: CifsGroup
Query: api/protocol/cifs/local-groups
Object: cifs_group

Counters:
- ^^svm.name => svm
-^^name
-^members.name

Export_options:
Instance_keys:
- svm
- name
Instance_labels:
- members.name

#

Apologies for formatting,
I’m on iOS app

sacred pumice
#

hi @cosmic shoal does your api/protocols/cifs/local-groups?fields=** return any members? Can you share the output of your curl command?

#

ah, members is an advanced property which means it needs to be explicity asked for like this:
/api/protocols/cifs/local-groups?fields=*,members

#

Give this a try

name:           CifsGroup
query:          api/protocols/cifs/local-groups
object:         cifs_group

counters:
  - ^^sid
  - ^svm.name       => svm
  - ^name           => local_group
  - ^members.#.name => members
  - filter:
      - members=*
       
export_options:
  instance_keys:
    - svm
    - local_group
  instance_labels:
    - members
cosmic shoal
#

That worked! Why does the members name counter contain the # in between ?

sacred pumice
#

Awesome! The # is how to access a child path in a JSON array

cosmic shoal
#

Thank you! Would this apply to other json arrays as well? I have a few other queries to run that have similar structures to the cifs API

sacred pumice
cosmic shoal
#

Awesome! I do have one question, the query above for show-members is not returning all vservers, maybe about half or less. Is there anything in the query I can modify to get all vservers?

sacred pumice
#

I noticed the same thing yesterday. The CLI showed the same behavior.
In other words, Backup Operators is missing from show-members and the REST response matches

#

Which made me think it was working as designed

cosmic shoal
#

What you show makes sense, as there are no members within the local group. In my case, there are several svm’s that have many members under the local groups and they don’t show up with that Harvest query. I am able to see all of them when I make an API request

sacred pumice
#

Gotcha. Can you email us the output of your REST request so we can troubleshoot the template shared above? Email at ng-harvest-files@netapp.com

sacred pumice
#

Thanks for the REST that demonstrated the problem immediately. I thought the sid was sufficient to uniquely identify the records but your REST response shows that it clearly is not. The SVM needs to be mixed in too. Try this:

name:           CifsGroup
query:          api/protocols/cifs/local-groups
object:         cifs_group

counters:
  - ^^sid
  - ^^svm.name       => svm
  - ^name            => local_group
  - ^members.#.name  => members
  - filter:
      - members=*
       
export_options:
  instance_keys:
    - svm
    - local_group
  instance_labels:
    - members