create a utility

You can create your own utilities by building a template and using the infx status command to output it.

template

Templates should be created under the /infx/local/template directory.

You can create sub-directories there as needed, the whole tree is searched.

You can also create a template by using one of the existing templates as a starting point.

For example, to make changes to the infx status output, copy the template from /infx/template to /infx/local/template and make changes.

The infx status command will use your local template from now on.

If you change the files in the /infx/template directory, they will be overridden by future updates and upgrades.

database list

By way of example, we will create a utility to list the databases.

First, create the template.

Template files should be located under /infx/local/template and have a “.htmlt” file extension.

output it

Output the template using the status command:

alias it

If you want to execute this command often, define an alias for it by editiing config.ini.

[[alias alias="dbs" cmd="status" util="databases"]]

Now, you execute the infx dbs command to get the list of databases.

ordering

Add tags to the table template to allow ordering by different columns

This is a two step process:

  1. modify the databases template to allow table ordering
  2. change the alias definition to allow the order parameter to be passed.

template

Make the change to our databases template, where the table is defined.

<table order=<TMPL_VAR NAME=ARG_ORDER>>

Arguments passed to the command are in the template as variables, with ARG_ prepended to the name. So ARG_ORDER will be set to the value of the order= parameter from the command line. If no parameter is passed, no re-ordering will occur.

alias

Change the alias definition so that the dbs command can accept the order parameter.

If you omit this step, the CLI will not accept the order paramter.

[[ alias alias="dbs" cmd="status" util="databases" opt="order" ]]

You can now pass the name of a column in the order parameter, and change the order the list outputs in.

example

filter parameters

You can modify the template to allow for filtering rows in the output. It is a similar process to above.

template

First, change the template to specify the filters.

In this case the space parameter will filters the space column.

alias

Add the space parameter to the allowed options in the alias definition:

[[ alias alias="dbs" cmd="status" util="databases" opt="order space"]]

example

Filter the output based on storage space name:

more information

Utilities can only output information about an instance. If you want to do more you need to create a script for that.

The template reference describes the template definitions.

The parser library reference lists the variables available in the templates.