Chapter 6
Empress Servers


6.1 Introduction

This chapter explains Empress Servers. Empress Servers are Empress Replication Master Server and Empress Connectivity (ODBC) Server. Configuring and using the utility that administrates these servers, empsvadm is explained. The utility to analyze the logfile generated from the history of the operations performed by Empress Servers, empsvlogstat is also described.

An Empress Server contains several components which are a Spooler, an Administration Server and one or more Service Servers.

Spooler is controller which spawns and controls other components. Execution of an Empress Server is controlled by requests sent through Empress Server Administration Utility (empsvadm). Empress Server listens to the requests from its clients. Administrative requests are handled by the Administration Server and service requests are passed by the Spooler to one of the Service Servers. The user configures the number of Service Servers that are controlled by each Spooler of an Empress Server.

The clients of an Empress Server do not need to know about the Spooler, Administration Server, and Service Servers. They can simply refer to them as an Empress Server.

Figure 6-1: Components of an Empress Server
                Spooler
                  |
                  |
                  |
      ____________|____________________  ....
     |      |          |          |
     |      |          |          |
  Admin   Service    Service   Service   ....
  Server  Server1    Server2   Server3

An Empress Server can be assumed to be running on a remote machine, with clients accessing to it through network. Thus there are some handshaking between a client and server, in order to ensure a connection between them. Here is a sample of how an Empress Server and its client handshake with each other.

Figure 6-2: Handshaking and Timeouts of Empress Server and its Client
Handshaking of Empress Server and 
its Client

As shown in [Figure 6-2:Handshaking and Timeouts of Empress Server and its Client], a Client sends a "Start Connection" signal to a Server. The server replies by an "Accept" signal. The client then requests for "Open Connection", and the server replies by "Open Success" signal. After these signals and establishing a connection, the client starts sending the "Requests", and the server "Responds" to those requests. Note that there are some Timeout settings between each request and respond, so that the client wouldn't wait longer than expected for a reply. There is also a timeout between the time that a "Open Success" is sent by the server, and the time that the client starts its "Requests". These timeouts are explained in [Network Configuration].

6.2 Empress Server Administration Utility

Empress Server Administration Utility is called empsvadm. The usage of this utility is to start, stop and administrate Empress Servers. This utility is used to administrate Empress Servers, including Empress Replication Master Server and Empress Connectivity (ODBC) Server. This utility is also used to administrate an Empress Database Server. This manual only describes the commands that are used for Replication Master Server and Connectivity (ODBC) Server.

The name of an Empress Server must be specified for any execution of empsvadm. The general usage of this utility is:

    empsvadm servername command 
Where:

1. servername is the name of the Empress Server. The default server name is set in $EMPRESSPATH/config/netserver.cfg file by NAME. For a Replication Master Server the default servername is emprepsv, and for ODBC (Connectivity) Server the servername must be empodbcsv.

2. command is one of the followings:

Here are the functions of empsvadm utility. These functions are also listed in [ References: Empress Server Administration Utility]. An example usage is described for some of the functions. The examples in this section assume using default pre-set values for Empress Server Environment Variables.

An Empress Server needs to be configured for its start up. The settings, environment variables and configuration for Empress Servers are given in [ Configuring Empress Server and its Clients]. Complete explanation of Empress Server Environment Variables, contents of Configuration Files and the default values of Configuration Variables are given in [ References: Empress Servers Environment Variables].

6.2.1 Starting an Empress Server

For starting a Empress Server, use the start command of Empress Server Administration Utility empsvadm:
    empsvadm server_name start [option]
Where:
[option] : is dependent on the Type of the Empress Server that is going to be started.
If Empress Server environment is correctly configured, a new Empress Server will start after this command. Status of the started Empress Server will also be shown. Refer to [Sample Empress Server status information output].

When an Empress Server is started, an Execution log of the start and execution of the Empress Server is kept. Specifying the Empress Server Log file in network configuration file and the contents of the log are given in the [ References: Empress Server Log File]. A utility to analyze an Empress Server Log File is explained in [Empress Server Log Analyzer Utility]

The [option] can be used to specify starting options.

  1. For a Replication Master Server, the option is:

       -f Rep_Server_Start_Config_File
    
    This option can be used to specify the databases and their tables which the started Replication Master Server will handle. No other table can be served by this particular Replication Master Server. If this option is not specified, any RMT can be configured to be served by this Replication Master Server, as long as the server can access to the host containing the database of that table.

    The contents of the Rep_Server_Start_Config_File is given in [Replication Master Server Start Configuration File]. When starting a Replication Master Server with specifying a Replication Server Start Configuration File option, the database and tables specified in Replication Server Start Configuration File must be existent and accessible by the Replication Master Server. The tables must be Replication Tables and must have at least one Replication Replicate Entry defined for them.

    An Example for starting a Replication Master Server named emprepsv is given:

        empsvadm emprepsv start -f Server_Start_Config_File
    
    If Empress Server is correctly configured, a new Replication Master Server called emprepsv will start and display a success message.

  2. For an ODBC (Connectivity) Server, the option is:

      -f odbc_Server_Config_file
    
    The ODBC Server Configuration File odbc_Server_Config_file is used to define the Empress ODBC connection information for each database. If this file is not specified, the ODBC server will use the default values. The contents of the odbc_Server_Config_file is given in [Empress Connectivity (ODBC) Server Configuration File].

    An Example for starting an ODBC (Connectivity) Server named emodbcsv is given:

        empsvadm empodbcsv start -f odbc_Server_Config_File
    
    If Empress Server is correctly configured, a new ODBC Server called empodbcsv will start and display a success message.

6.2.2 Closing a Client Connection

This commands closes a client connection with the Empress Server.
   empsvadm servername close client_id 
Where:
client_id is: the ID that is given to a client, when the connection between the client and the Empress server is established. This ID is valid for the duration of the execution of a service. A new client_id is assigned for each client connection.
This is usually done for terminating the requests that have taken longer than expected, and have not terminated yet.

6.2.3 Getting information on an Empress Server

Information on a currently running Empress Server and its components can be viewed using the info command of Empress Server Administration Utility empsvadm:
   empsvadm server_name info
This shows information about:
  1. Name of the Empress Server
  2. Type of the Empress Server
  3. Spooler Process ID
  4. Port number which is assigned for Empress Server Administration Purposes
  5. Port number which is assigned for Empress Server's Service Servers
  6. Minimum and Maximum number of Service Servers that should be running when the Empress server is started, and the actual number of Service Servers which are running now.
  7. logical ID and Operating System Process ID of each of the Service Servers, and that of Administration Server, and the number of clients that are serviced by each of these servers.
  8. Total number of clients that are served by all of the processes controlled by this Empress server.
  9. information about the clients that are served by this Empress server. This include: Client ID number assigned by Empress (this is the ID that can be used for closing a connection between a client and a server), Operating system Process ID, Start time for this client, and the login name of the user of this service.
Example for getting information on a running Replication Master Server named emprepsv can be:
   empsvadm emprepsv info
A Sample output of this command for a Replication Master Server is given in [Sample Replication Master Server status information].

Example for getting information on a running ODBC Server named empodbcsv can be:

   empsvadm empodbcsv info
A Sample output of this command for a ODBC Server is given in [Sample Connectivity (ODBC) Server status information].

6.2.4 Resetting Number of Service Servers

This command resets the number of Service Servers that will be controlled by this Empress Server.
   empsvadm servername servers min [max] 
Where:

min is: The number of servers that the spooler will initially spawn.
max is: The optional number of additional servers that the spooler will spawn when the min servers are all busy. The default for max is min. The spooler will maintain between min and max servers. There is currently no provision for the spooler to reduce the number of servers automatically back to min when the servers become idle. min and max can not be set to "0". Also they can not be set to a number greater than the Empress Server process number which is specified in the license.

The initial maximim and minimum number of servers that will be spawn by an Empress Server are in Network Configuration Files, specified by configuration attributes NUM_SERVERS_MIN and NUM_SERVERS_MAX in either MSNETTYPE or MSNETSERVER configuration blocks. The minimum number of these service servers, along with one Administration Server is started, at the time of initial start of an Empress Server, and are controlled by this Spooler. If NUM_SERVERS_MIN Service Servers are busy, the Spooler will spawn up to NUM_SERVERS_MAX more Service Servers to serve the clients of an Empress Server.

6.2.5 Stopping an Empress Server

To stop the already running Empress Server, use the stop command of Empress Server Administration Utility empsvadm:
    empsvadm server_name stop [force]
The Empress Server will stop only after all the services serving its Clients get terminated. If used with [force] option, the busy servers will be forced to be terminated.

Example for stopping a Replication Master Server named emprepsv can be:

empsvadm emprepsv stop

Example for stopping an ODBC (Connectivity) Server named empodbcsv can be:

empsvadm empodbcsv stop

6.2.6 Refreshing the Empress Server

This command refreshes the Components of an Empress Server.
   empsvadm servername refresh
The Empress Server will send messages to the components (Service Servers and Administration Server) requesting them to self-terminate. A component of an Empress Server self-terminates if it is idle. A component also self-terminates after the next client closes the connection, either as a result of a message from the Spooler or after a certain number of services given to clients. These numbers are specified in the Network Configuration Files with the values of configuration attributes MAX_CLIENTS_PER_SERVER_ADMIN and MAX_CLIENTS_PER_SERVER_SERVICE. For these configuration attributes, number zero implies "infinity". This self-termination allows the Empress Server to release system resources and to move the number of its components (Service Servers) to the minimum, as new components are re-spawned only as necessary.

6.2.7 Interrupting the Empress Server

This command interrupts an Empress Server:
   empsvadm servername interrupt server_id 
Where:
server_id is: the ID number of the server component, assigned by Empress Server
This command asks the Spooler to send an interrupt (SIGINT) to the specified server component. On receipt of SIGINT (whether from the Spooler or otherwise), the server component will call the new server-specific signal handling function to handle the signal if the server-specific code has control, otherwise it is ignored.

6.2.8 Changing the Login Password of the Empress Server Administrator

This command is to change the password for the administrator of the Empress Server.

The command to change the password is:

   empsvadm servername change_password [login]
Where:
login is: The login name of the Empress Server Administrator. If the <login> is not given, the Empress Server Utility will prompt for the login name.

6.3 Configuring Empress Server and its Clients

An Empress Server and its clients need to be configured for correct execution. Empress Server Configuration can be specified by arguments and options used with the Empress Server Administration utility empsvadm. Some Environment Variables must also be set to be used by Empress Server and its clients. When an Empress Server or its client is executing, they look for the values set by these environment variables. The values of these environment variables can be name of files that contain configuration blocks and configuration attributes.

The environment variables that are used for configuring Empress Servers are described here. The complete list of these variables are also given in [References: Empress Server Environment Variables]. In this section the following environment variables are described in detail:

MSNETSERVERCONFIGFILE
Network Server Configuration File Name

MSNETTYPECONFIGFILE
Network Type Configuration File Name

MSUSERAUTHCONFIGFILE
User Authorization Configuration File Name

MSCONFIGFILEPATH
Configuration Files Path

6.3.1 Network Configuration

The file pointed by value of MSNETSERVERCONFIGFILE is called network server configuration file (netserver.cfg), and the file pointed by value of MSNETTYPECONFIGFILE is called network type configuration file (nettype.cfg). These two files contain configuration attributes that are used for network connections of Empress Servers, so we call them generally as network configuration files.

The default Network Configuration Files are found in $EMPRESSPATH/config directory. The name of these files are set in $EMPRESSPATH/config/inifile as:

   MSNETSERVERCONFIGFILE=netserver.cfg
   MSNETTYPECONFIGFILE=nettype.cfg 

Empress Server looks for files specified in these two environment variables. If they can not be found by their name, the pathes specified by environment variable MSCONFIGFILEPATH are appended to the name of the network configuration files, in their order of appearance. MSCONFIGFILEPATH is explained in [Path for Configuration Files].

Changing the default names of Network Configuration Files, requires setting these environment values to the new names. e.g. in C Shell:

   setenv MSNETSERVERCONFIGFILE new_netserver.cfg 

Most of the configuration attributes in netserver.cfg and nettype.cfg are the same, with some exceptions. The main difference between them is that each block in a nettype.cfg file contains configurations for all of the servers of the same kind. But each block in a netserver.cfg file contains configurations for only one server, for example server named "empodbcsv". Considering the network configuration settings for a specific Empress Server, the value of the configuration variables in network server configuration file override the ones in network type configuration file.

So, whenever the administrator of an Empress Server decides to change the value of a network configuration attribute, it is recommended to set the attribute value in network server configuration file, and not to change the preset value of the attributes in network type configuration file.

6.3.1.1 Network Type Configuration File (nettype.cfg)

The contents of the nettype.cfg are preset during Empress Installation, containing general network information for each type of Empress Servers. Contents of the nettype.cfg generally do not need to be changed by users.

Each nettype.cfg contains blocks that start with MSNETTYPE and end with MSNETTYPEEND. Each nettype.cfg block describes configuration information about one type of Empress Server. The mandatory contents of each nettype.cfg block are:

TYPE
Type of the Empress Server. (For starting a Replication Master Server, it is "replication_master", and for starting an ODBC Server it is "odbc")

Any configuration attribute which is set in a nettype.cfg block is valid for all the servers of a specific type. For example the configuration attributes that are set in a block with:

MSNETTYPE
   TYPE=odbc
   ....
MSNETTYPEEND 
are valid for all the ODBC servers.

6.3.1.2 Network Server Configuration File (netserver.cfg)

netserver.cfg file contains information about each Empress Server. Each netserver.cfg contains blocks that start with MSNETSERVER and end with MSNETSERVEREND. Each netserver.cfg block is uniquely identified by the type and name of the server. For each Empress Sever, a netserver.cfg block is needed. The contents of the netserver.cfg might need to be changed for each Empress server.

The mandatory contents of each netserver.cfg block are:

NAME
Name of the Empress Server for which this block is used.
TYPE
Type of the Empress Server (For starting a Replication Master Server, it is "replication_master", For starting an ODBC Server it is "odbc", and the server name must be set to "empodbcsv")

Highly recommeded to be set

SECURITY_PASSWORD_FILE
Name of the password file. Full path to the file is recommend by Empress. The password file itself is created via emppassword.

Any configuration attribute which is set in a netserver.cfg block is valid only for one specific server. For example the configuration attributes that are set in a block with:

MSNETSERVER
   NAME=empodbcsv
   TYPE=odbc
   SECURITY_PASSWORD_FILE=password_file 
    ...
MSNETSERVEREND
are valid only for the server named "empodbcsv", which the type is "odbc". The value of attributes set in netserver.cfg override the ones in nettype.cfg for the specific server they are set for.

Caveat:

6.3.1.3 Common Attributes in Network Configuration Files

Following is a list of Network Configuration Attributes that can be set in either netserver.cfg or nettype.cfg.

HOST
Name of the host in which the Empress Server will be running in.
The default value of this attribute is localhost, which means that the applications and the clients assume that the server is running in the host where the application is started. If the Empress Server is running on another machine, that machine's host name or IP address should be assigned to this attribute on the client side.

PORT_SERVICE
Port number for services of Empress Server. Empress Server will be listening to this port for all the Service Requests.
The default value for this attribute is set in netserver.cfg for Replication Master Server, and is set in nettype.cfg for Connectivity Server.

PORT_ADMIN
Port number for administration of Empress Server. Empress Server will be listening to this port for all the Administration Requests. The Spooler will spawn and maintain one Administration Server to handle all administrative requests.
The default value for this attribute is set in netserver.cfg for Replication Master Server, and is set in nettype.cfg for Connectivity Server.

ADMINISTRATOR
Login Name of the Administrator of the Empress Server. This is the name of the user that will start and administrate the Empress Server.
Note that administrative operations are different from non-administrative operations on an Empress Server. Refer to [Empress Server Administration Utility] to see which operations are administrative.

TIMEOUT_OPEN_INIT
The timeout value in Seconds, that the client will wait for the "accept" message from the server, after the client sends a "start connection" message to the server. This is for the clients to check that the Empress server is up, and the connection is established. If the "accept" message is not received within the timeout period, the client assumes that the server can not be reached. Zero means infinity time, so such a timeout check will not be made.

TIMEOUT_OPEN_REPLY
The timeout value in Seconds, that the client will wait for the "open success" message from the server, after the client sends a "open connection" message to the server. This is for the clients to make sure that after successful connection, the Empress server is still up, and the connection is established. Zero means infinity time, so such a timeout check will not be made.

TIMEOUT_OPEN_MESSAGE
The timeout in Seconds that the server should be waiting for the first message from the client after system connection is established. Zero means infinity time, so such a timeout check will not be made.

TIMEOUT_NORMAL
The timeout in Seconds that the client should be waiting for the reply of their requests to the server. This attribute must be set very carefully, because a timeout on this operation can be because of the slow connection of the network between client and server, because the server is down, and also because the operation request of the client has taken long to respond, and the server might be still executing the request of the client.

TIMEOUT_CLIENT_IDLE
The timeout in second which a server process should wait for any client activity before it timeout and terminates the client. You will get a message in the server log to that effect. The variable default to nothing or 0, which means no timeout.

TIMEOUT_IDLE
The timeout in second which an idle server process should wait for client connection before it terminates. This serves as a way for the number of server processes to decrease automatically after activities causes the number of server processes spawned to rise from the minimum.

SPOOLER_PROG
Name of the Spooler Program of Empress Server. The Empress Server Administration Utility will check the path and program name in this attribute to execute the Spooler.

SERVER_ADMIN_PROG
Name of the Administration Server Program of Empress Server. The Empress Server Administration Utility will check the path and program name in this attribute to execute the Administration Server.

SERVER_SERVICE_PROG
Name of the Service Server Program of Empress Server. The Empress Server Administration Utility will check the path and program name in this attribute to execute the Service Server.

LISTEN_BACKLOG
This attribute defines the maximum length that the queue of pending connections may grow to. If a connection request arrives when the queue is full, the client may receive an error.

NUM_SERVERS_MIN
The number of Service Servers that the Spooler will initially spawn.

NUM_SERVERS_MAX
The number of additional Service Servers that the Spooler will spawn when the NUM_SERVERS_MIN Service Servers are all busy. The Spooler will maintain between NUM_SERVERS_MIN and NUM_SERVERS_MAX Service Servers.

NUM_CLIENTS_PER_SERVER_ADMIN
Number of clients that the Administration Server will be serving simultaneously. If the number of Administration Requests exceed this number, the requesting client will receive a message indicating that the Administration Server has reached its maximum number of allowed clients, and it can not service any other client at this time.

NUM_CLIENTS_PER_SERVER_SERVICE
Number of clients that each of the Service Servers will be serving simultaneously. If the number of service requests exceed this number, the requesting client will receive a message indicating that the Service Servers have reached their maximum number of allowed clients, or the service request will go to any other available idle Service Server.

SECURITY_ENFORCE_USERNAME
If this attribute is set, the "Empress Server Login name" is checked to be the same as "operating system user name" of the request.

SECURITY_CHECK_PASSWORD
If this attribute is set, then the Empress server will check the user name and password of the requesting client's user (as sent by configuration attributes of User Authorization Configuration File), with the password file which is pointed by values of SECURITY_PASSWORD_FILE configuration attribute.

SECURITY_PASSWORD_FILE
The name of the password file that the Empress Server will check for the validity of the clients' login and passwords. It has the same format as UNIX password files.

MAX_CLIENTS_PER_SERVER_ADMIN
The maximum number of services made by the Administration Server of an Empress Server before it self-terminates, and a new Administration Server starts. Zero means infinity, so the number of services served by the Administration Server will not be checked by the spooler.

MAX_CLIENTS_PER_SERVER_SERVICE
The maximum number of services made by one Service Server of a Empress Server before it self-terminates, and a new Service Server starts. Zero means infinity, so the number of services served by the Service Servers will not be checked by the Spooler.

LOGFILE
The name and path to the logfile that will keep the history of the requests made to, and operations performed by a Empress server. If it is not specified, the logfile will be created in the directory that the Empress Server will be started in, with the name: <server_name>.log, where <server_name> is the name of the Empress Server started.

CLIENT_SNDBUF_SIZE and CLIENT_RCVBUF_SIZE
Send and Receive biffer sizes for the client

SERVER_SNDBUF_SIZE and SERVER_RCVBUF_SIZE
Send and Receive biffer sizes for the server.

For the four variables CLIENT_SNDBUF_SIZE, CLIENT_RCVBUF_SIZE, SERVER_SNDBUF_SIZE and SERVER_RCVBUF_SIZE, the default value for most of the systems is set to nothing. This means that the Empress Server uses the default value of the system. However there are some systems that may need to set a value for better performance. Users are not recommended to change the values of the last four attributes.

The list of contents of Network Configuration Files are given in [References: Empress Server Environment Variables: Network Configuration Files].

6.3.2 User Authorization

For security issues, some authorization is required for the clients to send requests to an Empress Server, and to perform administrative and non-administrative operations on Empress Servers.

The administrator of an Empress Server is the only user that has the authorization to perform administrative operations on an Empress Server. Administrative operations are described in [Empress Server Administration Utility], as "An Administrative Command". The commands that are not indicated as "An Administrative Command" are treated like client requests.

The Administrator of an Empress Server decides whether the authorization of the clients should be checked. A client of an Empress Server is either a utility sending requests to a running Empress Server, or a user of [Empress Server Administration Utility], performing non-administrative operations on an Empress Server. The authorization of the client is a combination of a login name and password. If the Empress Server is configured to check the authorization, it prompts the user for a login name and password. It checks this login name and password with contents of a password file. This password file is specified when running the Empress Server, and is readable and writable by that Empress Server. If the login is not authorized, it gives an error message and refuses to proceed with request.

For an Empress Server a "Empress Server login name" is the name to login to the Empress Server. This is the name provided by the user when prompted for login name. The "user name" is the name to login to the operating system. Regularly a user with any "user name" who knows a correct combination of a "Empress Server login name" and password approved by an Empress Server, can access that Empress Server. The administrator of an Empress Server can enforce the "Empress Server login name" to be the same as "user name".

The configuration attributes in Network Configuration File which their value is used for authorization purposes are as follows:

6.3.2.1 User Authorization Configuration File

The value of environment variable MSUSERAUTHCONFIGFILE is name of User Authorization Configuration File. A User Authorization Configuration File contains authorization information personal to a user of Empress Servers.

Each User Authorization Configuration File contains User Authorization blocks that start with MSUSERAUTH and end with MSUSERAUTHEND. Each User Authorization Block contains Empress Server Name , Login Name and Password.

The default value of MSUSERAUTHCONFIGFILE is null. If this environment variable is set to a User Authorization Configuration File, for every request to an Empress Server, the contents of User Authorization Configuration File are passed to that Empress Server. If an Empress server needs to do user authorization check, the contents of User Authorization Blocks passed to that server, are checked. This removes the necessity of typing the login name and password of the requester, for every request to an Empress Server.

Following is a list of configuration attributes set in User Authorization Configuration File. The explanation of User Authorization Configuration File is given in [References: User Authorization Configuration File].

Contents of User Authorization Configuration file:

MSUSERAUTH 
   SERVER=server    
   LOGIN=login     
   PASSWORD=password
MSUSERAUTHEND

6.3.3 Path for Configuration Files

  MSCONFIGFILEPATH=path_to_config_files 
path_to_config_files contains a list of full path names to the files used for Empress Server Configuration. These are the files set by environment variables MSNETSERVERCONFIGFILE , MSNETTYPECONFIGFILE , and MSUSERAUTHCONFIGFILE. The list of path files are separated by semicolons and is searched in order, beginning from the start of the list.

The default value of MSCONFIGFILEPATH (as set in $EMPRESSPATH/config/initfile) is:

  MSCONFIGFILEPATH="$HOME/.empress;$HOME;${EMPRESSPATH}/config"

So Empress Server looks for Empress Server configuration files (namely nettype.cfg, netserver.cfg and user authorization configuration file) in the value set by their corresponding environment variables: MSNETSERVERCONFIGFILE, MSNETTYPECONFIGFILE and MSUSERAUTHCONFIGFILE. If they can not be found by their name, the pathes specified by environment variable MSCONFIGFILEPATH are appended to the name of the network configuration files, in their order of appearance. Also note that the first path in MSCONFIGFILEPATH has the highest priority to be searched for the Files matching the names set by the environment variables.

For example if you have netserver.cfg file in both $HOME/.empress directory and ${EMPRESSPATH}/config directory, the former one will be used. If you want to use other directories, set the value of MSCONFIGFILEPATH to contain that directory as its first path.

Example:

Consider the following settings:
MSNETSERVERCONFIGFILE=netserver.cfg
MSCONFIGFILEPATH="$HOME/.empress;$HOME"
  1. The Empress Server looks for file named netserver.cfg in the current directory where Empress Server is started.
  2. If it can not find it there, it will append $HOME/.empress/ path before the name of the file, and will search for $HOME/.empress/netserver.cfg.
  3. If not found, it will append the next order and will search for $HOME/netserver.cfg.

6.4 Empress Server Log Analyzer Utility

Empress Server Log Analyzer Utility empsvlogstat is used to analyze and display data from the Empress Server Log File. Empress Server Log File is created on the start-up of Empress Server in order to keep the history of the operations performed by Empress Server, and the history of the client requests being made to an Empress Server.

It contains useful information that could be used in order to get more insight in the usage of the particular Empress Server. Empress Server Log Analyzer Utility empsvlogstat is implemented to give users additional capability to analyze the contents of the log file and display aggregate statistical results for the time frame in question. empsvlogstat could give answers to the following questions and to many other:

6.4.1 Empress Server Log Analyzer Utility empsvlogstat Usage

Several log analysis functions have been provided. The functions report the unique user information, number of servers started up, number of servers in use and number of idle servers, number of connections, connection duration, and number of rejected connections due to insufficient licenses.

The Empress server log analysis functions are performed by empsvlogstat which has the following syntax:

  empsvlogstat logfile_spec [keywords]... [start_time end_time [interval]] [dump] 
where:
logfile_spec can be either of:
  • svname
    Empress Server name from the Server configuration file
  • -f log_file
    Empress Server Log File
keywords can be any combination of:
  • user (or uniqueusers)
    Display unique user information
  • up (or upservers)
    Display number of servers started up
  • idle (or idlseservers)
    Display number of idle servers
  • used (or usedservers)
    Display number of servers in use
  • conn (or connections)
    Display number of connections
  • dur (or connectiondurations)
    Display connection duration
  • lic (or licenceexceeded)
    Display number of rejected connections due to insufficient licenses
start_time start point to analyze statistical data, with following input format :
  • start
    start from the beginning of log file
  • "yyyy-mm-dd hh:mm:ss"
    Full date and time. This should be specified as a quoted string.
  • hh:mm:ss
    use today as date
end_time end point to analyze statistical data, with following input format :
  • end
    end at the end of log file
  • "yyyy-mm-dd hh:mm:ss"
    Full date and time. This should be specified as a quoted string.
  • hh:mm:ss
    use today as date
interval
sample period to collect data for analyzing, with the input format:
hh:mm:ss
The default value is calculated as:
(end_time - start_time) / 10.
If the result is less than a second, a second will be chosen as the interval value.
dump option which suppresses most of the labels and forces printing values alone. The values are separated by the special separator character CTRL-V.

6.4.2 Examples

Examples in the following sections describe how empsvlogstat utility can be used to display particular detailed or aggregate information from the Empress Server Log File. If the utility is used to display information associated to all of the keywords (i.e. user, up, idle , ...) the following command at the operating system prompt could be used:
      empsvlogstat sv1 
where sv1 is Empress Server name from the Empress Server configuration file.

6.4.2.1 Display Unique User Information

To display the unique user information from the server log file, the following commands at the operating system prompt could be used:
      empsvlogstat sv1 user 
This command will display unique user information (user name, number of connections and the average duration per connection) from the entire log file.
      empsvlogstat sv1 user start end 00:00:10
will display unique user information from the entire server log file having a sample period (i.e. interval) 10 seconds.
      empsvlogstat -f svlogfile.log user 11:15:00 end dump
will display unique user information from the specified log file "svlogfile.log" having in scope only data entered at 11:15:00 till the end of log file. The "dump" option suppresses most of the labels and prints values alone. The values are separated by the Empress separator Ctrl+V. The output, when using "dump" option, could be useful as input to some 3rd party graphical tools. The example of the output of the command empsvlogstat sv1 user is:
start time : 2000-03-22 10:09:06
end   time : 2000-03-22 10:10:14
interval   : 00:00:07

Name                                                        #Conn  Avg Duration
------------------------------------------------------  --------- ------------
robert(robert@localhost)                                        1    00:00:01
robert(robert@apple.empress.com)                                3    00:00:20
steven(steven@orange.empress.com)                               4    00:00:35

Total #Unique Users: 3

6.4.2.2 Display Number of Servers Started Up

An Empress Server contains several components which are a Spooler, an Administration Server and one or more Service Servers. A command:
      empsvlogstat sv1 up 
will display how many servers (i.e. Service Servers plus Administration Server) were up, what the minimum, maximum and average number of servers was over the time frame, scope of the log file. The example of the output of the command empsvlogstat sv1 up is:
start time : 2000-03-22 10:09:06
end   time : 2000-03-22 10:10:14
interval   : 00:00:07

                      #Up
                     -----
10:09:06                4
10:09:13                4
10:09:20                4
10:09:27                4
10:09:34                4
10:09:41                4
10:09:48                4
10:09:55                4
10:10:02                4
10:10:09                4

                      #Up
                     -----
Min                     4
Max                     4
Avg                     4

6.4.2.3 Display Number of Idle Servers

To display the number of idle servers from the server log file, the following command could be used:
      empsvlogstat sv1 idle 
The output of the command will also show the minimum, the maximum and the average number of idle servers over the time frame, scope of the log file. For example:
start time : 2000-03-22 10:09:06
end   time : 2000-03-22 10:10:14
interval   : 00:00:07

                     #Idle
                     -----
10:09:06                 3
10:09:13                 3
10:09:20                 3
10:09:27                 2
10:09:34                 3
10:09:41                 2
10:09:48                 3
10:09:55                 3
10:10:02                 3
10:10:09                 3

                     #Idle
                     -----
Min                      2
Max                      3
Avg                      3

6.4.2.4 Display Number of Servers in Use

To display the number of servers in use, the following command could be used:
   empsvlogstat sv1 idle 
The output of the command will also show the minimum, the maximum and the average number of servers in use over the time frame, scope of the log file. For example:
start time : 2000-03-22 10:09:06
end   time : 2000-03-22 10:10:14
interval   : 00:00:07

                     #Used
                     -----
10:09:06                 1
10:09:13                 1
10:09:20                 1
10:09:27                 2
10:09:34                 1
10:09:41                 2
10:09:48                 1
10:09:55                 1
10:10:02                 1
10:10:09                 1

                     #Used
                     -----
Min                      1
Max                      2
Avg                      1

6.4.2.5 Display Number of Connections

To display the number of connections over the time frame defined by the log file, the following command could be used:
   empsvlogstat sv1 conn 
The output of the command will also show the minimum, the maximum and the average number of connections and the total number of connections over the time frame, i.e. scope of the log file. For example:
start time : 2000-03-22 10:09:06
end   time : 2000-03-22 10:10:14
interval   : 00:00:07

                      #Conn
                     --------
10:09:06                  1
10:09:13                  1
10:09:20                  1
10:09:27                  2
10:09:34                  1
10:09:41                  2
10:09:48                  1
10:09:55                  1
10:10:02                  1
10:10:09                  1

                      #Conn
                     --------
Min                       1
Max                       2
Avg                       1

Total Connections:                 4

6.4.2.6 Display Connection Duration

To display the connection durations over the time frame defined by the log file, the following command could be used:
   empsvlogstat sv1 dur 
The output of the command will also show the minimum, the maximum and the average connection durations (per interval) and the average duration for all connections over the time frame, i.e. scope of the log file. For example:
start time : 2000-03-22 10:09:06
end   time : 2000-03-22 10:10:14
interval   : 00:00:07

                       Conn Dur
                     ----------
10:09:06               00:00:01
10:09:13               00:00:14
10:09:20               00:00:00
10:09:27               00:00:17
10:09:34               00:00:00
10:09:41               00:00:28
10:09:48               00:00:00
10:09:55               00:00:00
10:10:02               00:00:00
10:10:09               00:00:00

                       Conn Dur
                     ----------
Min                    00:00:00
Max                    00:00:28
Avg                    00:00:06

Avg Duration for All Connections:  00:00:15

6.4.2.7 Display Number of Rejected Connections Due to Insufficient Licenses

To display the number of rejected connections due to insufficient licenses over the time frame defined by the log file, the following command could be used:
      empsvlogstat sv1 lic 
The output of the command will also show the minimum, the maximum and the average number of rejected connections due to insufficient licenses over the time frame, i.e. scope of the log file. For example:
start time : 2000-03-22 10:09:06
end   time : 2000-03-22 10:10:14
interval   : 00:00:07

                     #Rejected
                     ---------
10:09:06                     0
10:09:13                     0
10:09:20                     0
10:09:27                     0
10:09:34                     0
10:09:41                     0
10:09:48                     0
10:09:55                     0
10:10:02                     0
10:10:09                     0

                     #Rejected
                     ---------
Min                          0
Max                          0
Avg                          0

Total Connections Rejected:        0

6.5 Password File Utility

The pourpose of Empress Password File is to control the access of users of Empress Servers. The Empress Password File can be either the operating system's default, (usually /etc/passwd) or a user-created one. Note that the user can not use a copy of /etc/passwd file as a password file.

We suggest using a user-created password, as it provides more functionality and more specific control, required for Empress Server users. By using a user-created password file, the control of Empress Server users will be done by Empress DBA instead of the operating system administrator.

If you want to use the operating system's default password file and do not want to expose services other than database usage to a user, one solution is to specify the login shell of that user to an exit program (immediately logout after login).

An Empress Server expects the Empress Password File to be in the location set by SECURITY_PASSWORD_FILE configuration attribute in [Network Configuration Files]. Users usually have to change the value of this configuration attribute in netserver.cfg file to point to their own created Empress Password File.

Empress provides emppassword utility to manage the user-created password files used by Empress Server.

6.5.1 Creating a password file

To create a password file, the following command can be used:
 emppassword -f password_file create
This will create an empty password file named password_file.

If a running Empress Server is accessible, and the user wants to create a password file similar to the one accessed by that running Empress Server, the following command can be used:

 emppassword server_name create
This command will create a password file similar to the one set by SECURITY_PASSWORD_FILE configuration attribute in [Network Configuration Files].

6.5.2 Adding Users

To add a user to the password file, the following command can be used:
 emppassword -f password_file add user_login_name [options]
This command will add a login entry to the password file.

If a running Empress Server is accessible, and the user wants to deal with password file accessed by that running Empress Server, the following command can be used:

 emppassword server_name add user_login_name [options]
This command will add a login entry to the password file set by SECURITY_PASSWORD_FILE configuration attribute in Network Configuration Files.

6.5.3 Deleting Users

To delete a user from the password file, the following command can be used:

 emppassword -f password_file del user_login_name
This command will delete a login entry from the password file.

If a running Empress Server is accessible, and the user wants to deal with password file accessed by that running Empress Server, the following command can be used:

 emppassword server_name del user_login_name
This command will delete a login entry from the password file set by SECURITY_PASSWORD_FILE configuration attribute in Network Configuration Files.

6.5.4 Listing the User Information

To list the user information from the password file, the following command can be used:
 emppassword  -f password_file list [user_login_name]
This command will list information about the login entry user_login_name from the ODBC server password file. If user_login_nameis not specified, the information of all users will be listed.

If a running Empress Server is accessible, and the user wants to deal with password file accessed by that running Empress Server, the following command can be used:

 emppassword  server_name list [user_login_name] [-fast]
This command uses the password file set by SECURITY_PASSWORD_FILE configuration attribute in Network Configuration Files. If -fast option is specified, the host name will not be printed with the IP address.

6.5.5 Updating User Information

To update the user information in the password file, the following command can be used:
 emppassword -f password_file  upd user_login_name [options]
This command will update user information of the user specified by user_login_name.

If a running Empress Server is accessible, and the user wants to deal with password file accessed by that running Empress Server, the following command can be used:

 emppassword server_name upd user_login_name [options]
This command uses the password file set by SECURITY_PASSWORD_FILE configuration attribute in Network Configuration Files.

6.5.6 Options of the commands

Here are the [options] that can be used with some of the commands of emppassword utility.

 -accept [+-]HOST[,...] Add or remove hostname from the accept control list.
 -accept off            Turn off accept control. The accept control list
                        is ignored and is not modified by the option.
 -accept on             Turn on accept control.
 -c COMMENT             specify the comment about the user LOGIN
 -fast                  This option is for the 'list' operation. If this
                        option is specified, the host name will not be
                        printed with the ip address.
 -p                     prompt for password (in update operation)
 -reject [+-]HOST[,...] Add or remove hostname from the reject control list.
 -reject off            Turn off reject control. The reject control list
                        is ignored and is not modified by the option.
 -reject on             Turn on reject control. The reject control list
                        is ignored and is not modified by the option. 

The keyword HOST used in above specification has the following format:

localhost               The string 'localhost'.
HOSTNAME                The host name of the machine. It will be translated 
                        to an IP address in numbers-and-dots notation.
HOSTNAME.DOMAIN         The host name of the machine. It will be translated
                        to an IP address in numbers-and-dots notation.
xxx.xxx.xxx.xxx         The IP address in numbers-and-dots notation.
xxx.xxx.xxx.*           The wild card specification to cover all IP address of a 
                        class C network.