Monitoring Application Programming Interface


The MAPI SNMP Agent Implementation

The MAPI SNMP Agent refines and extends the SNMP gateway component included in our SOMA-based framework for the distributed management of heterogeneous network elements. It acts as an SNMP manager that locally interrogates its SNMP agent. The MAPI SNMP Agent is programmed to request monitoring information maintained not only in the standard MIB (monitoring data about network elements and protocols), but also, if supported, in the MIB extensions included in the Host Resources Groups called Storage, Running Software, and Running Software Performance (RFC2790). These groups provide information about resource usage of processes currently in execution to obtain the MAPI ProcessInfo and FileSystemInfo, while NetworkInfo exploits the standard SNMP MIB.

The MAPI SNMP Agent can improve the efficiency of standard client/server SNMP operations, especially when dealing with the network transfer of large chunks of monitoring data. It transmits only the changed MAPI indicators to ResourceManager, which maintains old values for the non-received parameters. Most important, the MAPI SNMP Agent locally interrogates its SNMP agent and pre-processes the obtained results to offer concise indicators to possibly remote managers, thus significantly reducing the generated network traffic. In fact, a single MIB variable is usually at a lower level than the MAPI indicators, and an aggregation of multiple variables is required. These aggregations are known as health functions. For instance, the percentage of discarded IP output packets is obtained by combining five MIB variables:

where ipOutDiscards, ipOutNoRoutes and ipFragFails are the number of output IP datagrams discarded (respectively, for problems in buffer space, in routing and in fragmentation), while ipOutRequests and ipForwDatagrams are the total number of IP datagrams transmitted (respectively, locally generated packets and forwarded ones).

In addition, the MAPI SNMP Agent can perform all the operations needed for the support of mutual authentication in case of interaction with SNMPv3 agents. It can obtain dynamically the needed security information from the public key infrastructure integrated with the SOMA programming framework. Finally, it can locally store configuration parameters specific for its SNMP agent (e.g., the supported MIBs), in order to automate the possibly complex phase of initialization of the MAPI tool.

 

The MAPI*ResManager Implementation

When neither the SNMP agent nor the Host Resources MIB extensions are supported on target, ResourceManager can enable the gathering of monitoring data about non-Java processes via native mechanisms. This information is crucial when control actions on SOMA agents mainly depend on runtime conditions of the hosting environment. For instance, a SOMA administrator can enforce a very strict policy on agent CPU usage only when the total CPU usage on the host overcomes a specified threshold. MAPI native modules extract uniform data by exploiting heterogeneous monitoring mechanisms provided by the target operating system. The ResourceManager class employs JNI to load the target-specific native library at runtime. We have currently implemented the native monitoring components for Windows NT (MAPI WindowsRM DLL), Solaris (MAPI SolarisRM SO) and Linux (MAPI LinuxRM SO). Each component integrates with Java via the system-specific classes called MAPI NT ResManager, SVR4 ResManager and Linux ResManager, as depicted in Figure 1.

Figure 4 shows a piece of the MAPI WindowsRM DLL that accesses OS resource state indicators maintained in Microsoft system registry keys. In particular, the figure reports the polling of the registry to obtain updated information about the processes in execution. The system call RegQueryValueEx(HKEY_PERFORMANCE _DATA, …) permits to obtain some performance data. The reported invocation returns a reference to the native method, called perfdata, used to access the whole information about a process with identifier PID.

Figure 4. Monitoring process information in MAPI WindowsRM DLL.

For Solaris and Linux platforms, we have implemented native monitoring modules as dynamic SO libraries that mainly exploit the /proc feature. /proc is a virtual directory that makes visible OS resource state indicators as a specified sub-tree of the file system. The MAPI SolarisRM/LinuxRM library polls monitoring information about currently executing processes by reading the corresponding files in the /proc directory. For instance, the ioctl()call, with PIOCPSINFO and PIOCUSAGE parameters, permits to obtain prpsinfo and prusage information, which maintain several data about the identity of a specified process and its CPU usage, respectively. Similarly, SolarisRM/LinuxRM native components extract the descriptors of the open files from the /proc/PID/fd virtual directory, where PID is the identifier of the monitored process. File descriptors data are combined with information from the system file table, with an approach similar to the one followed in the implementation of the Unix fuser utility. Aggregated information about the network usage is obtained via the invocation of the standard netstat system call.


 
Page updated on
In case of problems, or if you find any bug, please contact us.