1. Introduction#
This chapter describes Altibase Monitoring API and its features.
What is Altibase Monitoring API?#
Altibase Monitoring API is an application programming interface that lets users monitor Altibase from an application.
Usage#
Altibase Monitoring API is an interface provided for remote monitoring tool developers and allows developers to easily create monitoring tools. You can also collect monitoring data by directly selecting a performance view on Altibase.
By default, it is not provided for users using other interfaces for database access such as ODBC and JDBC.
Features#
Users can view the following data in an application with Altibase Monitoring API:
- Various statistics while Altibase is running
- The number of currently connected sessions
- The maximum number of clients that can connect to an Altibase server
- Session lock information
- Wait event information
Supported Altibase Versions#
Altibase Monitoring API is supported for Altibase 5.5.1 or later.
Consideration#
Please consider the following while writng and executing an application with Altibase Monitoring API:
-
An Altibase Monitoring API application connects to an Altibase server using a Unix domain socket. Therefore, the application and Altibase need to run on the same server.
-
Memory that is internally allocated by an Altibase Monitoring API function or library is shared by Altibase Monitoring API functions and is not thread-safe. Accordingly, multiple threads should be prevented from concurrently accessing shared memory by synchronization using mutexes. For more detailed information, please refer to Chapter 4: sample_7.c.
Building an Application#
This section discusses the necessary header files and library files for building an Altibase Monitoring API application and how to compile them.
Header File#
The header file that must be included when writing the Monitoring API application and referenced at compile time is altibaseMonitor.h. This file is located in the $ ALTIBASE_HDB_HOME / include directory.
To compile, use the following command-line option.
-I$ALTIBASE_HDB_HOME/include
Library Files#
To build an Altibase Monitoring API application, you need to link the compiled object file to the Altibase Monitoring API library, ODBC library and several other system libraries.
-
Monitoring API library: libaltibaseMonitor.a, libaltibaseMonitor_sl.so
-
ODBC library: libodbccli.a
-
System library: libpthread.a, libdl.a
The Altibase Monitoring API library and ODBC library are located in the $ALTIBASE_HDB_HOME/lib directory.
Compiling#
The following is a sample Makefile that compiles the sample.c source file with the $(ALTIBASE_HOME)/install/altibase_env.mk file that is created when the Altibase package is installed.
include $(ALTIBASE_HOME)/install/altibase_env.mk
sample: sample.o
$(LD) $(LDOUT)sample sample.o $(LFLAGS) -laltibaseMonitor -lodbccli $(LIBS)
The following example compiles the sample.c source file using the gcc and g++ compilers on the console window.
% gcc -c -I$ALTIBASE_HOME/include -o sample.o sample.c
% g++ -o sample sample.o -L$ALTIBASE_HOME/lib -laltibaseMonitor -lodbccli -ldl -lpthread -lcrypt -lrt