#template for export policy /rule ?
1 messages · Page 1 of 1 (latest)
i tried with this , (first doing it 🙂
name: ExportRule
query: api/protocols/nfs/export-policies
object: export_rule
counters:
- ^^uuid => uuid
- ^svm.name => svm
- ^name => name
- ^rules.index => index
- ^rules.clients.match => clients
- ^rules.clients.protocols => protocols
- ^rules.clients.ro_rule => ro_rule
- ^rules.clients.rw_rule => rw_rule
- ^rules.clients.superuser => superuser
export_options:
instance_keys:
- id
instance_labels:
- svm
- name
- clients
- protocols
- gateway
- ro_rule
- rw_rule
- superuser
hi @lavish belfry that template is close. Try this
`name: ExportRule
query: api/protocols/nfs/export-policies
object: export_rule
counters:
- ^^id => id
- ^svm.name => svm
- ^name => name
- ^rules.index => index
- ^rules.clients.match => clients
- ^rules.clients.protocols => protocols
- ^rules.clients.ro_rule => ro_rule
- ^rules.clients.rw_rule => rw_rule
- ^rules.clients.superuser => superuser
export_options:
instance_keys:
- id
instance_labels:
- svm
- name
- clients
- protocols
- gateway
- ro_rule
- rw_rule
- superuser`
Thank you @nimble folio got the policy name but still does not show rule
i guess need to change rules.client to rules.protocols
checking
ah! I see this api is returning those rules as an array of rules which is not handled via template syntax. There are few other cases like this that we've handled via plugins. I don't think you'll be able to get the rules without a plugin until we add support for array handling
@nimble folio ahh i see , Thank you for help , i will do this via powershell for now
glad you have a workaround - we'll add this
captured here if you want to follow https://github.com/NetApp/harvest/issues/1820
@lavish belfry if you make progress on this and want us to match your export format, please share what you have and we'll do our best to match. For example, since a rule contains an array of clients, there are a couple od different ways we could represent that relationship:
a) join those four clients into a single label that is comma-separated like this: clients="10.65.180.65,10.65.176.223,0.0.0.0/0,192.168.1.10"
b) publish four metrics, each with a different client from the list above
I assume you want something similar to export-policy rule show which would be #b instead of a
@nimble folio Yes B options is correct , this also help to find if per client export rule 🙂
Get-NcNfsExport does not work well, i have pass -path for each vol which is not good idea , 😦 powershell is not option
Multiple values are not supported for 'nosuid' option any alternet on this
We should have something for you to try soon. We'll ping you
@lavish belfry can you give this a try and see if it captures what you want? https://github.com/NetApp/harvest/discussions/1821
This only works for the REST collector. We are going to create a new template and add it to your custom.yaml. In the commands below, Harvest is installed in /opt/harvest. Adjust as needed. Edit vi ...
@nimble folio Thank you , it's working
great!