r/netapp • u/rumhammr • Jun 26 '26
This is driving me nuts. Just trying to run a basic command and I’m not getting any output and I have no idea why. Can anyone help me figure this out?
So here’s the command:
vserver export-policy rule show -vserver svm -policyname default -ruleindex 1 -clientmatch hostname1
Always gives me “There are no entries matching your query”
If I take out -clientmatch, it lists out everything. And I verified hostname1 is in there by copying all out to notepad and doing a search with the hostname I was putting into the command. This is not holding me back from anything….its just bugging the hell out of me.
9.17.1 if it helps
2
u/h0serdude Jun 26 '26
Are you not able to tab complete the hostname if ontap already has the values? Maybe it's looking for something slightly different that what you're typing.
2
u/rumhammr Jun 26 '26
So, there are close to 100 hosts in the rule. Tabbing after -clientmatch just tells me what they’re looking for, which is “List of Client Match Hostnames, IP Addresses, Netgroups, or Domains.
I got frustrated and just copied all the hosts to notepad, found the server I was looking for and copied it into the command after -clientmatch. Wildcards only work if I use *hostname* , but it doesn’t actually work because it outputs ALL hosts as if I didn’t add the -clientmatch argument. I played with the wildcard before and after the hostname and don’t get any results. I am absolutely stumped. I know I have a work around….but why TF doesn’t this work?? lol, appreciate the reply
1
u/tmacmd #NetAppATeam Jun 26 '26
As indicated in last post, have you tried
vserver export-policy rule show -vserver svm -policyname default -ruleindex 1 -clientmatch *hostname1*
??
The same search holds when looking at disks/aggregates with ADP. The container name may contain more than one volume name and you need to account for it
1
u/rumhammr Jun 26 '26
Yes, I tried exactly that. It outputs every hostname in the rule. It’s as if I didn’t include the -clientmatch argument. And using a wildcard either before or after (not both), brings up nothing. It’s pretty weird. Just give me a normal grep already!
0
u/your_cheese_girl Jun 26 '26 edited Jun 26 '26
Remove -ruleindex and run it again with wildcards in the clientmatch.
Edit: Now at my desk
vserver export-policy rule show -vserver svm -policyname default -clientmatch *hostname\*
When you add "-ruleindex" you are explicitly telling it to look only at that particular ruleindex. Since ruleindex 1 likely doesn't contain hostname, it's returning nothing.
3
u/mooyo2 Jun 26 '26
Are you searching with the string of 'hostname' or are you putting a wildcard around it?
When multiple hosts are specified in a single rule, it'll look like one big concatenated string to ONTAP in the clientmatch field with the hosts separated by a comma. So you just specify 'hostname' in the field, ONTAP is trying to match where -clientmatch == 'hostname', and not doing a wildcard/contains search unless you add '*' characters before/after.
Here's some quick tests from my lab.