DBX Agent Setting
Write the settings for the DBX agent in the whatap.conf file. For the options that can be set, see the following.
Default options
-
license String
To install the agent, set the project access key granted from the server. The project access key includes the agent's project and the encryption key for secured communication.
-
whatap.server.host String
Default
127.0.0.1,127.0.0.1
Specify the IP address of the collection server to transfer the data collected by the agent. If there are multiple IP addresses for collection server redundancy, use comma (,) as the delimiter. The collection server proxy daemon must be serviced in the listening state for the set IP address.
-
whatap.server.port String
Default
6600
Set the port of the collection server. Because only one port can be set, use the same port set in the "whatap_server_host" option.
-
dbms String
postgresql
CautionIf other option values are entered, data collection for monitoring may not work.
-
db_ip String
Set the IP address of the database server to be monitored.
-
db_port String
Set the port used for DB communication.
Data collection
-
tables Boolean
Default
true
It collects the table size information. In Stat/Report > DB size, you can see the table size by selecting the database.
-
tables_hour Int
Default
5
Set the time to collect data for storing the table size information. The default value is
5
and collection starts at 5 am.
-
long_run_session_sec Second
Default
10
The session running longer than the set time is treated as the long run session (unit: second).
-
replication_name String
If you set the replication name, it is considered that there is a Master/Slave relationship between DBs with the same
replication_name
.As an option to define the replication set, if you set the
replication_name
option that has the same value for both master and slave nodes, the Monitoring a Database Instance displays a tree structure. It also provides a widget to monitor the replication status in Flex Board based on the option value.
-
slave_ip string
Check the IP address with
select inet_server_addr();
. It must be one of the IP addresses found when searchingpg_stat_replication.client_addr
on the master node. If thereplication_name
option value is the same and it is a slave DB, specifyslave_ip
.NoteIn case of RDS, because the master/slave relationship is set with
pg_replication_slots.slot_name
instead of the IP address, theslave_ip
option does not need to be set.
-
skip_whatap_session Int
Default
0
If you set
1
, the session in which the query to collect from WhaTap operates, does not appear in the active session list. (Default value: 0)
-
xview_min_sec Int
Default
0
When collecting xview, collection is performed only when the query execution time is longer than the set time. The default setting is to collect all queries whose execution time is longer than 0 seconds.
Enabling the top object
The following is the agent setting to view Top Object information. For more information about Top Object, see the following.
-
pg_object Boolean
Default
false
Set whether or not to collect data from the Top object. To collect data, change it to
true
. -
pg_object_hour Int
Default
5
Set the time to collect data from the Top object. The default value is
5
and collection starts at 5 AM. -
table_bloat_ratio Percentage
Default
50
Data is collected when the table's bloating ratio is greater than the set value. The default value is 50%.
-
table_bloat_bytes Byte
Default
10485760
Data is collected when the table's bloating bytes is greater than the set value. The default value is 10 MB.
-
index_bloat_ratio Percentage
Default
50
Data is collected when the index's bloating ratio is greater than the set value. The default value is 50%.
-
index_bloat_bytes Byte
Default
10485760
Data is collected when the index's bloating bytes is greater than the set value. The default value is 10 MB.
-
autovacuum_list_limit Int
Default
50
Table data is collected according to the set value from the oldest age (
relfrozenxid
). The default value is 50.
Application of AWS RDS CloudWatch
It is the description of the agent configuration using the AWS CloudWatch. If collection is started, the data is input in metrics and can be seen in the db_postgresql_counter
category under Management > Metrics Chart as well as the other metrics.
You can configure it more easily and intuitively through the Cloud Settings menu. Through this menu, you can additionally collect and monitor monitoring metrics provided by cloud services on the dashboard of the database project. For more information, see the following.
-
aws_region String
Set the AWS region.
-
aws_arn String
You can use the ARN of an IAM ROLE with appropriate roles for AWS authentication.
Required role
For the roles, the following policies are required.
Role Role details rds:DescribeDBInstances Collection of the instance class data rds:DescribeDBClusters Collection of cluster data when using the autoscale rds:DescribeDBLogFiles Collection of CloudWatch logs rds:DownloadDBLogFilePortion Collection of CloudWatch logs ec2:DescribeInstanceTypes Collection of CPU counts for each instance class elasticache:DescribeCacheClusters Collection of instance class data when using the elasticache cloudwatch:ListMetrics Collection of the list of CloudWatch metrics cloudwatch:GetMetricStatistics Collection of the values of the CloudWatch metrics logs:DescribeLogStreams Collection of CloudWatch logs (in case of using the posted logs) logs:GetLogEvents Collection of CloudWatch logs (in case of using the posted logs) -
cloud_watch String
Set whether or not to use the CloudWatch Monitoring. The value is
on
oroff
. -
cloud_watch_instance String
Set the instance name of the CloudWatch.
-
cloud_watch_interval Second
Set the interval to get monitoring values by CloudWatch (unit: second).
-
cloud_watch_metrics String
Set the monitoring metric name to be imported into the CloudWatch. You can set it as follows:
cloud_watch_metrics=CPUUtilization,FreeableMemory,FreeStorageSpace,NetworkTransmitThroughput,NetworkReceiveThroughput
Example of configuration for RDS CloudWatch collection
You must create the following default settings to monitor the RDS CloudWatch and collect the related data.
cloud_watch=on
aws_region=ap-northeast-2
# Create roles in AWS IAM and then copy and paste the role ARN value.
aws_arn=arn:aws:iam::999999999999:role/UpdateApp
cloud_watch_metrics=CPUUtilization,FreeableMemory,FreeStorageSpace,NetworkTransmitThroughput,NetworkReceiveThroughput
#Example of the instance name
cloud_watch_instance=pg-rds
-
For more information about the role ARN, see the following link.
-
For information on how to collect data after granting the RDS CloudWatch metric collection role to EC2 without using the IAM ROLE's ARN value, see the following.
Applying the AES 256 encryption
The WhaTap DBX agent transfers the collected data to the server after encryption. You can change this depending on the importance of the data or setting. Basically, the XOR operation and encryption through the AES algorithm are used, and encryption and decryption are performed by dividing the plain text into 128-bit units. It can be expanded up to 256 bits depending on the setting.
Add the following options to the whatap.conf file in the path where the WhaTap DBX agent has been installed.
cypher_level=256
Add the settings and then restart the agent.
Agent name setting
Automatic configuration
If you do not set the agent name in the agent configuration (whatap.conf), the agent name is automatically determined by combining the IP address and the port number. For example, if the IP address is 10.11.12.13 and the port number is 3000, the agent name is set to DBX-12-13-3000.
The key variables that determine the agent name are as follows:
Configuration | Description |
---|---|
{type} | The DBX value is used. |
{ip0} | The first byte of the IPv4 address is used. (e.g. 10 in 10.11.12.13) |
{ip1} | The second byte of the IPv4 address is used. (e.g. 11 in 10.11.12.13) |
{ip2} | The third byte of the IPv4 address is used. (e.g. 12 in 10.11.12.13) |
{ip3} | The fourth byte of the IPv4 address is used. (e.g. 13 in 10.11.12.13) |
{port} | Database server port |
If the IP address is not numeric like RDS, the name is set in the following format: DBX-{ip0}
-{hash}
-{port}
, where the {hash}
value is the IP address that has been converted to 4-digit hexadecimal number.
Manual configuration
To set the agent name manually, enter a desired name for the whatap.name or object_name option in the whatap.conf file. The entered name is assigned to the agent name.
whatap.name=agent-1234
# or
object_name=agent-1234