Diagnostic — Configuration
Edit Config.sh to set log time ranges and service mappings before running the script.
Configuration#
Before running the script, it's essential to modify the Config.sh file located in the conf directory.
Navigate to the Conf directory. It should contain the following files:
- Config.sh
- Service_conf_mapping.sh
1. Edit Config.sh.
Open Config.sh for editing. Here you can specify the following settings:
Time Configuration for Log Collection#
# If start date and end date is empty, the script won't fetch the centralized log
START_TIME="2023-01-30 08:10" # Format: %Y-%m-%d %H:%M [System timezone]
END_TIME="2023-01-30 08:20" # Format: %Y-%m-%d %H:%M [System timezone]
CENTRALIZED_LOGS="N"
- START_TIME & END_TIME: These settings define the time frame for collecting logs. If these fields are left empty, centralized logs will not be collected.
Note: Time format is %Y-%m-%d %H:%M in your system's timezone. - CENTRALIZED_LOGS: Set this to "Y" if you want to fetch centralized logs. Setting it to "N" will disable centralized log collection.
Service Information#
HAPRAXY_IP=$(consul kv get service/haproxy/ip)
HAPRAXY_PORT=$(consul kv get service/haproxy/node1/port/http)
OPENSEARCH_IP=$(consul kv get service/opensearch/node1/hostname)
OPENSEARCH_PORT=$(consul kv get service/opensearch/port)
These lines fetch IP and port information for various services from the Consul key-value store. You usually don't need to edit these lines unless you have custom requirements.
HAProxy and Database Credentials#
# HAProxy USERNAME and PASSWORD
USERNAME="admin"
PASSWORD="<password>"
# Database USERNAME & PASSWORD
DB_USER=$(consul kv get service/perconadb/username)
MYSQL_PWD=<password> kv get service/perconadb/password_ui | base64 -d)
- USERNAME & PASSWORD: These are the credentials needed to collect HAProxy statistics.
- DB_USER & MYSQL_PWD: These are fetched from Consul and are the credentials for the database.
Logging and Verbosity#
# Log level
LogEnabled="Y"
Verbose="Y"
- LogEnabled: Set to "Y" to enable logging. This will enable the program to record specified events, errors, or actions into the log file.
- Verbose: Set to "Y" to enable verbose logging. This will enable the logging mechanism to capture more detailed information.
Output Configuration#
# Output File split size
FILE_SIZE="1m"
FILE_SIZE: Specifies the size at which the output file should be split. You can use units like 'k', 'm', 'g', 't'.
Data Collection Parameters#
PERCONA_SYNC_INO="Y"
DOCKER_INTERVAL="1"
REDIS_INFO="Y"
RABITMQ_INFO="Y"
DOCKER_STATS="Y"
MODULE_VERSIONS="Y"
UPTIME_ULIMIT="N"
LSOF_OUTPUT="N"
TOP_OUTPUT="Y"
CONSUL_OUTPUT="Y"
HAPROXY_STATS="Y"
OPENSEARCH_INFO="Y"
REDIS_CLUSTER_INFO="Y"
NOMAD_FILES="Y"
VAR_LOGS="Y"
Each of these parameters enables the collection of specific data:
- Set any parameter to "Y" if you need that specific information or "N" if not needed.
- DOCKER_INTERVAL: The time interval in seconds for collecting Docker statistics.
- It is advised to set the UPTIME_ULIMIT parameter and LSOF parameter to "N" unless specifically required for advanced debugging. Including this information may consume additional system resources.
Service Config Files#
# If All the Service config files required from container. Mentioned SERVICE_CONFIG="Y"
SERVICE_CONFIG: If set to "Y", the diagnostic data will include the configuration files for all services running in containers.
Note: For complete details on each configurable parameter, refer to the README file located in the same directory.
2. Save the file and exit the editor.