<?xml VERSION = "1.0" ?>
<preset>
<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.
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
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" ?>
<preset>
<object name="system">
...
</object>
<object name="volume">
...
</object>
</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" ?>
<preset>
<object name="OBJNAME">
<instance name="instance0">
<counter name="counter_0">
</counter">
</instance>
<counter name="global_counter">
</counter>
</object>
</preset>
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>
<width>8</width>
</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">
<counter name="counter1">
<title">Cnt1</title>
</counter">
</instance">
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>
<title>CPU</title>
</counter>
<counter name="nfs_ops">
<width>6</width>
<title>NFS</title>
</counter>
<counter name="cifs_ops">
<width>6</width>
<title>CIFS</title>
</counter>
<counter name="http_ops">
<width>6</width>
<title>HTTP</title>
</counter>
<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>
</object>
</preset>