NAME

ifmx_user - Count the number of concurrent INFORMIX database-users (sessions)


SYNOPSIS

ifmx_user -i intvl_sec -h home_server -d destination_server -H hostname [-r retry_num]

(see EXAMPLES)


DESCRIPTION

The Esql/C-program ifmx_user counts the number of concurrent database-users (sessions) and stores this information in a dedicated database with the same name (ifmx_user).

ifmx_user should be started under a dedicated user-account which needs not to be root or informix.

The goal of ifmx_user is to collect data and not to generate any reports. This issue has to be resolved by customer-written SQL-statements and reports based on the collected data (DATABASE-STRUCTURE).


OPTIONS

-i intvl_sec
This option specifies in which intervals (seconds) ifmx_user should count the number of concurrent database-users (sessions).

The minimum allowd interval is 60 seconds. If a smaller interval is specified, it will be automatically reset to the allowed minimum.

-h home_server
This option specifies the name of the databaseserver where the ifmx_user-database is located (or will be created if it does not exist).

-d destination_server
This option specifies the name of the databaseserver where ifmx_user should count the number of concurrent database-users (sessions).

-H hostname
This option specifies the hostname of the destination_server where ifmx_user should count the number of concurrent database-users (sessions).

-r retry_num
This option specifies the number of retries that ifmx_user should perform if a database-connection has been lost. A value of zero (-r 0) means an unlimited number of retries.

An attempt to re-connect will be made after the specified interval is reached.

If this option is missing, ifmx_user will not perform any retries.


POSSIBLE CONFIGURATIONS

ifmx_user could be started in different configuration-modes which results in more flexibility.

In a distributed environment the user-account under which ifmx_user is started must be trusted (i.e. $HOME/.rhosts) across the individual servers.

Distributed DB / Distributed Processes

In this configuration each databaseserver that should be observed stores his own ifmx_user-DB and runs his own ifmx_user-process. That means that the options -h home_server and -d destination_server use the same databaseserver-name.

If -h home_server and -d destination_server are identical, the TCP-connection-name must have been specified. This is necessary because ifmx_user always establishes two distinct connections which is not possible over the SHM-protocol.

The data from the individual ifmx_user-DB's needs to be unloaded and loaded in a central-DB to analyze the collected data (reporting).

A dedicated ifmx_user-binary must exist for the individual hardware-platforms.

Central DB / Distributed Processes

The advantage of this configuration is that the data will be directly stored in a central-DB (-h homeserver.

A dedicated ifmx_user-binary must exist for the individual hardware-platforms.

On each monitored databaseserver an additional sqlhosts-entry must exist which points to the central-DB (-h homeserver so that ifmx_user could write the data directly to that server.

Central DB / Central Processes

This configuration eliminates the need of dedicated binaries for individual hardware- platforms.

The imfx_user-processes are started from a central host (-h home_server and connect to the distributed databaseservers (-d destinations_server. The ifmx_user-DB is also located on the central host.

Every databaseserver that should be monitored needs an sqlhosts-entry on the central host and a dedicated ifmx_user-process has to be started on the central host.


DATABASE-STRUCTURE

The ifmx_user-DB is automatically created on the home_server (-h home_server) if it does not exist.

Normally the database will be created in the rootdbs. The environment variable DBSPACE_IFMX_USER could be set (ENVIRONMENT VARIABLES to control the storage-location of the database.

ifmx_user-DB consists of three tables which are described below:

Table 'user_id'

This table stores only one row which is a counter that is increased during each measurement.

 Schema:
 -------
 ui_id         INTEGER  
               -> counter that is increased

This is an internal table, not needed for any reports.

Table 'user_master'

This table contains one row for each measurement taken.

 Schema:
 -------
 um_id         VARCHAR(75,25) NOT NULL
               -> unique string which consists of hostname#dbservername#ID
 um_date_time  DATETIME YEAR TO MINUTE NOT NULL
               -> timestamp of measurement
 um_total_ses  INTEGER NOT NULL
               -> total number of concurrent database-users (sessions)
 um_cpu_vps    SMALLINT NOT NULL
               -> number of configured CPU-VP's
 um_boot_time  DATETIME YEAR TO MINUTE NOT NULL
               -> timestamp of databaseserver-startup

The information in this table could be used to generate individual reports which display the number of concurrent database-users in certain timeframes.

Table 'user_detail'

This table contains additonal information for each row from table 'user_master'.

 Schema:
 -------
 ud_um_id      VARCHAR(75,25) NOT NULL
               -> foreign key referencing 't_master'-table
 ud_user_name  VARCHAR(32,8) NOT NULL
               -> name of database-users
 ud_user_ses   INTEGER NOT NULL
               -> number of database-sessions for this user

The information in this table could be used in conjunction with table 'user_master' to provide detailed view about the number of database-sessions for individual users.


ENVIRONMENT VARIABLES

The following environment variables can be set:

DBSPACE_IFMX_USER

This environment variable specifies the dbspace in which the ifmx_user-DB will be created. rootdbs is the default if not set.

DEBUG_IFMX_USER

This environment variable could be set to gather additonal debug-information (DIAGNOSTICS).


EXAMPLES

Distributed DB / Distributed Processes

ifmx_user -i 3600 -h asterix_tcp -d asterix_tcp -H $(hostname)

This will count the number of database-users every hour (-i 3600). The server where the ifmx_user-DB is located (-h asterix_tcp and the the server where the number of concurrent database-users should be counted -d asterix_tcp is the same.

Central DB / Distributed Processes

ifmx_user -i 600 -h idefix_tcp -d asterix_tcp -H $(hostname) -r 3

This will count the number of database-users every ten minutes (-i 600). The ifmx_user-DB is located on a central server -h idefix_tcp and the number of concurrent database-users will be counted for a different server -d asterix_tcp.

In addition if a database-connection is lost, ifmx_user will try to re-connect three times (-r 3) before giving up.

Central DB / Central Processes

ifmx_user -i 3600 -h idefix_tcp -d obelix_tcp -H obelix -r 3

This will count the number of database-users every hour (-i 3600). The server where the ifmx_user-DB is located (-h idefix_tcp and the the server where the number of concurrent database-users should be counted -d obelix_tcp are different.

The ifmx_user-processes will be started on a central server, connecting to the distributed databaseservers (-d obelix_tcp.


RETURNCODES

ifmx_user delivers the following returncodes:

0=RET_OK Program finished successfully

1=RET_ERR Program encounters erros

2=RET_INVAL_USAGE Invalid program usage


DIAGNOSTICS

Debugging can be turned on by setting the environment variables DEBUG_IFMX_USER before starting ifmx_user.

The whole debug information can be saved to a file with the use of i/o-redirection.

Example:

export DEBUG_IFMX_USER=1

ifmx_user -i 60 -h asterix_tcp -d asterix_tcp -H $(hostname) > /tmp/debug.out 2>&1


REQUIRES

Esql/C-Runtime


AUTHOR

eric@herber-consulting.de