Table of Contents

Name

imctr_get, imctr_free, imctr_load - MTA channel counters utilities.

Synopsis

#include <imta.h>

int imctr_load(imctr_t *ctr, char *channel);

int imctr_get(imctr_t ctr, int index, imctr_type_t counter, char **channel);

void imctr_free(imctr_t ctr);

Description

The SIMS IMTA accumulates in the form of counters or message traffic statistics for each of its channels. These statistics, referred to as «channel counters,» correspond to those used by the Mail Monitoring MIB (RFC 1566) with an IMTA channel representing a «group» as defined by RFC 1566.

imctr_load() may be used to gather these counters for one or more channels specified by channel. To obtain counters for more than one channel at a time, use wild cards in the channel name. The only wild-card character available is «*". It stands for 0 or more characters. For instance, to obtain counters for all TCP/IP channels use the name «tcp_*". Similarly, to obtain counters for all channels, use the name «*". imctr_load() returns the number of channels matching channel for which counters were found.

Once the counters have been gathered, individual channel counters may then be obtained by calling imctr_get(). ctr is the imctr_t handle on the counters datastructures gathered with a previous call. If the channel argument passed to imctr_load() led to gathering counters for more than one channel, the counters corresponding to each of these channels can be retrieved by using values of index located between 0 and the value returned by imctr_load() less 1. each call places the name of the corresponding channel in a buffer referenced by channel. counter must be set to the type of counter desired. The available types are:

IMCTR_RECEIVED_MSGS
number of messages enqueued to the channel
IMCTR_SUBMITTED_MSGS
number of messages enqueued by the channel

IMCTR_STORED_MSGS total number of messages currently stored for the channel

IMCTR_DELIVERED_MSGS
number of messages dequeued by the channel
IMCTR_RECEIVED_VOLUME
volume of messages enqueued to the channel as measured in Kilobytes
IMCTR_SUBMITTED_VOLUME
volume of messages enqueued by the channel as measured in Kilobytes
IMCTR_STORED_VOLUME
volume of messages currently stored for the channel as measured in Kilobytes
IMCTR_DELIVERED_VOLUME
volume of messages dequeued by the channel as measured in Kilobytes
IMCTR_RECEIVED_RCPTS
total number of recipients specified in all messages enqueued to the channel
IMCTR_SUBMITTED_RCPTS
total number of recipients specified in all messages enqueued by the channel
IMCTR_STORED_RCPTS
total number of recipients specified in all messages currently stored for the channel
IMCTR_DELIVERED_RCPTS
total number of recipients specified in all messages delivered by the channel

After the counters have been used, the memory allocated to store the counters must be freed with imctr_free(). The argument ctr points to the channel counters structure returned by a previous call to imctr_get().

Return Values

If successful, imctr_load returns the number of channels matching channel for which counters were found.

If successful, imctr_get returns the requested counter value.

Otherwise, these functions can fail for one of the following reasons:

IMRC_INVALID_COUNTER_TYPE

The counter requested via imctr_get() is unknown.

IMRC_OUT_OF_MEMORY
The system is out for memory, and imctr_load() is not able to allocate the necessary values.

IMRC_LOCK_ERROR imctr_load() fails due to a contention to access counters information in the MTA.

IMRC_CHANNEL_NAME_TOO_LONG
The string argument channel passed to imctr_load() is longer than IM_CHANNEL_LEN bytes.

Attributes

center, box; c | c l | l .
Attribute Type Attribute Value
_

Architecture
sparc, x86 _ Availability SUNWimsdk _ MT-Level MT-Safe _ Interface Stability Stable

See Also

imta.cnf(4) .


Table of Contents