Table of ContentsView in Frames

Changing the output of a stats command

Data ONTAP enables you to control the format and destination of the output of the stats command. This could be useful if you are processing the information with another tool or script, or if you want to store the output in a file so you can process it at a later time.

Step

  1. Do one of the following:
    If you want to... Then...
    Send stats output to a file Add -o filename to your stats show or stats stop command line.

    filename is the pathname to the file you want to receive the stats output. The file does not need to exist, although any directory in the path must already exist.

    Determine whether the output is formatted in rows or columns Add the -r or -c option to your stats show or stats stop command line.

    The -r option formats the output in rows and is the default if the -I option is not specified.

    Specify a delimiter so that your output can be imported into a database or spreadsheet Add the -d delimiter option to your stats show or stats stop command line.

    The -d option only has effect if your output is in column format.

    Filter the output of the stats show command Add -O name=value to the stats show command.

    name is the name of the option you want to filter and value is on or off.

    See the na_stats_preset(5) man page for a list of options.

Examples of changing the output of a stats command

The following example displays output in rows:

toaster> stats show qtree:*:nfs_ops
qtree:vol1/proj1:nfs_ops:186/s
qtree:vol3/proj2:nfs_ops:208/s

The -c option formats the output in columns and is the default only if the -I option is specified.

The following example displays output in columns:

toaster> stats show -c qtree:*:nfs_ops
Instance nfs_ops
               /s
vol1/proj1      143
vol3/proj2      408
Note: The /s line shows the unit for the applicable column. In this example, there is one column, and it is number of operations per second.

If you are displaying multiple objects that have different counters, the column format may be difficult to read. In this case, use the row format.

In the following example, the same counter is listed as for the column output example, except that it is comma-delimited.

cli> stats show -d , -c qtree:*:nfs_ops
Instance nfs_ops
              /s
vol1/proj1,265
vol3/proj2,12

The command in the following example filters output of the stats show command with zero counter values:

stats show -O print_zero_values=off