Skip to content

4. altiMon#

About altiMon#

altimon.sh monitors the status of the Altibase server process and the related host system.

altimon.sh {start | stop}

Syntax#

Parameters#

Parameter Description
start Run altimon
stop Terminates altimon

Description#

altiMon consistently monitors Altibase server and the related host system in order to record the collected data into the log files.

altiMon mainly monitors information on operating system and database, and refer to the Setting altiMon Configuration for in-depth information.

start#

  1. Set the JAVE_HOME environment variables.

  2. Run the command.

    • Unix Platforms
    $ altimon.sh start
    
  3. If operation fails, verify the file $ALTIBASE_HOME/altiMon/logs/altimon.log.

stop#

  • Unix Platforms

    $ altimon.sh stop
    

Operating System#

altiMon uses PICL library written in C language in order to collect information on operating system. The PICL library is available on the operation systems describe in the chart below.

OS CPU PICL Library
AIX
AIX 5.3 AIX 6.1 AIX 7.1 PowerPC aix-ppc64-5.so
HP-UX
HP-UX 11.31 Itanium (IA-64) hpux-ia64-11.sl
Linux
Red Hat Enterprise Linux 6.0 x86-64 linux-x64.so
Red Hat Enterprise Linux 6.5 PowerPC linux-ppc64.so
Red Hat Enterprise Linux 7.2 PowerPC (Little Endian) linux-ppc64.so

it can also be used after checking whether the PICL for the lower version works on the OS version that is not supported.

$ cd $ALTIBASE_HOME/altiMon # java -Dpicl="<picl_lib_file>" -jar lib/com.altibase.picl.jar

Example:

This procedures verifies that the "aix-ppc64-5.so" PICL library is available on the unsupported version of the AIX operating system and runs altimon

  1. Verify that PICL for lower versions works.

    $ cd $ALTIBASE_HOME/altiMon 
    $ java -Dpicl="aix-ppc64-5.so" -jar lib/com.altibase.picl.jar
    
  2. After the general operation is verified, open the $ALTIBASE_HOME/bin/altimon.sh file and set the PICL file in the PICL_LIB variable.

    PICL_LIB=-Dpicl="aix-ppc64-5.so"
    
  3. Run altimon

    $ altimon.sh start
    

Notes#

altiMon requires Java 8 version or later to operate.

The user should select the Java version equivalent to the number of bits of the PICL C library. For example, if the PICL C library is linux x64, 64bit Java should be used.

Setting altiMon Configuration#

It is required that the following files located in the $ALTIBASE_HOME/altiMon/conf directory should be configured in order to properly use altiMon

config.xml#

This file configures Altibase access and altiMon control information.

Tag Name Status Description
<Altimon Name='String' monitorOsMetric="true|false"> Mandatory The monitorOsMetric attribute specifies whether or not to measure the OsMetrics. Default Value: TRUE It should be set to false when there is no PICL C library that can be compatible to the user environment.
<DateFormat> Optional tag. Date and time format when recording logs. Default Value : yyyy-MM-dd HH🇲🇲ss Refer to the Java Document for the date format which is available to select.
<Interval> Optional Data collection cycle. Default Value : 60(sec) The specified values are applied unless intervals are specified in the settings, or .However, the is not affected.
<CpuSamplingInterval> Optional This is the execution cycle of the thread that measures CPU utilization (%). The default value is 3, and the unit is second.
Since Altibase 7.1.0.8.4, OS CPU utilization measurement thread and ALTIBASE HDB CPU utilization measurement thread have been added to measure CPU utilization. Each thread measures the CPU usage rate at the CpuSamplingInterval cycle, and these values are referred to in the monitoring element. Since the OS CPU utilization measurement thread and the ALTIBASE HDB CPU utilization measurement thread operate as separate threads, a time difference may occur between the two measurement values when the CPU is overloaded.
<LogDir> Optional tag should be specified when using an extra disk;otherwise, the following directory would be set to default as following: $ALTIBASE_HOME/altiMon/logs
<MaintenancePeriod> Optional Log file maintenance period Default Value : 3 days
<Target Name='String'> Mandatory This tag indicates the monitoring target database. Name: name
<HomeDirectory> Optional tag sets ALTIBASE_Home directory as an absolute path. If it is not specified, the ALTIBASE_HOME environment variable will be used.
<DBConnectionWatchdogCycle> Optional This tag indicates the execution cycle of DB connection watchdog.DB connection watchdog enables monitoring target database to continue monitoring by periodically attempting to access to the database even after shutting down. Default Value : 60(sec)
<User> Optional Connected user. If this file is not specified, altiMon will connect via SYS user.
<Password Encrypted="Yes | No"> Mandatory When the encrypted attributes is "No", and even if the user registered the password, altiMon alters the encrypted attributes to "YES", and thus, the password is also encrypted.
<Port> Mandatory Port number
<NLS> Mandatory NLS_USE
<DbName> Optional Database Name
Default Value : mydb
<IPv6> Optional IPv6 status of use
Default Value: false

Metrics.xml#

The following categories provide information on the Metrics.xml file which can configure the predefined OS Metrics, and SQL Metrics, as well as user-defined OS Metrics(Command Metric).

Tag Name Description
<OSMetric Name='PROC_CPU_USER' Activate='true' Interval='30' Logging='true'> This tag configures the predefined OS Metric and uses predefined OS Metrics as in the following. TOTAL_CPU TOTAL_CPU_USER TOTAL_CPU_KERNEL PROC_CPU PROC_CPU_USER PROC_CPU_KERNEL TOTAL_MEM_FREE TOTAL_MEM_FREE_PERCENTAGE PROC_MEM_USED (=> RSS) PROC_MEM_USED_PERCENTAGE SWAP_FREE SWAP_FREE_PERCENTAGE DISK_FREE DISK_FREE_PERCENTAGE DISK_FREE or DISK_FREE_PERCENTAGE must have the tag as belows, and the 'Disk Name' should be uniquely named.
<OSMetric Name='DISK_FREE' Activate='true'>
<Disk Name='disk1'>/home</Disk> </OSMetric> <OSMetric Name='DISK_FREE' Activate='true'> <Disk Name='disk2'>/home2</Disk> </OSMetric>
<SQLMetric Name='MEM_DATABASE_USAGE' Activate='true' Interval='60' Logging='true'> This configures the SQL Metric, and it is required to define a Name.
Name: Metric name (Required)
Activate: Status of operation(Data Collection)
The specifiable value is either true or false, and default value is true.
Interval: If the cycle of data collection is not specified, the specified values in the config.xml file is used.
Logging: It sets whether or not to log the result of data collection into the log file. The default value is set to true. Set to false if you want to record only the alert info.
<CommandMetric Name='MEM_VSZ' Activate='true' Interval='60' Logging='true'> This tag configures the user-defined OS Metric. The altiMon executes a command or script specified in the tag, and the value output as stdout is used as measured value.
<Query> This tag configures a query, and it is necessary in case of SQL Metric.
<Command> The tag configures command or script file, and it is required for CommandMetric. The script file can be set up by an absolute or relative path. The relative path is based up on the following directory: $ALTIBASE_HOME/altiMon
<Alert Activate='true' ComparisonColumn='ALLOC_MEM_MB' ComparisonType='gt'> Warning setup optional.
The measured values which are compared with the threshold values should be numbers.
Activate: Operation status, optional. (Default value: True)
Comparison: Column the target column which will be compared with threshold value. (Optional)
ComparisonType: comparison operator. (Required)
-eq: is equal to the threshold value
-ne: is not equal to the threshold value
-gt: is greater than the threshold value
-ge: is greater than or equal to the threshold value
-lt: is less than the threshold value
-le: is less than or equal to the threshold value
<WarningThreshold Value='500'> or <CriticalThreshold Value='800'> This tag can specify the threshold values.(Possible to set 'Critical' and 'Warning' level)
In case of , it is required.
Value: threshold values
<ActionScript>db_usage.sh</ActionScript> This tag configures the script file name to be executed when the threshold value is out of the specified range.
The script file should be existing in the following directory : $ALTIBASE_HOME/altiMon/action_scripts

GroupMetrics.xml#

The GroupMetrics.xml is a file defining the Group Metrics, which is comprised of OS Metric, Command Metric, and SQL Metric. The GroupMetric can be defined by using metrics specified in Metrics.xml.

Unlike the common Metric measured values are stored to the *.log file, the data collected by group metric are stored to CSV files.

Tag Name Description
<GroupMetric Name='group1' Interval='30'> Configure Group Metric.
Name: metric name (Required)
Activate: Data collecttion status (Optional). Available value is either true or false. The default value is true.
Interval: Data collection cycle (Necessary)
<Target MetricName='PROC_CPU_USER'/> This specifies the base metric which will be included in the group metric.
MetricName: The name of OSMetric, Command Metric or SQLMetric whick is defined in Metrics.xml.
A SQL Metric should necessarily retrieve one row of a SELECT query. When specifying DISK_FREE, or DISK_FREE_PERCENTAGE, a character string which is linked with 'Metric Name' and 'Disk Name' with '.' should be specified as a MetricName.
<Target MetricName='DISK_FREE.disk1'/>
<Column Name='LOG_GAP' /> In the case of the SQL Metric, the columns which will be included in the group metric are specified by this tag.
If this tag is not specified, every select target will be included in the Group Metric.
Name: The target column used in a SELECT query. If you specify an alias, the alias should be used.

Others#

  • action_scripts directory
    In order to normally execute a script file specifying the tag, the script file should be located in the directory $ALTIBASE_HOME/altiMon/action_scripts.
    For example, 'db_usage.sh' file in db_usage.sh should be located under the action_scripts directory in order for a script file to normally executes.

Example#

The followings are examples of the altiMon configuration files.

config.xml#

<?xml version="1.0" encoding="UTF-8"?>

<config>
    <Altimon Name='rnd1'>
        <!-- <LogDir>/home/bethy/arugs/logs</LogDir> -->
        <DateFormat>yyyy-MM-dd HH:mm:ss</DateFormat>
        <MaintenancePeriod>3</MaintenancePeriod>
        <Interval>60</Interval>
    </Altimon>
    <Target Name='Altibase1'>
        <HomeDirectory>/home/bethy/work/altibase_trunk/altibase_home</HomeDirectory>
        <User>sys</User>
        <Password Encrypted="NO">manager</Password>
        <Port>20020</Port>
        <DbName>mydb</DbName>
        <NLS>KSC5601</NLS>
        <IPv6>FALSE</IPv6>
    </Target>

</config>

OSMetrics.xml#

<?xml version="1.0" encoding="UTF-8"?>

<Metrics>
  <OSMetric Name='TOTAL_CPU' Activate='true' Description='TOTAL_CPU'>
  <OSMetric Name='PROC_CPU' Activate='true' Interval='60'>
    <Alert Activate='true' ComparisonType='gt'>
        <WarningThreshold Value='80'>
            <ActionScript>cpu_act.sh</ActionScript>
        </WarningThreshold>
    </Alert>
  </OSMetric>

  <SQLMetric Name='MEM_DATABASE_USAGE' Activate='true' Interval='30'>
    <Query>select
            trunc(mem_alloc_page_count*32/1024, 2) as alloc_mem_mb,
            trunc(mem_free_page_count*32/1024, 2) as free_mem_mb
            from v$database</Query>
    <Alert Activate='true' ComparisonColumn='ALLOC_MEM_MB' ComparisonType='GT'>
        <CriticalThreshold Value='8000' >
            <ActionScript>db_usage.sh</ActionScript>
        </CriticalThreshold>
    </Alert>
  </SQLMetric>

  <CommandMetric Name='MEM_VSZ'>
    <Command>scriptsDir/vsz.sh</Command>
    <Alert Activate='true' ComparisonType='gt'>
        <WarningThreshold Value='100000000'> <!-- in kB -->
            <ActionScript>mem_act.sh</ActionScript>
        </WarningThreshold>
    </Alert>  
</CommandMetric>
</Metrics>

GroupMetrics.xml#

<GroupMetrics>
    <GroupMetric Name='group1' Interval='30'>
        <Target MetricName='TOTAL_CPU'/>
        <Target MetricName='PROC_CPU'/>
        <Target MetricName='LOGFILE_COUNT'>
            <Column Name='LOG_GAP' />
        </Target>
    </GroupMetric>
    <GroupMetric Name='group2' Interval='60'>
        <Target MetricName='PROC_MEM_USED_PERCENTAGE'/>
        <Target MetricName='MEM_VSZ'/>
        <Target MetricName='LOGFILE_COUNT'/>
    </GroupMetric>
</GroupMetrics>

Output Items#

The items are outptted with the folllowing format in the directories below.

logs directory#

  • altimon.log
    This is the file recording all sorts of logs(info, warn, error) by altiMon daemon.

  • alert.log
    This file records the data relevant to the setting.

  • OsMetrics.log
    This file records all the collected data by all the OS Metric.

  • [SQLMetric_Name].log
    The collected data by SQL Metric are recorded into a different log file for each Metric.

  • [GroupMetric_Name].csv
    The collected data by Group Metric are recorded into a different csv file for each Metric.

  • report.html
    This file reports user configuration setting with a HTML format .

logs/archive directory#

All the files in the logs directory except altimon.log, and *.csv are backed up into a archive/YYYY-MM-DD directory every day.

Among above directories, the directories with expired maintenance period specified in are removed at 1:50am every day.

logs/csv_backup directory#

For Group Metrics, collected data(metric values) are constantly added to the same csv file unless the settings are modified.

However, in case of the changed metric settings meaning that when the target objects in the group metric are changed, the existing csv file is backed up into the logs/csv_backup directory, and data are recorded in a new file with the identical name.