ONTAP Discussions

CLI comparing values

Guille
4,196 Views

Hello everyone,
it is possible to list the volumes that it's -percent-used value is greater than -space-nearly-full-threshold-percent value?
As far as I know extended query will not be suitable to solve this question.

 

This could we great, but is not working for me:
vol show -percent-used > -space-nearly-full-threshold-percent
Error: The expression is missing a value

 

Thank you much,
Guille.

 

1 ACCEPTED SOLUTION

Guille
3,789 Views

That is not the question of the post. The CLI queries have a limitation, they cannot compare the value of two attributes of the same volume. Maybe nesting two queries with powershell is possible.
Thank you all for your time.

View solution in original post

6 REPLIES 6

Ontapforrum
4,176 Views

Not sure if your query is that straightforward.

 

By, default <-space-nearly-full-threshold-percent> value is 95% for Flexvols in ONTAP. If you are interested to know which volumes are past this %?

 

This command will list the volumes
::> vol show -percent-used > 95

 

If you aren't sure what's thresholds are, you can view them:
::> volume show -volume * -fields space-nearly-full-threshold-percent

 

Is that what you were looking for?

Guille
4,169 Views

Hi,
From my point of view this query is simple if it were possible to compare the value of an attribute with the value of another attribute of the same volume.
After reviewing the documentation related to the operators that can be used for this query, I deduce that this type of comparison is not possible with "ONTAP CLI"?

parisi
4,108 Views

That particular query isn't possible, afaik. But you can sort by a field with the -sort-by flag (advanced mode)

 

This has some examples, along with some other tips:

 

https://whyistheinternetbroken.wordpress.com/2015/02/16/techbecome-a-clustered-data-ontap-cli-ninja/

Guille
4,032 Views

Of course, volumes has a default value for a lot its properties, right by default, but this is not the case.
The posted query is an example ot the main question, as you can read on the posted title, it is about comparing values using CLI.
It makes sense that if an object, in this case a volume, has two propertie, it should be possible to compare this two values.
Now at days this is done exporting to xls and formuling A1 > B1, easy, but not possible from CLI.
An enhancement for a later version of ONTAP.
Thank you for your time in replying.

Guille
3,965 Views

Hi,
From my point of view this query is simple if it were possible to compare the value of an attribute with the value of another attribute of the same volume.

Guille
3,790 Views

That is not the question of the post. The CLI queries have a limitation, they cannot compare the value of two attributes of the same volume. Maybe nesting two queries with powershell is possible.
Thank you all for your time.

Public