Operations Guide
|
The "lbmmon" library is used in two ways:
The lbmmon source APIs are usually not called directly by user applications. Instead, most users configure Automatic Monitoring, which implicitly uses lbmmon's source APIs. The lbmmon receiver APIs are called by the UM Monitoring Collector Service (MCS) or by a User-Developed Collector.
Informatica recommends the use of automatic monitoring and the MCS. This relieves the user from writing to the lbmmon API.
An application requesting transport monitoring is called a monitor source, and an application accepting statistics is a monitor receiver. These monitoring objects deal only with transport session statistics and should not be confused with UM sources and UM receivers, which deal with UM messages. Statistics for both UM sources and UM receivers can be forwarded by a monitor source application.
Both a monitor source and monitor receiver consist of a monitoring context and control thread and two selectable modules:
You can substitute format and transport modules of your own choosing or creation. UM Monitoring provides the following sample modules:
To view the source code for all LBMMON transport modules, see LBMMON Example source code.
The overall process flow appears in the diagram below.
Your applications only calls functions in the controller modules, which calls the appropriate functions in the transport and format modules.
The segregation of UM Monitoring into control, format, and transport modules provides flexibility for monitor receivers in two ways.
As an example, assume you have a Perl application which currently gathers statistics from other network applications (or, you are simply most comfortable working in Perl for such tasks). There is no Perl binding for UM. However, Perl can handle UDP packets very nicely, and can pick apart CSV data easily. By implementing a UDP transport module to be used by the monitor sources, your Perl application can read the UDP packets and process the statistics.
To use the UDP transport module, the lbmmon APIs must be used. The automatic monitoring feature cannot be configured to use the UDP transport module. However, note that the UDP transport module is deprecated.
The following sections present more discussion and sample source code about starting monitor sources, monitor receivers and the LBMMON format and transport modules.
Informatica recommends using Automatic Monitoring instead of creating your own monitoring source.
The following examples demonstrate how to use the UM Monitoring API to enable monitoring in your application.
First, create a monitoring source controller:
The above code tacitly assumes that the ctx, src, and rcv variables have been previously assigned via the appropriate UM API calls.
The monitoring source controller object must be passed to subsequent calls to reference a specific source controller. One implication of this is that it is possible to have multiple monitoring source controllers within a single application, each perhaps monitoring a different set of objects.
In the above example, the default CSV format module and default UM transport module are specified via the provided module functions lbmmon_format_csv_module() and lbmmon_transport_lbm_module().
Once a monitoring source controller is created, the application can monitor a specific context using:
The above example indicates that statistics for all transports on the specified context will be gathered and sent every 10 seconds.
A UM source can be monitored using:
Finally, an UM receiver can be monitored using:
The two above examples also request that statistics for all transports on the specified source or receiver be gathered and sent every 10 seconds.
Statistics can also be gathered and sent in an on-demand manner. Passing 0 for the Seconds parameter to lbmmon_context_monitor(), lbmmon_src_monitor(), or lbmmon_rcv_monitor() prevents the automatic gathering and sending of statistics. To trigger the gather/send process, use:
Such a call will perform a single gather/send action on all monitored objects (contexts, sources, and receivers) which were registered as on-demand.
As part of application cleanup, the created monitoring objects should be destroyed. Each individual object can be de-registered using lbmmon_context_unmonitor(), lbmmon_src_unmonitor(), or lbmmon_rcv_unmonitor(). Finally, the monitoring source controller can be destroyed using:
Any objects which are still registered will be automatically de-registered by lbmmon_sctl_destroy().
Informatica recommends using the Monitoring Collector Service (MCS) instead of writing your own collector.
To make use of the statistics, an monitoring collector application must be running that receives the monitor data. This application creates a monitoring receive controller, and specifies callback functions which are called upon the receipt of source or receiver statistics data.
See Example lbmmon.c for C code implementing a monitoring receive controller. Or see Example lbmmon.java for equivalent Java code.
The lbmmon library comes with three pre-written transport modules:
For an application or UM daemon to publish its UM statistics, you can choose the desired transport module, typically by configuration (monitor_transport (context) and monitor_transport (event_queue)).
Each transport module can have options that control its behavior. Those options are supplied via an option string. The exact format of the option string can vary according to the format module being used. The format options string is typically supplied by configuration (monitor_transport_opts (context) and monitor_transport_opts (event_queue)).
The LBM transport module publishes statistics using a UM source.
The transport options string is in the form of name/value pairs separated by semicolons. The following name/value pairs are available:
/29west/statistics
is used. As an example, assume your application needs to use a special configuration file for statistics. The following call allows your application to customize the UM transport module using the configuration file stats.cfg.
If your application also needs to use a specific topic for statistics, the following code specifies that, in addition to the configuration file, the topic StatisticsTopic be used for statistics.
It is important to use the same topic and configuration for both monitor sources and receivers. Otherwise your applications may send the statistics, but the monitor receiver won't be able to receive them.
To view the source code for the LBM transport module, see Source code for lbmmontrlbm.c.
Starting in UM 6.14, monitoring transports UDP and SNMP are deprecated in favor of LBM. We do not plan to remove existing UDP or SNMP functionality, and will continue to support them in their current states. But we do not plan to enhance UDP or SNMP in the future.
In particular, UDP datagrams are limited in size to 64K bytes, but when a Store daemon is enabled for protocol buffer format, message sizes can exceed that limit. This is not a risk for CSV format.
The UDP transport module publishes statistics using a simple UDP datagram. It can send or receive UDP unicast, UDP broadcast, and UDP multicast.
The transport options string is in the form of name/value pairs separated by semicolons. The following name/value pairs are available:
To view the source code for the UDP transport module, see Source code for lbmmontrudp.c.
Starting in UM 6.14, monitoring transports UDP and SNMP are deprecated in favor of LBM. We do not plan to remove existing UDP or SNMP functionality, and will continue to support them in their current states. But we do not plan to enhance UDP or SNMP in the future.
To take advantage of new monitoring capabilities, Informatica requests that users migrate to the LBM transport.
The SNMP transport module publishes statistics using a UM source, much like The LBM Transport Module. However, for user convenience, some configuration options are hard-coded to be compatible with the UM SNMP agent component.
To view the source code for the SNMP transport module, see Source code for lbmmontrlbmsnmp.c.
The lbmmon library comes with two pre-written format modules:
For an application or UM daemon to publish its UM statistics, you can choose the desired format module. For UM versions prior to 6.14, only CSV was available. For UM 6.14 and beyond, you can choose CSV or PB, typically by configuration (monitor_format (context) and monitor_format (event_queue)).
A statistics collector subscribes to UM statistics. For UM versions prior to 6.14, only CSV was available. For UM 6.14 and beyond, both are available for use, depending on the format of statistics messages received.
Pre-6.14 collectors (with no knowledge of PB) will work the same as they always have when run with 6.14 and beyond. But they will not process UM statistics arriving in PB format. Informatica recommends updating collector applications to support both formats.
Each format module can have options that control its behavior. Those options are supplied via an option string. The exact format of the option string can vary according to the format module being used. In UM versions 6.14 and beyond, the format options string is typically supplied by configuration (monitor_format_opts (context) and monitor_format_opts (event_queue)).
The PB format module formats UM statistics as Google Protocol Buffers.
The format options string is in the form of name/value pairs separated by semicolons. The following name/value pairs are available:
Where "mode" can be one of three values:
The advantage of "convert" is that the collector can accept both older CSV and newer protocol buffer statistics, but your code can be written to only understand protocol buffers.
For monitoring receivers (collectors), Informatica recommends the PB format module with the "passthrough=convert" format option. This allows the receive controller to correctly process both PB and CSV statistics.
To view the source code for the PB format module, see Source code for lbmmonfmtpb.c.
Starting in UM 6.14, CSV is deprecated in favor of The PB Format Module. We do not plan to remove existing CSV functionality, and we will continue to support it in its current state. But we do not plan to enhance CSV in the future.
The CSV format module formats UM statistics as simple comma-separated values.
The format options string is in the form of name/value pairs separated by semicolons. The following name/value pairs are available:
To view the source code for the CSV format module, see Source code for lbmmonfmtcsv.c.