Manual Pages
Table of Contents


na_stats_preset - stats preset file format




The stats utility supports preset queries, using the -p argument. A preset includes the statistics to be gathered, and the format for display. Using presets not only saves typing when entering commands from the CLI, it also allows greater flexibility in formatting the data than is possible on the command line. Each preset is described in an XML file, stored in the applicance directory /etc/stats/preset. The name of each preset file is pre_setname.xml.


Preset Element
The main element of a preset file is a single preset. The preset consists of attributes, plus one or objects that should be included in the preset. A simple preset to display all information from the system object using the default formats might be: <?xml VERSION = "1.0" ?>
<object name="system">
</object> </preset> Preset Attributes
The following attributes are available for the preset element. orientation
Output orientation, "row" or "column", see -r/-c command line options. outfile
Output file. See -o command line option. When used with a stats start and stats stop pair this option is only active with stats stop. In such pairs the same preset is typically used with both commands, although this is not mandatory. interval
Interval between output. See -i command line option. icount Number of outputs when using interval output. See -n command line option. print_header
Whether or not to print a output header. Default: true print_object_names
In row output, whether or not to include object names in the output. Default: true print_instance_names
In column output, whether or not to include instance names as a column in the output. Default: true print_footer
After printing a set of counters print a footer string. Default: false. In multiple-count outputs the footer is printed after each iteration. pre_header
A header string that is printed prior to data headers. Default: none use_regex
Allow extended regular expressions for instance and counter names. Default: false print_zero_values
Determines whether counters with zero values should be displayed. The default setting displays all counters, except for counters that are flagged as not-zero-printing by default. The allowed values are default, true and false. This option only affects row output. column_delimeter
In column output, the text to print between each column, changing the default TAB spacing. catenate_instances
In column output, whether or not to catenate all instance counters into a long line, or to split the output so that each instance goes on its own line. Default: false The following example specifies a preset with column output, that displays values each second: <?xml VERSION = "1.0" ?>
<preset orientation="column" interval="1" > ...
</preset> Objects
The object element specifies an object that is to be used in the preset. It has attributes, as listed below, and optional counters and instances. The following example shows a preset using the system and volume objects: <?xml VERSION = "1.0" ?>
<object name="system">
<object name="volume">
</preset> The following table lists object attributes. name Object name. If "*" is used, this means all objects. This attribute is mandatory Object counters and instances
Each object may list which instances and/or which counters are to be used in the preset, using the instance and counter elements. If no instances or counters are listed then all instances, all counters are assumed. Counters may be listed for an object, or for an instance. If a counter is listed for an object then it applies to all instances of the object in the preset. If a counter is listed for an instance then it only applies to that instance. The following example shows a case where counter "global_counter" is being used for all instances, but "counter_0" is only being used for a specific instance. <?xml VERSION = "1.0" ?>
<object name="OBJNAME">
<instance name="instance0"> <counter name="counter_0"> </counter">
</instance> <counter name="global_counter"> </counter>
See below for more information on the syntax for counters and instances. Counters
Object counters are specified with the counter element. The required attribute "name" specifies the counter name, or "*" may be used to indicate all counters for an object. A counter also has the following elements: title Title to be used in column headers. width Column width in output, in characters. The following example shows a column named "disk_io" formatted in a column 8 characters wide, with a column header of "Disk I/O":
<counter name="disk_io">
<title>Disk I/O</title>
</counter"> Instances
Object instance are specified with the instance element. The required attribute "name" attribute specifies the instance name. An instance has the following optional elements: counter
An instance-specific counter. The element may occur multiple times. Note that if no counters are listed for an instance then the default set of counters for the preset will be used. This is either counters listed at the object level, or all counters for the object. The following example shows an instance with two counters: <instance name="instance0">
<counter name="counter0"> <title">Cnt0</title>
<counter name="counter1"> <title">Cnt1</title>


The following example shows a preset with output similar to the sysstat command. It might be invoked as: stats show -p sysstat -i 1 <?xml VERSION = "1.0" ?>
<!-- This preset is similar to the tradition `sysstat' command, using column output -->
<preset orientation="column"
print_instance_names="false" catenate_instances="true" > <object name="system">
<counter name="cpu_busy"> <width>4</width>
<counter name="nfs_ops"> <width>6</width>
<counter name="cifs_ops"> <width>6</width>
<counter name="http_ops"> <width>6</width>
<counter name="net_data_recv"> <width>8</width>
<title>Net in</title> </counter>
<counter name="net_data_sent"> <width>8</width>
<title>Net out</title> </counter>
<counter name="disk_data_read"> <width>8</width>
<title>Disk read</title> </counter>
<counter name="disk_data_written"> <width>8</width>
<title>Disk write</title> </counter>


Table of Contents