Saturday, May 28, 2011

Inside infx: How the onstat parser works

The majority of information you see from infx has come from the output of the Informix onstat command. Only a small percentage (at this time anyway) comes from the sysmaster database.

There are two reasons for that:

  1. onstat is available even when sysmaster isn't
  2. onstat outputs loads of information and it's very fast

availablity

The onstat command can be used to track the database instance, even when it's not online. For example, monitoring the progress of a cold restore or fast recovery.

output by template

You output information from the onstat parser via a template. Using that template, infx determines a subset of onstat options required.

For example, the variable PROFILE_CACHEREAD requires the "-p" option, the DBSPACE_NAME requires "-d", and so on.

execute onstat

infx runs all options in a single execution of the onstat command, using the -i (interactive) option.

To run -g sql, -g ses and -g ckp in a single execution of onstat:

test1@cloud1:/home/informix> onstat -i <<EOF
> -g sql
> -g ses
> -g ckp
> q
> EOF
...
test1@cloud1:/home/informix>

parser

The onstat command places an "onstat>" prompt between each options output, this is used to separate them before parsing.

In the case of output like the "-p" option, there is one variable for each value parsed. In the case of options like "-g sql", a list is created to hold the values for each line in the output.

Normal variables are output by name e.g.:

<TMPL_VAR NAME=PROFILE_CACHEREAD>

Lists are output using loops e.g.:

<TMPL_LOOP NAME=USERS>...</TMPL_LOOP>

For the complete list of variables see parser library.

flexibility

You can access the onstat parser via browser based dashboards, or with command line utilities.

All output is easily customized, all you have to do is modify the template, infx automatically determines the new set of onstat options.

summary

infx simplifies monitoring and managing Informix databases by giving you easy access to information about the instance.

Comments and suggestions welcome.

No comments:

Post a Comment